Title: [265417] trunk
Revision
265417
Author
[email protected]
Date
2020-08-09 08:34:01 -0700 (Sun, 09 Aug 2020)

Log Message

Always resolve ReadableStream's tee()'s cancel promise after the stream closes or errors
https://bugs.webkit.org/show_bug.cgi?id=215197

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

* resources/import-expectations.json:
* web-platform-tests/streams: Resynced to upstream WPT.

Source/WebCore:

Make sure to resolve the cancel promise if the source gets closed or errored.
Test: imported/w3c/web-platform-tests/streams/queuing-strategies-size-function-per-global.window.html

* Modules/streams/ReadableStreamInternals.js:
(readableStreamTee):
(readableStreamTeePullFunction):

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (265416 => 265417)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2020-08-09 11:49:11 UTC (rev 265416)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2020-08-09 15:34:01 UTC (rev 265417)
@@ -1,3 +1,13 @@
+2020-08-09  Youenn Fablet  <[email protected]>
+
+        Always resolve ReadableStream's tee()'s cancel promise after the stream closes or errors
+        https://bugs.webkit.org/show_bug.cgi?id=215197
+
+        Reviewed by Darin Adler.
+
+        * resources/import-expectations.json:
+        * web-platform-tests/streams: Resynced to upstream WPT.
+
 2020-08-07  Chris Dumez  <[email protected]>
 
         AudioContext / OfflineAudioContext should support a wider sample rate range

Modified: trunk/LayoutTests/imported/w3c/resources/import-expectations.json (265416 => 265417)


--- trunk/LayoutTests/imported/w3c/resources/import-expectations.json	2020-08-09 11:49:11 UTC (rev 265416)
+++ trunk/LayoutTests/imported/w3c/resources/import-expectations.json	2020-08-09 15:34:01 UTC (rev 265417)
@@ -21,6 +21,7 @@
     "paint-timing/resources/": "import", 
     "resources/testharness.js": "import", 
     "shadow-dom": "import", 
+    "streams": "import", 
     "tools": "import", 
     "web-animations": "import", 
     "web-platform-tests/DOM-parsing": "skip", 

Deleted: trunk/LayoutTests/imported/w3c/web-platform-tests/streams/byte-length-queuing-strategy-expected.txt (265416 => 265417)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/streams/byte-length-queuing-strategy-expected.txt	2020-08-09 11:49:11 UTC (rev 265416)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/streams/byte-length-queuing-strategy-expected.txt	2020-08-09 15:34:01 UTC (rev 265417)
@@ -1,10 +0,0 @@
-
-PASS Can construct a ByteLengthQueuingStrategy with a valid high water mark 
-PASS Can construct a ByteLengthQueuingStrategy with any value as its high water mark 
-PASS ByteLengthQueuingStrategy constructor behaves as expected with strange arguments 
-PASS ByteLengthQueuingStrategy size behaves as expected with strange arguments 
-PASS ByteLengthQueuingStrategy.prototype.size should work generically on its this and its arguments 
-PASS ByteLengthQueuingStrategy instances have the correct properties 
-PASS ByteLengthQueuingStrategy's highWaterMark property can be set to anything 
-PASS ByteLengthQueuingStrategy.name is correct 
-

Deleted: trunk/LayoutTests/imported/w3c/web-platform-tests/streams/count-queuing-strategy-expected.txt (265416 => 265417)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/streams/count-queuing-strategy-expected.txt	2020-08-09 11:49:11 UTC (rev 265416)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/streams/count-queuing-strategy-expected.txt	2020-08-09 15:34:01 UTC (rev 265417)
@@ -1,10 +0,0 @@
-
-PASS Can construct a CountQueuingStrategy with a valid high water mark 
-PASS Can construct a CountQueuingStrategy with any value as its high water mark 
-PASS CountQueuingStrategy constructor behaves as expected with strange arguments 
-PASS CountQueuingStrategy.prototype.size should work generically on its this and its arguments 
-PASS CountQueuingStrategy size behaves as expected with strange arguments 
-PASS CountQueuingStrategy instances have the correct properties 
-PASS CountQueuingStrategy's highWaterMark property can be set to anything 
-PASS CountQueuingStrategy.name is correct 
-

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/streams/piping/then-interception.any-expected.txt (265416 => 265417)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/streams/piping/then-interception.any-expected.txt	2020-08-09 11:49:11 UTC (rev 265416)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/streams/piping/then-interception.any-expected.txt	2020-08-09 15:34:01 UTC (rev 265417)
@@ -1,6 +1,6 @@
-CONSOLE MESSAGE: Unhandled Promise Rejection: TypeError: Attempted to assign to readonly property.
+CONSOLE MESSAGE: Unhandled Promise Rejection: TypeError: undefined is not a function
 
