Bug 1450629 [wpt PR 10267] - ReadableStream: getReader() should call ToString() on mode, a=testonly
authorAdam Rice <ricea@chromium.org>
Mon, 09 Apr 2018 21:33:38 +0000
changeset 467252 8bcfbeb41e46af08b78c070d4dd71e0ca63d048f
parent 467251 2eb0e12efd4516aa869c81c17f78660b0f0d04f0
child 467253 9dc5a73f15ff105f92dd826c9c88edd773313321
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
bugs1450629, 10267
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 1450629 [wpt PR 10267] - ReadableStream: getReader() should call ToString() on mode, a=testonly Automatic update from web-platform-testsReadableStream: getReader() should call ToString() on mode When the "mode" option is not undefined, getReader({mode}) algorithm calls ToString() on it before checking whether or not it is "blob". Add a test to ensure this conversion is done. wpt-commits: ea469b6059e82729ef04cd90758fc9b52b733c7f wpt-pr: 10267 wpt-commits: ea469b6059e82729ef04cd90758fc9b52b733c7f wpt-pr: 10267
testing/web-platform/meta/MANIFEST.json
testing/web-platform/tests/streams/readable-streams/default-reader.js
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -596898,17 +596898,17 @@
    "42750f1d324f57507feb0260704a55c4cc0f8382",
    "testharness"
   ],
   "streams/readable-streams/default-reader.html": [
    "4dca4e9785abb22b398029417dde50621c5c92aa",
    "testharness"
   ],
   "streams/readable-streams/default-reader.js": [
-   "8746e2c94c2bc28431aefaae71d83f87c5738cde",
+   "639fc79798f07714549495a52364408773ac830a",
    "support"
   ],
   "streams/readable-streams/default-reader.serviceworker.https.html": [
    "7a3f17c90551967ccc24bbc835eef2b521bf08b9",
    "testharness"
   ],
   "streams/readable-streams/default-reader.sharedworker.html": [
    "399221af8cca8157bcaa05582dc66e94e56bc856",
--- a/testing/web-platform/tests/streams/readable-streams/default-reader.js
+++ b/testing/web-platform/tests/streams/readable-streams/default-reader.js
@@ -480,9 +480,22 @@ promise_test(t => {
     promise_rejects(t, myError, reader.closed)
   ]);
 
   controller.error(myError);
   return promise;
 
 }, 'Reading twice on a stream that gets errored');
 
+test(() => {
+  const rs = new ReadableStream();
+  let toStringCalled = false;
+  const mode = {
+    toString() {
+      toStringCalled = true;
+      return '';
+    }
+  };
+  assert_throws(new RangeError(), () => rs.getReader({ mode }), 'getReader() should throw');
+  assert_true(toStringCalled, 'toString() should be called');
+}, 'getReader() should call ToString() on mode');
+
 done();