Diff
Modified: trunk/LayoutTests/ChangeLog (218925 => 218926)
--- trunk/LayoutTests/ChangeLog 2017-06-29 16:10:10 UTC (rev 218925)
+++ trunk/LayoutTests/ChangeLog 2017-06-29 16:19:38 UTC (rev 218926)
@@ -1,3 +1,16 @@
+2017-06-29 Romain Bellessort <[email protected]>
+
+ [Readable Streams API] Fix ReadableStream "strategy" argument handling
+ https://bugs.webkit.org/show_bug.cgi?id=172716
+
+ Reviewed by Xabier Rodriguez-Calvar.
+
+ Added new tests and updated some existing ones based on the newly
+ expected behavior.
+
+ * streams/readable-byte-stream-controller-expected.txt: Updated.
+ * streams/readable-byte-stream-controller.js: Updated.
+
2017-06-29 Antti Koivisto <[email protected]>
NAS4Free Pop-down menus take 3 seconds to appear
Modified: trunk/LayoutTests/imported/w3c/ChangeLog (218925 => 218926)
--- trunk/LayoutTests/imported/w3c/ChangeLog 2017-06-29 16:10:10 UTC (rev 218925)
+++ trunk/LayoutTests/imported/w3c/ChangeLog 2017-06-29 16:19:38 UTC (rev 218926)
@@ -1,3 +1,15 @@
+2017-06-29 Romain Bellessort <[email protected]>
+
+ [Readable Streams API] Fix ReadableStream "strategy" argument handling
+ https://bugs.webkit.org/show_bug.cgi?id=172716
+
+ Reviewed by Xabier Rodriguez-Calvar.
+
+ Updated expectations.
+
+ * web-platform-tests/streams/readable-byte-streams/general-expected.txt: Updated.
+ * web-platform-tests/streams/readable-byte-streams/general.dedicatedworker-expected.txt: Updated.
+
2017-06-28 Frederic Wang <[email protected]>
Align Document::canNavigate on the HTM5 specification
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/streams/readable-byte-streams/general-expected.txt (218925 => 218926)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/streams/readable-byte-streams/general-expected.txt 2017-06-29 16:10:10 UTC (rev 218925)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/streams/readable-byte-streams/general-expected.txt 2017-06-29 16:19:38 UTC (rev 218926)
@@ -32,12 +32,12 @@
PASS ReadableStream with byte source: read(view), then respond()
PASS ReadableStream with byte source: read(view), then respond() with a transferred ArrayBuffer
PASS ReadableStream with byte source: read(view), then respond() with too big value
-FAIL ReadableStream with byte source: respond(3) to read(view) with 2 element Uint16Array enqueues the 1 byte remainder assert_equals: expected 1 but got 2
-FAIL ReadableStream with byte source: enqueue(), getReader(), then read(view) assert_unreached: pull() should not be called Reached unreachable code
+FAIL ReadableStream with byte source: respond(3) to read(view) with 2 element Uint16Array enqueues the 1 byte remainder assert_equals: expected 3 but got 0
+FAIL ReadableStream with byte source: enqueue(), getReader(), then read(view) assert_equals: expected 1 but got 0
PASS ReadableStream with byte source: enqueue(), getReader(), then cancel() (mode = not BYOB)
PASS ReadableStream with byte source: enqueue(), getReader(), then cancel() (mode = BYOB)
PASS ReadableStream with byte source: getReader(), read(view), then cancel()
-FAIL ReadableStream with byte source: cancel() with partially filled pending pull() request assert_equals: 1 pull() should have been made in response to partial fill by enqueue() expected 1 but got 0
+PASS ReadableStream with byte source: cancel() with partially filled pending pull() request
FAIL ReadableStream with byte source: enqueue(), getReader(), then read(view) where view.buffer is not fully covered by view assert_equals: expected 1 but got 0
FAIL ReadableStream with byte source: Multiple enqueue(), getReader(), then read(view) assert_equals: Contents are set from the first chunk expected 123 but got 0
FAIL ReadableStream with byte source: enqueue(), getReader(), then read(view) with a bigger view assert_equals: expected 1 but got 0
@@ -52,7 +52,7 @@
PASS ReadableStream with byte source: read(view) with Uint32Array, then fill it by multiple respond() calls
PASS ReadableStream with byte source: read() twice, then enqueue() twice
PASS ReadableStream with byte source: Multiple read(view), close() and respond()
-FAIL ReadableStream with byte source: Multiple read(view), big enqueue() assert_unreached: pull() should not be called Reached unreachable code
+PASS ReadableStream with byte source: Multiple read(view), big enqueue()
PASS ReadableStream with byte source: Multiple read(view) and multiple enqueue()
PASS ReadableStream with byte source: read(view) with passing undefined as view must fail
PASS ReadableStream with byte source: read(view) with zero-length view must fail
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/streams/readable-byte-streams/general.dedicatedworker-expected.txt (218925 => 218926)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/streams/readable-byte-streams/general.dedicatedworker-expected.txt 2017-06-29 16:10:10 UTC (rev 218925)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/streams/readable-byte-streams/general.dedicatedworker-expected.txt 2017-06-29 16:19:38 UTC (rev 218926)
@@ -32,12 +32,12 @@
PASS ReadableStream with byte source: read(view), then respond()
PASS ReadableStream with byte source: read(view), then respond() with a transferred ArrayBuffer
PASS ReadableStream with byte source: read(view), then respond() with too big value
-FAIL ReadableStream with byte source: respond(3) to read(view) with 2 element Uint16Array enqueues the 1 byte remainder assert_equals: expected 1 but got 2
-FAIL ReadableStream with byte source: enqueue(), getReader(), then read(view) assert_unreached: pull() should not be called Reached unreachable code
+FAIL ReadableStream with byte source: respond(3) to read(view) with 2 element Uint16Array enqueues the 1 byte remainder assert_equals: expected 3 but got 0
+FAIL ReadableStream with byte source: enqueue(), getReader(), then read(view) assert_equals: expected 1 but got 0
PASS ReadableStream with byte source: enqueue(), getReader(), then cancel() (mode = not BYOB)
PASS ReadableStream with byte source: enqueue(), getReader(), then cancel() (mode = BYOB)
PASS ReadableStream with byte source: getReader(), read(view), then cancel()
-FAIL ReadableStream with byte source: cancel() with partially filled pending pull() request assert_equals: 1 pull() should have been made in response to partial fill by enqueue() expected 1 but got 0
+PASS ReadableStream with byte source: cancel() with partially filled pending pull() request
FAIL ReadableStream with byte source: enqueue(), getReader(), then read(view) where view.buffer is not fully covered by view assert_equals: expected 1 but got 0
FAIL ReadableStream with byte source: Multiple enqueue(), getReader(), then read(view) assert_equals: Contents are set from the first chunk expected 123 but got 0
FAIL ReadableStream with byte source: enqueue(), getReader(), then read(view) with a bigger view assert_equals: expected 1 but got 0
@@ -52,7 +52,7 @@
PASS ReadableStream with byte source: read(view) with Uint32Array, then fill it by multiple respond() calls
PASS ReadableStream with byte source: read() twice, then enqueue() twice
PASS ReadableStream with byte source: Multiple read(view), close() and respond()
-FAIL ReadableStream with byte source: Multiple read(view), big enqueue() assert_unreached: pull() should not be called Reached unreachable code
+PASS ReadableStream with byte source: Multiple read(view), big enqueue()
PASS ReadableStream with byte source: Multiple read(view) and multiple enqueue()
PASS ReadableStream with byte source: read(view) with passing undefined as view must fail
PASS ReadableStream with byte source: read(view) with zero-length view must fail
Modified: trunk/LayoutTests/streams/readable-byte-stream-controller-expected.txt (218925 => 218926)
--- trunk/LayoutTests/streams/readable-byte-stream-controller-expected.txt 2017-06-29 16:10:10 UTC (rev 218925)
+++ trunk/LayoutTests/streams/readable-byte-stream-controller-expected.txt 2017-06-29 16:19:38 UTC (rev 218926)
@@ -19,10 +19,11 @@
PASS Enqueuing a chunk, getting a reader and calling read should result in a promise resolved with said chunk
PASS Getting a reader, calling read and enqueuing a chunk should result in the read promise being resolved with said chunk
PASS Getting a reader, enqueuing a chunk and finally calling read should result in a promise resolved with said chunk
-PASS By default initial value of desiredSize should be 1
+PASS By default initial value of desiredSize should be 0
PASS Calling cancel() on a readable ReadableStream that is not locked to a reader should return a promise whose fulfillment handler returns undefined
-PASS Test that pull is called once when a new ReadableStream is created with a ReadableByteStreamController
-PASS Calling cancel after pull has thrown an error should result in a promise rejected with the same error
+PASS Test that pull is not called when a new ReadableStream is created with default strategy parameters and a ReadableByteStreamController
+PASS Test that pull is called once when a new ReadableStream is created with a highWaterMark of 1 and a ReadableByteStreamController
+PASS For a ReadableStream created with a highWaterMark of 1 and a ReadableByteStreamController, calling cancel after pull has thrown an error should result in a promise rejected with the same error
PASS Calling cancel after creating a ReadableStream with an underlyingByteStream's start function returning a rejected promise should result in a promise rejected with the same error
PASS Creating a ReadableStream with an underlyingSource with type property set to 'bytes' should succeed
PASS ReadableByteStreamController instances should have the correct list of properties
@@ -44,9 +45,10 @@
PASS Enqueuing a chunk, getting a reader and calling read should result in a promise resolved with said chunk
PASS Getting a reader, calling read and enqueuing a chunk should result in the read promise being resolved with said chunk
PASS Getting a reader, enqueuing a chunk and finally calling read should result in a promise resolved with said chunk
-PASS By default initial value of desiredSize should be 1
+PASS By default initial value of desiredSize should be 0
PASS Calling cancel() on a readable ReadableStream that is not locked to a reader should return a promise whose fulfillment handler returns undefined
-PASS Test that pull is called once when a new ReadableStream is created with a ReadableByteStreamController
-PASS Calling cancel after pull has thrown an error should result in a promise rejected with the same error
+PASS Test that pull is not called when a new ReadableStream is created with default strategy parameters and a ReadableByteStreamController
+PASS Test that pull is called once when a new ReadableStream is created with a highWaterMark of 1 and a ReadableByteStreamController
+PASS For a ReadableStream created with a highWaterMark of 1 and a ReadableByteStreamController, calling cancel after pull has thrown an error should result in a promise rejected with the same error
PASS Calling cancel after creating a ReadableStream with an underlyingByteStream's start function returning a rejected promise should result in a promise rejected with the same error
Modified: trunk/LayoutTests/streams/readable-byte-stream-controller.js (218925 => 218926)
--- trunk/LayoutTests/streams/readable-byte-stream-controller.js 2017-06-29 16:10:10 UTC (rev 218925)
+++ trunk/LayoutTests/streams/readable-byte-stream-controller.js 2017-06-29 16:19:38 UTC (rev 218926)
@@ -369,8 +369,8 @@
type: "bytes"
});
- assert_equals(controller.desiredSize, 1, "by default initial value of desiredSize should be 1");
-}, "By default initial value of desiredSize should be 1");
+ assert_equals(controller.desiredSize, 0, "by default initial value of desiredSize should be 0");
+}, "By default initial value of desiredSize should be 0");
promise_test(function() {
const rs = new ReadableStream({
@@ -394,6 +394,26 @@
});
return new Promise(function(resolve, reject) {
setTimeout(function() {
+ if (pullCalls === 0)
+ resolve("ok");
+ else
+ reject("No call should have been made to pull function");
+ }, 200);
+ });
+}, "Test that pull is not called when a new ReadableStream is created with default strategy parameters and a ReadableByteStreamController");
+
+promise_test(function() {
+ let pullCalls = 0;
+ const rs = new ReadableStream({
+ pull: function () {
+ pullCalls++;
+ },
+ type: "bytes"
+ }, {
+ highWaterMark: 1
+ });
+ return new Promise(function(resolve, reject) {
+ setTimeout(function() {
if (pullCalls === 1)
resolve("ok");
else
@@ -400,7 +420,7 @@
reject("1 call should have been made to pull function");
}, 200);
});
-}, "Test that pull is called once when a new ReadableStream is created with a ReadableByteStreamController");
+}, "Test that pull is called once when a new ReadableStream is created with a highWaterMark of 1 and a ReadableByteStreamController");
promise_test(function() {
const myError = new Error("Pull failed");
@@ -409,6 +429,8 @@
throw myError;
},
type: "bytes"
+ }, {
+ highWaterMark: 1
});
return new Promise(function(resolve, reject) {
@@ -423,7 +445,7 @@
}
)
}, 200)});
-}, "Calling cancel after pull has thrown an error should result in a promise rejected with the same error");
+}, "For a ReadableStream created with a highWaterMark of 1 and a ReadableByteStreamController, calling cancel after pull has thrown an error should result in a promise rejected with the same error");
promise_test(function() {
const myError = new Error("Start failed");
Modified: trunk/Source/WebCore/ChangeLog (218925 => 218926)
--- trunk/Source/WebCore/ChangeLog 2017-06-29 16:10:10 UTC (rev 218925)
+++ trunk/Source/WebCore/ChangeLog 2017-06-29 16:19:38 UTC (rev 218926)
@@ -1,3 +1,20 @@
+2017-06-29 Romain Bellessort <[email protected]>
+
+ [Readable Streams API] Fix ReadableStream "strategy" argument handling
+ https://bugs.webkit.org/show_bug.cgi?id=172716
+
+ Reviewed by Xabier Rodriguez-Calvar.
+
+ Aligned default strategy parameter with spec, as defined in [1].
+
+ [1] https://streams.spec.whatwg.org/#rs-constructor
+
+ Added new tests and updated some existing ones based on the newly
+ expected behavior. Also updated expectations for WPT streams tests.
+
+ * Modules/streams/ReadableStream.js:
+ (initializeReadableStream): Fixed initialization of strategy.
+
2017-06-29 Antti Koivisto <[email protected]>
REGRESSION(r215347): NAS4Free Pop-down menus fail to appear
Modified: trunk/Source/WebCore/Modules/streams/ReadableStream.js (218925 => 218926)
--- trunk/Source/WebCore/Modules/streams/ReadableStream.js 2017-06-29 16:10:10 UTC (rev 218925)
+++ trunk/Source/WebCore/Modules/streams/ReadableStream.js 2017-06-29 16:19:38 UTC (rev 218926)
@@ -33,7 +33,7 @@
if (underlyingSource === @undefined)
underlyingSource = { };
if (strategy === @undefined)
- strategy = { highWaterMark: 1, size: function() { return 1; } };
+ strategy = { };
if (!@isObject(underlyingSource))
@throwTypeError("ReadableStream constructor takes an object as first argument");