-Harness Error (FAIL), message = Unhandled rejection: Attempted to assign to readonly property.
+Harness Error (FAIL), message = Unhandled rejection: undefined is not a function
 
 TIMEOUT piping should not be observable Test timed out
 NOTRUN tee should not be observable 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/streams/piping/then-interception.any.js (265416 => 265417)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/streams/piping/then-interception.any.js	2020-08-09 11:49:11 UTC (rev 265416)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/streams/piping/then-interception.any.js	2020-08-09 15:34:01 UTC (rev 265417)
@@ -5,7 +5,7 @@
 
 function interceptThen() {
   const intercepted = [];
-  const callCount = 0;
+  let callCount = 0;
   Object.prototype.then = function(resolver) {
     if (!this.done) {
       intercepted.push(this.value);
@@ -21,7 +21,7 @@
   return intercepted;
 }
 
-promise_test(async () => {
+promise_test(async t => {
   const rs = new ReadableStream({
     start(controller) {
       controller.enqueue('a');
@@ -31,6 +31,9 @@
   const ws = recordingWritableStream();
 
   const intercepted = interceptThen();
+  t.add_cleanup(() => {
+    delete Object.prototype.then;
+  });
 
   await rs.pipeTo(ws);
   delete Object.prototype.then;
@@ -40,7 +43,7 @@
   assert_array_equals(ws.events, ['write', 'a', 'close'], 'written chunk should be "a"');
 }, 'piping should not be observable');
 
-promise_test(async () => {
+promise_test(async t => {
   const rs = new ReadableStream({
     start(controller) {
       controller.enqueue('a');
@@ -52,6 +55,9 @@
   const [ branch1, branch2 ] = rs.tee();
 
   const intercepted = interceptThen();
+  t.add_cleanup(() => {
+    delete Object.prototype.then;
+  });
 
   await branch1.pipeTo(ws);
   delete Object.prototype.then;

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/streams/queuing-strategies-size-function-per-global.window-expected.txt (0 => 265417)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/streams/queuing-strategies-size-function-per-global.window-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/streams/queuing-strategies-size-function-per-global.window-expected.txt	2020-08-09 15:34:01 UTC (rev 265417)
@@ -0,0 +1,4 @@
+
+PASS CountQueuingStrategy size should be different for objects in different realms 
+PASS ByteLengthQueuingStrategy size should be different for objects in different realms 
+

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/streams/queuing-strategies-size-function-per-global.window.html (0 => 265417)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/streams/queuing-strategies-size-function-per-global.window.html	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/streams/queuing-strategies-size-function-per-global.window.html	2020-08-09 15:34:01 UTC (rev 265417)
@@ -0,0 +1 @@
+<!-- This file is required for WebKit test infrastructure to run the templated test -->
\ No newline at end of file

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/streams/queuing-strategies-size-function-per-global.window.js (0 => 265417)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/streams/queuing-strategies-size-function-per-global.window.js	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/streams/queuing-strategies-size-function-per-global.window.js	2020-08-09 15:34:01 UTC (rev 265417)
@@ -0,0 +1,14 @@
+const iframe = document.createElement('iframe');
+document.body.appendChild(iframe);
+
+for (const type of ['CountQueuingStrategy', 'ByteLengthQueuingStrategy']) {
+  test(() => {
+    const myQs = new window[type]({ highWaterMark: 1 });
+    const yourQs = new iframe.contentWindow[type]({ highWaterMark: 1 });
+    assert_not_equals(myQs.size, yourQs.size,
+                      'size should not be the same object');
+  }, `${type} size should be different for objects in different realms`);
+}
+
+// Cleanup the document to avoid messing up the result page.
+iframe.remove();

Deleted: trunk/LayoutTests/imported/w3c/web-platform-tests/streams/readable-byte-streams/brand-checks-expected.txt (265416 => 265417)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/streams/readable-byte-streams/brand-checks-expected.txt	2020-08-09 11:49:11 UTC (rev 265416)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/streams/readable-byte-streams/brand-checks-expected.txt	2020-08-09 15:34:01 UTC (rev 265417)
@@ -1,16 +0,0 @@
-
-PASS Can get the ReadableStreamBYOBReader constructor indirectly 
-PASS Can get the ReadableByteStreamController constructor indirectly 
-PASS ReadableStreamBYOBReader enforces a brand check on its argument 
-PASS ReadableStreamBYOBReader.prototype.closed enforces a brand check 
-PASS ReadableStreamBYOBReader.prototype.cancel enforces a brand check 
-PASS ReadableStreamBYOBReader.prototype.read enforces a brand check 
-PASS ReadableStreamBYOBReader.prototype.releaseLock enforces a brand check 
-PASS ReadableByteStreamController enforces a brand check on its arguments 
-PASS ReadableByteStreamController can't be given a fully-constructed ReadableStream 
-PASS ReadableByteStreamController.prototype.byobRequest enforces a brand check 
-PASS ReadableByteStreamController.prototype.close enforces a brand check 
-PASS ReadableByteStreamController.prototype.enqueue enforces a brand check 
-PASS ReadableByteStreamController.prototype.error enforces a brand check 
-PASS ReadableStreamBYOBRequest enforces brand checks 
-

Deleted: trunk/LayoutTests/imported/w3c/web-platform-tests/streams/readable-byte-streams/detached-buffers-expected.txt (265416 => 265417)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/streams/readable-byte-streams/detached-buffers-expected.txt	2020-08-09 11:49:11 UTC (rev 265416)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/streams/readable-byte-streams/detached-buffers-expected.txt	2020-08-09 15:34:01 UTC (rev 265417)
@@ -1,12 +0,0 @@
-
-Harness Error (TIMEOUT), message = null
-
-FAIL ReadableStream with byte source: read()ing from a closed stream still transfers the buffer assert_not_equals: a different ArrayBuffer must underlie the value got disallowed value object "[object ArrayBuffer]"
-FAIL ReadableStream with byte source: read()ing from a stream with queued chunks still transfers the buffer assert_not_equals: a different ArrayBuffer must underlie the value got disallowed value object "[object ArrayBuffer]"
-FAIL ReadableStream with byte source: enqueuing an already-detached buffer throws assert_throws: enqueuing an already-detached buffer must throw function "() => c.enqueue(view)" did not throw
-TIMEOUT ReadableStream with byte source: reading into an already-detached buffer rejects Test timed out
-FAIL ReadableStream with byte source: respond() throws if the BYOB request's buffer has been detached (in the readable state) assert_throws: respond() must throw if the corresponding view has become detached function "() => c.byobRequest.respond(1)" did not throw
-FAIL ReadableStream with byte source: respond() throws if the BYOB request's buffer has been detached (in the closed state) assert_throws: respond() must throw if the corresponding view has become detached function "() => c.byobRequest.respond(0)" did not throw
-FAIL ReadableStream with byte source: respondWithNewView() throws if the supplied view's buffer has been detached (in the readable state) assert_throws: respondWithNewView() must throw if passed a detached view function "() => c.byobRequest.respondWithNewView(view)" did not throw
-FAIL ReadableStream with byte source: respondWithNewView() throws if the supplied view's buffer has been detached (in the closed state) assert_throws: respondWithNewView() must throw if passed a (zero-length) view whose buffer has been detached function "() => c.byobRequest.respondWithNewView(zeroLengthView)" threw object "RangeError: Invalid value for view.byteLength" ("RangeError") expected object "TypeError" ("TypeError")
-

Deleted: trunk/LayoutTests/imported/w3c/web-platform-tests/streams/readable-byte-streams/properties-expected.txt (265416 => 265417)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/streams/readable-byte-streams/properties-expected.txt	2020-08-09 11:49:11 UTC (rev 265416)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/streams/readable-byte-streams/properties-expected.txt	2020-08-09 15:34:01 UTC (rev 265417)
@@ -1,7 +0,0 @@
-
-PASS Can get the ReadableStreamBYOBReader constructor indirectly 
-PASS ReadableStreamBYOBReader constructor should get a ReadableStream object as argument 
-PASS ReadableStreamBYOBReader instances should have the correct list of properties 
-FAIL ReadableStreamBYOBRequest instances should have the correct list of properties assert_equals: constructor has 0 parameters expected 0 but got 2
-FAIL ReadableByteStreamController instances should have the correct list of properties assert_equals: constructor has no parameters expected 0 but got 3
-

Deleted: trunk/LayoutTests/imported/w3c/web-platform-tests/streams/readable-streams/brand-checks-expected.txt (265416 => 265417)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/streams/readable-streams/brand-checks-expected.txt	2020-08-09 11:49:11 UTC (rev 265416)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/streams/readable-streams/brand-checks-expected.txt	2020-08-09 15:34:01 UTC (rev 265417)
@@ -1,17 +0,0 @@
-
-PASS Can get the ReadableStreamDefaultReader constructor indirectly 
-PASS Can get the ReadableStreamDefaultController constructor indirectly 
-PASS ReadableStream.prototype.cancel enforces a brand check 
-PASS ReadableStream.prototype.getReader enforces a brand check 
-PASS ReadableStream.prototype.tee enforces a brand check 
-PASS ReadableStreamDefaultReader enforces a brand check on its argument 
-PASS ReadableStreamDefaultReader.prototype.closed enforces a brand check 
-PASS ReadableStreamDefaultReader.prototype.cancel enforces a brand check 
-PASS ReadableStreamDefaultReader.prototype.read enforces a brand check 
-PASS ReadableStreamDefaultReader.prototype.releaseLock enforces a brand check 
-PASS ReadableStreamDefaultController enforces a brand check on its argument 
-PASS ReadableStreamDefaultController can't be given a fully-constructed ReadableStream 
-PASS ReadableStreamDefaultController.prototype.close enforces a brand check 
-PASS ReadableStreamDefaultController.prototype.enqueue enforces a brand check 
-PASS ReadableStreamDefaultController.prototype.error enforces a brand check 
-

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/streams/readable-streams/tee.any-expected.txt (265416 => 265417)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/streams/readable-streams/tee.any-expected.txt	2020-08-09 11:49:11 UTC (rev 265416)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/streams/readable-streams/tee.any-expected.txt	2020-08-09 15:34:01 UTC (rev 265417)
@@ -4,6 +4,7 @@
 CONSOLE MESSAGE: Unhandled Promise Rejection: [object Object]
 CONSOLE MESSAGE: Unhandled Promise Rejection: [object Object]
 CONSOLE MESSAGE: Unhandled Promise Rejection: [object Object]
+CONSOLE MESSAGE: Unhandled Promise Rejection: [object Object]
 
 Harness Error (FAIL), message = Unhandled rejection
 
@@ -20,6 +21,8 @@
 PASS ReadableStream teeing: erroring a teed stream should error both branches 
 PASS ReadableStream teeing: closing the original should immediately close the branches 
 PASS ReadableStream teeing: erroring the original should immediately error the branches 
+PASS ReadableStream teeing: canceling branch1 should finish when branch2 reads until end of stream 
+PASS ReadableStream teeing: canceling branch1 should finish when original stream errors 
 PASS ReadableStreamTee should not use a modified ReadableStream constructor from the global object 
 FAIL ReadableStreamTee should not pull more chunks than can fit in the branch queue assert_array_equals: pull should only be called once lengths differ, expected array ["pull"] length 1, got ["pull", "pull"] length 2
 FAIL ReadableStreamTee should only pull enough to fill the emptiest queue assert_array_equals: pull should be called twice lengths differ, expected array ["pull", "pull"] length 2, got ["pull", "pull", "pull", "pull"] length 4

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/streams/readable-streams/tee.any.js (265416 => 265417)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/streams/readable-streams/tee.any.js	2020-08-09 11:49:11 UTC (rev 265416)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/streams/readable-streams/tee.any.js	2020-08-09 15:34:01 UTC (rev 265417)
@@ -317,6 +317,57 @@
 
 }, 'ReadableStream teeing: erroring the original should immediately error the branches');
 
+promise_test(async t => {
+
+  let controller;
+  const rs = new ReadableStream({
+    start(c) {
+      controller = c;
+    }
+  });
+
+  const [reader1, reader2] = rs.tee().map(branch => branch.getReader());
+  const cancelPromise = reader2.cancel();
+
+  controller.enqueue('a');
+
+  const read1 = await reader1.read();
+  assert_object_equals(read1, { value: 'a', done: false }, 'first read() from branch1 should fulfill with the chunk');
+
+  controller.close();
+
+  const read2 = await reader1.read();
+  assert_object_equals(read2, { value: undefined, done: true }, 'second read() from branch1 should be done');
+
+  await Promise.all([
+    reader1.closed,
+    cancelPromise
+  ]);
+
+}, 'ReadableStream teeing: canceling branch1 should finish when branch2 reads until end of stream');
+
+promise_test(async t => {
+
+  let controller;
+  const theError = { name: 'boo!' };
+  const rs = new ReadableStream({
+    start(c) {
+      controller = c;
+    }
+  });
+
+  const [reader1, reader2] = rs.tee().map(branch => branch.getReader());
+  const cancelPromise = reader2.cancel();
+
+  controller.error(theError);
+
+  await Promise.all([
+    promise_rejects_exactly(t, theError, reader1.read()),
+    cancelPromise
+  ]);
+
+}, 'ReadableStream teeing: canceling branch1 should finish when original stream errors');
+
 test(t => {
 
   // Copy original global.

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/streams/readable-streams/tee.any.worker-expected.txt (265416 => 265417)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/streams/readable-streams/tee.any.worker-expected.txt	2020-08-09 11:49:11 UTC (rev 265416)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/streams/readable-streams/tee.any.worker-expected.txt	2020-08-09 15:34:01 UTC (rev 265417)
@@ -14,6 +14,8 @@
 PASS ReadableStream teeing: erroring a teed stream should error both branches 
 PASS ReadableStream teeing: closing the original should immediately close the branches 
 PASS ReadableStream teeing: erroring the original should immediately error the branches 
+PASS ReadableStream teeing: canceling branch1 should finish when branch2 reads until end of stream 
+PASS ReadableStream teeing: canceling branch1 should finish when original stream errors 
 PASS ReadableStreamTee should not use a modified ReadableStream constructor from the global object 
 FAIL ReadableStreamTee should not pull more chunks than can fit in the branch queue assert_array_equals: pull should only be called once lengths differ, expected array ["pull"] length 1, got ["pull", "pull"] length 2
 FAIL ReadableStreamTee should only pull enough to fill the emptiest queue assert_array_equals: pull should be called twice lengths differ, expected array ["pull", "pull"] length 2, got ["pull", "pull", "pull", "pull"] length 4

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/streams/transform-streams/patched-global.any-expected.txt (265416 => 265417)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/streams/transform-streams/patched-global.any-expected.txt	2020-08-09 11:49:11 UTC (rev 265416)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/streams/transform-streams/patched-global.any-expected.txt	2020-08-09 15:34:01 UTC (rev 265417)
@@ -1,4 +1,6 @@
 
+Harness Error (FAIL), message = Test named 'TransformStream constructor should not call setters for highWaterMark or size' specified 1 'cleanup' function, and 1 failed.
+
 FAIL TransformStream constructor should not call setters for highWaterMark or size Can't find variable: TransformStream
-FAIL TransformStream should use the original value of ReadableStream and WritableStream Can't find variable: TransformStream
+NOTRUN TransformStream should use the original value of ReadableStream and WritableStream 
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/streams/transform-streams/patched-global.any.js (265416 => 265417)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/streams/transform-streams/patched-global.any.js	2020-08-09 11:49:11 UTC (rev 265416)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/streams/transform-streams/patched-global.any.js	2020-08-09 15:34:01 UTC (rev 265417)
@@ -1,19 +1,25 @@
 // META: global=window,worker,jsshell
 'use strict';
 
-// Tests which patch the global environment are kept separate to avoid interfering with other tests.
+// Tests which patch the global environment are kept separate to avoid
+// interfering with other tests.
 
-// eslint-disable-next-line no-extend-native, accessor-pairs
-Object.defineProperty(Object.prototype, 'highWaterMark', {
-  set() { throw new Error('highWaterMark setter called'); }
-});
+test(t => {
+  // eslint-disable-next-line no-extend-native, accessor-pairs
+  Object.defineProperty(Object.prototype, 'highWaterMark', {
+    set() { throw new Error('highWaterMark setter called'); }
+  });
 
-// eslint-disable-next-line no-extend-native, accessor-pairs
-Object.defineProperty(Object.prototype, 'size', {
-  set() { throw new Error('size setter called'); }
-});
+  // eslint-disable-next-line no-extend-native, accessor-pairs
+  Object.defineProperty(Object.prototype, 'size', {
+    set() { throw new Error('size setter called'); }
+  });
 
-test(() => {
+  t.add_cleanup(() => {
+    delete Object.prototype.highWaterMark;
+    delete Object.prototype.size;
+  });
+
   assert_not_equals(new TransformStream(), null, 'constructor should work');
 }, 'TransformStream constructor should not call setters for highWaterMark or size');
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/streams/transform-streams/patched-global.any.worker-expected.txt (265416 => 265417)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/streams/transform-streams/patched-global.any.worker-expected.txt	2020-08-09 11:49:11 UTC (rev 265416)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/streams/transform-streams/patched-global.any.worker-expected.txt	2020-08-09 15:34:01 UTC (rev 265417)
@@ -1,4 +1,6 @@
 
+Harness Error (FAIL), message = Test named 'TransformStream constructor should not call setters for highWaterMark or size' specified 1 'cleanup' function, and 1 failed.
+
 FAIL TransformStream constructor should not call setters for highWaterMark or size Can't find variable: TransformStream
-FAIL TransformStream should use the original value of ReadableStream and WritableStream Can't find variable: WritableStream
+NOTRUN TransformStream should use the original value of ReadableStream and WritableStream 
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/streams/w3c-import.log (265416 => 265417)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/streams/w3c-import.log	2020-08-09 11:49:11 UTC (rev 265416)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/streams/w3c-import.log	2020-08-09 15:34:01 UTC (rev 265417)
@@ -17,4 +17,5 @@
 /LayoutTests/imported/w3c/web-platform-tests/streams/META.yml
 /LayoutTests/imported/w3c/web-platform-tests/streams/README.md
 /LayoutTests/imported/w3c/web-platform-tests/streams/idlharness.any.js
+/LayoutTests/imported/w3c/web-platform-tests/streams/queuing-strategies-size-function-per-global.window.js
 /LayoutTests/imported/w3c/web-platform-tests/streams/queuing-strategies.any.js

Modified: trunk/Source/WebCore/ChangeLog (265416 => 265417)


--- trunk/Source/WebCore/ChangeLog	2020-08-09 11:49:11 UTC (rev 265416)
+++ trunk/Source/WebCore/ChangeLog	2020-08-09 15:34:01 UTC (rev 265417)
@@ -1,3 +1,17 @@
+2020-08-09  Youenn Fablet  <[email protected]>
+
+        Always resolve ReadableStream's tee()'s cancel promise after the stream closes or errors
+        https://bugs.webkit.org/show_bug.cgi?id=215197
+
+        Reviewed by Darin Adler.
+
+        Make sure to resolve the cancel promise if the source gets closed or errored.
+        Test: imported/w3c/web-platform-tests/streams/queuing-strategies-size-function-per-global.window.html
+
+        * Modules/streams/ReadableStreamInternals.js:
+        (readableStreamTee):
+        (readableStreamTeePullFunction):
+
 2020-08-08  Myles C. Maxfield  <[email protected]>
 
         Update OriginalAdvancesForCharacterTreatedAsSpace to work correctly in the presence of inserted or removed glyphs

Modified: trunk/Source/WebCore/Modules/streams/ReadableStreamInternals.js (265416 => 265417)


--- trunk/Source/WebCore/Modules/streams/ReadableStreamInternals.js	2020-08-09 11:49:11 UTC (rev 265416)
+++ trunk/Source/WebCore/Modules/streams/ReadableStreamInternals.js	2020-08-09 15:34:01 UTC (rev 265417)
@@ -169,6 +169,7 @@
         @readableStreamDefaultControllerError(branch1.@readableStreamController, e);
         @readableStreamDefaultControllerError(branch2.@readableStreamController, e);
         teeState.closedOrErrored = true;
+        teeState.cancelPromiseCapability.@resolve.@call();
     });
 
     // Additional fields compared to the spec, as they are needed within pull/cancel functions.
@@ -208,6 +209,7 @@
                 if (!teeState.canceled2)
                     @readableStreamDefaultControllerClose(teeState.branch2.@readableStreamController);
                 teeState.closedOrErrored = true;
+                teeState.cancelPromiseCapability.@resolve.@call();
             }
             if (teeState.closedOrErrored)
                 return;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to