Bug 1452175 [wpt PR 9944] - WritableStream: Add smoke tests for abort() with non-Error arguments, a=testonly
authorAdam Rice <ricea@chromium.org>
Mon, 09 Apr 2018 16:45:06 +0000
changeset 467039 4743879be1c1712f976bf8a4007bd28d3a0f0353
parent 467038 20001f8d99e2fc7b822caafbadd04161dba81b8b
child 467040 b54fd13d3ac4eaadd44ad12b346084654cf86158
push id9165
push userasasaki@mozilla.com
push dateThu, 26 Apr 2018 21:04:54 +0000
treeherdermozilla-beta@064c3804de2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1452175
milestone61.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1452175 [wpt PR 9944] - WritableStream: Add smoke tests for abort() with non-Error arguments, a=testonly Automatic update from web-platform-testsWritableStream: Add smoke tests for abort() with non-Error arguments Verify that abort(), abort(undefined) and abort('string') all work as expected, when called on a writer. The reason must be reflected in rejections received from the object. wpt-commits: dc2b10130978a3ebec39ccddade8cbbfcc7bb715 wpt-pr: 9944 wpt-commits: dc2b10130978a3ebec39ccddade8cbbfcc7bb715 wpt-pr: 9944
testing/web-platform/meta/MANIFEST.json
testing/web-platform/tests/streams/writable-streams/aborting.js
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -595280,17 +595280,17 @@
    "89cfc3ba5cfbb426b6ac60c32aa5cfe9dd0ad8b4",
    "testharness"
   ],
   "streams/writable-streams/aborting.html": [
    "9cacb1967fee9eab8619b949101e28ffde922ed9",
    "testharness"
   ],
   "streams/writable-streams/aborting.js": [
-   "f10c4d9ffb59d4480fd069a9ea70ec41f5b71754",
+   "24615519115cde901b8cac1a19c23cd0d9244a17",
    "support"
   ],
   "streams/writable-streams/aborting.serviceworker.https.html": [
    "b69530ebf51ccaf781ff78172be2f4607ee22c86",
    "testharness"
   ],
   "streams/writable-streams/aborting.sharedworker.html": [
    "9e792fad19cd10a96440478cb7e0486f41b70bf4",
--- a/testing/web-platform/tests/streams/writable-streams/aborting.js
+++ b/testing/web-platform/tests/streams/writable-streams/aborting.js
@@ -1340,9 +1340,36 @@ promise_test(t => {
       promise_rejects(t, new RangeError(), writePromise2, 'second write() should reject'),
       promise_rejects(t, new RangeError(), abortPromise, 'abort() should reject')
     ]).then(() => {
       assert_array_equals(ws.events, ['write', 'chunk1'], 'sink abort() should not be called');
     });
   });
 }, 'sink abort() should not be called if stream was erroring due to bad strategy before abort() was called');
 
+promise_test(t => {
+  const ws = new WritableStream();
+  return ws.abort().then(() => {
+    const writer = ws.getWriter();
+    return writer.closed.then(t.unreached_func('closed promise should not fulfill'),
+                              e => assert_equals(e, undefined, 'e should be undefined'));
+  });
+}, 'abort with no arguments should set the stored error to undefined');
+
+promise_test(t => {
+  const ws = new WritableStream();
+  return ws.abort(undefined).then(() => {
+    const writer = ws.getWriter();
+    return writer.closed.then(t.unreached_func('closed promise should not fulfill'),
+                              e => assert_equals(e, undefined, 'e should be undefined'));
+  });
+}, 'abort with an undefined argument should set the stored error to undefined');
+
+promise_test(t => {
+  const ws = new WritableStream();
+  return ws.abort('string argument').then(() => {
+    const writer = ws.getWriter();
+    return writer.closed.then(t.unreached_func('closed promise should not fulfill'),
+                              e => assert_equals(e, 'string argument', 'e should be \'string argument\''));
+  });
+}, 'abort with a string argument should set the stored error to that argument');
+
 done();