Diff
Modified: trunk/LayoutTests/imported/w3c/ChangeLog (265675 => 265676)
--- trunk/LayoutTests/imported/w3c/ChangeLog 2020-08-14 17:22:40 UTC (rev 265675)
+++ trunk/LayoutTests/imported/w3c/ChangeLog 2020-08-14 17:26:11 UTC (rev 265676)
@@ -1,3 +1,21 @@
+2020-08-14 Youenn Fablet <[email protected]>
+
+ WritableStreamDefaultWriterEnsureReadyPromiseRejected should create a new readPromise if the current readyPromise is not pending
+ https://bugs.webkit.org/show_bug.cgi?id=215500
+
+ Reviewed by Geoffrey Garen.
+
+ * web-platform-tests/streams/writable-streams/aborting.any-expected.txt:
+ * web-platform-tests/streams/writable-streams/aborting.any.worker-expected.txt:
+ * web-platform-tests/streams/writable-streams/bad-underlying-sinks.any-expected.txt:
+ * web-platform-tests/streams/writable-streams/bad-underlying-sinks.any.worker-expected.txt:
+ * web-platform-tests/streams/writable-streams/close.any-expected.txt:
+ * web-platform-tests/streams/writable-streams/close.any.worker-expected.txt:
+ * web-platform-tests/streams/writable-streams/general.any-expected.txt:
+ * web-platform-tests/streams/writable-streams/general.any.worker-expected.txt:
+ * web-platform-tests/streams/writable-streams/reentrant-strategy.any-expected.txt:
+ * web-platform-tests/streams/writable-streams/reentrant-strategy.any.worker-expected.txt:
+
2020-08-13 Sergio Villar Senin <[email protected]>
[WebXR] Implement WebXRSession::updateRenderState()
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/streams/writable-streams/aborting.any-expected.txt (265675 => 265676)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/streams/writable-streams/aborting.any-expected.txt 2020-08-14 17:22:40 UTC (rev 265675)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/streams/writable-streams/aborting.any-expected.txt 2020-08-14 17:26:11 UTC (rev 265676)
@@ -1,8 +1,8 @@
-Harness Error (FAIL), message = Unhandled rejection
+Harness Error (FAIL), message = Unhandled rejection: writableStreamDefaultWriterRelease
PASS Aborting a WritableStream before it starts should cause the writer's unsettled ready promise to reject
-FAIL Aborting a WritableStream should cause the writer's fulfilled ready promise to reset to a rejected one assert_not_equals: the ready promise property should change got disallowed value object "[object Promise]"
+PASS Aborting a WritableStream should cause the writer's fulfilled ready promise to reset to a rejected one
PASS abort() on a released writer rejects
PASS Aborting a WritableStream immediately prevents future writes
PASS Aborting a WritableStream prevents further writes after any that are in progress
@@ -12,7 +12,7 @@
PASS WritableStream if sink's abort throws, the promise returned by ws.abort() rejects
PASS WritableStream if sink's abort throws, for an abort performed during a write, the promise returned by ws.abort() rejects
PASS Aborting a WritableStream passes through the given reason
-FAIL Aborting a WritableStream puts it in an errored state with the error passed to abort() assert_unreached: Should have rejected: ready should reject with error1 Reached unreachable code
+PASS Aborting a WritableStream puts it in an errored state with the error passed to abort()
PASS Aborting a WritableStream causes any outstanding write() promises to be rejected with the reason supplied
PASS Closing but then immediately aborting a WritableStream causes the stream to error
PASS Closing a WritableStream and aborting it while it closes causes the stream to ignore the abort attempt
@@ -31,23 +31,23 @@
PASS if a writer is created for a stream with a pending abort, its ready should be rejected with the abort error
PASS writer close() promise should resolve before abort() promise
PASS writer.ready should reject on controller error without waiting for underlying write
-FAIL writer.abort() while there is an in-flight write, and then finish the write with rejection promise_rejects_js: writer.ready must be rejected with an error indicating release function "function () { throw e }" threw object "error1: error1" ("error1") expected instance of function "function TypeError() {
+FAIL writer.abort() while there is an in-flight write, and then finish the write with rejection promise_rejects_js: writer.closed must be rejected with an error indicating release function "function () { throw e }" threw object "error1: error1" ("error1") expected instance of function "function TypeError() {
[native code]
}" ("TypeError")
-FAIL writer.abort(), controller.error() while there is an in-flight write, and then finish the write promise_rejects_js: writer.ready must be rejected with an error indicating release function "function () { throw e }" threw object "error1: error1" ("error1") expected instance of function "function TypeError() {
+FAIL writer.abort(), controller.error() while there is an in-flight write, and then finish the write promise_rejects_js: writer.closed must be rejected with an error indicating release function "function () { throw e }" threw object "error1: error1" ("error1") expected instance of function "function TypeError() {
[native code]
}" ("TypeError")
-FAIL writer.abort(), controller.error() while there is an in-flight close, and then finish the close assert_unreached: Should have rejected: writer.ready must reject with the error from abort Reached unreachable code
-FAIL controller.error(), writer.abort() while there is an in-flight write, and then finish the write promise_rejects_js: writer.ready must be rejected with an error indicating release function "function () { throw e }" threw object "error2: error2" ("error2") expected instance of function "function TypeError() {
+FAIL writer.abort(), controller.error() while there is an in-flight close, and then finish the close assert_unreached: Should have rejected: writer.closed must be rejected with an error indicating release Reached unreachable code
+FAIL controller.error(), writer.abort() while there is an in-flight write, and then finish the write promise_rejects_js: writer.closed must be rejected with an error indicating release function "function () { throw e }" threw object "error2: error2" ("error2") expected instance of function "function TypeError() {
[native code]
}" ("TypeError")
-FAIL controller.error(), writer.abort() while there is an in-flight close, and then finish the close assert_unreached: Should have rejected: writer.ready must reject with the error passed to the controller's error method Reached unreachable code
+FAIL controller.error(), writer.abort() while there is an in-flight close, and then finish the close assert_unreached: Should have rejected: writer.closed must be rejected with an error indicating release Reached unreachable code
PASS releaseLock() while aborting should reject the original closed promise
PASS releaseLock() during delayed async abort() should reject the writer.closed promise
PASS sink abort() should not be called until sink start() is done
PASS if start attempts to error the controller after abort() has been called, then it should lose
PASS stream abort() promise should still resolve if sink start() rejects
-FAIL writer abort() during sink start() should replace the writer.ready promise synchronously assert_not_equals: abort() should replace the ready promise with a rejected one got disallowed value object "[object Promise]"
+PASS writer abort() during sink start() should replace the writer.ready promise synchronously
PASS promises returned from other writer methods should be rejected when writer abort() happens during sink start()
PASS abort() should succeed despite rejection from write
PASS abort() should be rejected with the rejection returned from close()
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/streams/writable-streams/aborting.any.worker-expected.txt (265675 => 265676)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/streams/writable-streams/aborting.any.worker-expected.txt 2020-08-14 17:22:40 UTC (rev 265675)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/streams/writable-streams/aborting.any.worker-expected.txt 2020-08-14 17:26:11 UTC (rev 265676)
@@ -1,8 +1,8 @@
-Harness Error (FAIL), message = Unhandled rejection
+Harness Error (FAIL), message = Unhandled rejection: writableStreamDefaultWriterRelease
PASS Aborting a WritableStream before it starts should cause the writer's unsettled ready promise to reject
-FAIL Aborting a WritableStream should cause the writer's fulfilled ready promise to reset to a rejected one assert_not_equals: the ready promise property should change got disallowed value object "[object Promise]"
+PASS Aborting a WritableStream should cause the writer's fulfilled ready promise to reset to a rejected one
PASS abort() on a released writer rejects
PASS Aborting a WritableStream immediately prevents future writes
PASS Aborting a WritableStream prevents further writes after any that are in progress
@@ -12,7 +12,7 @@
PASS WritableStream if sink's abort throws, the promise returned by ws.abort() rejects
PASS WritableStream if sink's abort throws, for an abort performed during a write, the promise returned by ws.abort() rejects
PASS Aborting a WritableStream passes through the given reason
-FAIL Aborting a WritableStream puts it in an errored state with the error passed to abort() assert_unreached: Should have rejected: ready should reject with error1 Reached unreachable code
+PASS Aborting a WritableStream puts it in an errored state with the error passed to abort()
PASS Aborting a WritableStream causes any outstanding write() promises to be rejected with the reason supplied
PASS Closing but then immediately aborting a WritableStream causes the stream to error
PASS Closing a WritableStream and aborting it while it closes causes the stream to ignore the abort attempt
@@ -31,23 +31,23 @@
PASS if a writer is created for a stream with a pending abort, its ready should be rejected with the abort error
PASS writer close() promise should resolve before abort() promise
PASS writer.ready should reject on controller error without waiting for underlying write
-FAIL writer.abort() while there is an in-flight write, and then finish the write with rejection promise_rejects_js: writer.ready must be rejected with an error indicating release function "function () { throw e }" threw object "error1: error1" ("error1") expected instance of function "function TypeError() {
+FAIL writer.abort() while there is an in-flight write, and then finish the write with rejection promise_rejects_js: writer.closed must be rejected with an error indicating release function "function () { throw e }" threw object "error1: error1" ("error1") expected instance of function "function TypeError() {
[native code]
}" ("TypeError")
-FAIL writer.abort(), controller.error() while there is an in-flight write, and then finish the write promise_rejects_js: writer.ready must be rejected with an error indicating release function "function () { throw e }" threw object "error1: error1" ("error1") expected instance of function "function TypeError() {
+FAIL writer.abort(), controller.error() while there is an in-flight write, and then finish the write promise_rejects_js: writer.closed must be rejected with an error indicating release function "function () { throw e }" threw object "error1: error1" ("error1") expected instance of function "function TypeError() {
[native code]
}" ("TypeError")
-FAIL writer.abort(), controller.error() while there is an in-flight close, and then finish the close assert_unreached: Should have rejected: writer.ready must reject with the error from abort Reached unreachable code
-FAIL controller.error(), writer.abort() while there is an in-flight write, and then finish the write promise_rejects_js: writer.ready must be rejected with an error indicating release function "function () { throw e }" threw object "error2: error2" ("error2") expected instance of function "function TypeError() {
+FAIL writer.abort(), controller.error() while there is an in-flight close, and then finish the close assert_unreached: Should have rejected: writer.closed must be rejected with an error indicating release Reached unreachable code
+FAIL controller.error(), writer.abort() while there is an in-flight write, and then finish the write promise_rejects_js: writer.closed must be rejected with an error indicating release function "function () { throw e }" threw object "error2: error2" ("error2") expected instance of function "function TypeError() {
[native code]
}" ("TypeError")
-FAIL controller.error(), writer.abort() while there is an in-flight close, and then finish the close assert_unreached: Should have rejected: writer.ready must reject with the error passed to the controller's error method Reached unreachable code
+FAIL controller.error(), writer.abort() while there is an in-flight close, and then finish the close assert_unreached: Should have rejected: writer.closed must be rejected with an error indicating release Reached unreachable code
PASS releaseLock() while aborting should reject the original closed promise
PASS releaseLock() during delayed async abort() should reject the writer.closed promise
PASS sink abort() should not be called until sink start() is done
PASS if start attempts to error the controller after abort() has been called, then it should lose
PASS stream abort() promise should still resolve if sink start() rejects
-FAIL writer abort() during sink start() should replace the writer.ready promise synchronously assert_not_equals: abort() should replace the ready promise with a rejected one got disallowed value object "[object Promise]"
+PASS writer abort() during sink start() should replace the writer.ready promise synchronously
PASS promises returned from other writer methods should be rejected when writer abort() happens during sink start()
PASS abort() should succeed despite rejection from write
PASS abort() should be rejected with the rejection returned from close()
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/streams/writable-streams/bad-underlying-sinks.any-expected.txt (265675 => 265676)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/streams/writable-streams/bad-underlying-sinks.any-expected.txt 2020-08-14 17:22:40 UTC (rev 265675)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/streams/writable-streams/bad-underlying-sinks.any-expected.txt 2020-08-14 17:26:11 UTC (rev 265676)
@@ -2,8 +2,8 @@
Harness Error (FAIL), message = Unhandled rejection: error1
PASS start: errors in start cause WritableStream constructor to throw
-FAIL close: throwing method should cause writer close() and ready to reject assert_unreached: Should have rejected: ready promise must reject with the thrown error Reached unreachable code
-FAIL close: returning a rejected promise should cause writer close() and ready to reject assert_unreached: Should have rejected: ready promise must reject with the same error Reached unreachable code
+PASS close: throwing method should cause writer close() and ready to reject
+PASS close: returning a rejected promise should cause writer close() and ready to reject
PASS close: throwing getter should cause constructor to throw
PASS write: throwing getter should cause write() and closed to reject
PASS write: throwing method should cause write() and closed to reject
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/streams/writable-streams/bad-underlying-sinks.any.worker-expected.txt (265675 => 265676)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/streams/writable-streams/bad-underlying-sinks.any.worker-expected.txt 2020-08-14 17:22:40 UTC (rev 265675)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/streams/writable-streams/bad-underlying-sinks.any.worker-expected.txt 2020-08-14 17:26:11 UTC (rev 265676)
@@ -2,8 +2,8 @@
Harness Error (FAIL), message = Unhandled rejection: error1
PASS start: errors in start cause WritableStream constructor to throw
-FAIL close: throwing method should cause writer close() and ready to reject assert_unreached: Should have rejected: ready promise must reject with the thrown error Reached unreachable code
-FAIL close: returning a rejected promise should cause writer close() and ready to reject assert_unreached: Should have rejected: ready promise must reject with the same error Reached unreachable code
+PASS close: throwing method should cause writer close() and ready to reject
+PASS close: returning a rejected promise should cause writer close() and ready to reject
PASS close: throwing getter should cause constructor to throw
PASS write: throwing getter should cause write() and closed to reject
PASS write: throwing method should cause write() and closed to reject
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/streams/writable-streams/close.any-expected.txt (265675 => 265676)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/streams/writable-streams/close.any-expected.txt 2020-08-14 17:22:40 UTC (rev 265675)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/streams/writable-streams/close.any-expected.txt 2020-08-14 17:26:11 UTC (rev 265676)
@@ -1,5 +1,5 @@
-Harness Error (FAIL), message = Unhandled rejection: error1
+Harness Error (FAIL), message = Unhandled rejection: writableStreamDefaultWriterRelease
PASS fulfillment value of writer.close() call must be undefined even if the underlying sink returns a non-undefined value
PASS when sink calls error asynchronously while sink close is in-flight, the stream should not become errored
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/streams/writable-streams/close.any.worker-expected.txt (265675 => 265676)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/streams/writable-streams/close.any.worker-expected.txt 2020-08-14 17:22:40 UTC (rev 265675)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/streams/writable-streams/close.any.worker-expected.txt 2020-08-14 17:26:11 UTC (rev 265676)
@@ -1,5 +1,5 @@
-Harness Error (FAIL), message = Unhandled rejection: error1
+Harness Error (FAIL), message = Unhandled rejection: writableStreamDefaultWriterRelease
PASS fulfillment value of writer.close() call must be undefined even if the underlying sink returns a non-undefined value
PASS when sink calls error asynchronously while sink close is in-flight, the stream should not become errored
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/streams/writable-streams/general.any-expected.txt (265675 => 265676)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/streams/writable-streams/general.any-expected.txt 2020-08-14 17:22:40 UTC (rev 265675)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/streams/writable-streams/general.any-expected.txt 2020-08-14 17:26:11 UTC (rev 265676)
@@ -7,7 +7,7 @@
PASS ws.getWriter() on a closed WritableStream
PASS ws.getWriter() on an aborted WritableStream
PASS ws.getWriter() on an errored WritableStream
-FAIL closed and ready on a released writer assert_unreached: writer.ready fulfilled unexpectedly with: undefined Reached unreachable code
+PASS closed and ready on a released writer
PASS WritableStream should call underlying sink methods as methods
PASS methods should not not have .apply() or .call() called
PASS WritableStream's strategy.size should not be called as a method
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/streams/writable-streams/general.any.worker-expected.txt (265675 => 265676)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/streams/writable-streams/general.any.worker-expected.txt 2020-08-14 17:22:40 UTC (rev 265675)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/streams/writable-streams/general.any.worker-expected.txt 2020-08-14 17:26:11 UTC (rev 265676)
@@ -7,7 +7,7 @@
PASS ws.getWriter() on a closed WritableStream
PASS ws.getWriter() on an aborted WritableStream
PASS ws.getWriter() on an errored WritableStream
-FAIL closed and ready on a released writer assert_unreached: writer.ready fulfilled unexpectedly with: undefined Reached unreachable code
+PASS closed and ready on a released writer
PASS WritableStream should call underlying sink methods as methods
PASS methods should not not have .apply() or .call() called
PASS WritableStream's strategy.size should not be called as a method
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/streams/writable-streams/reentrant-strategy.any-expected.txt (265675 => 265676)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/streams/writable-streams/reentrant-strategy.any-expected.txt 2020-08-14 17:22:40 UTC (rev 265675)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/streams/writable-streams/reentrant-strategy.any-expected.txt 2020-08-14 17:26:11 UTC (rev 265676)
@@ -1,9 +1,9 @@
PASS writes should be written in the standard order
PASS writer.write() promises should resolve in the standard order
-FAIL controller.error() should work when called from within strategy.size() assert_unreached: Should have rejected: ready should reject with error1 Reached unreachable code
+PASS controller.error() should work when called from within strategy.size()
PASS close() should work when called from within strategy.size()
PASS abort() should work when called from within strategy.size()
-FAIL releaseLock() should abort the write() when called within strategy.size() assert_unreached: Should have rejected: ready promise should reject Reached unreachable code
-FAIL original reader should error when new reader is created within strategy.size() assert_unreached: Should have rejected: ready promise should reject Reached unreachable code
+PASS releaseLock() should abort the write() when called within strategy.size()
+PASS original reader should error when new reader is created within strategy.size()
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/streams/writable-streams/reentrant-strategy.any.worker-expected.txt (265675 => 265676)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/streams/writable-streams/reentrant-strategy.any.worker-expected.txt 2020-08-14 17:22:40 UTC (rev 265675)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/streams/writable-streams/reentrant-strategy.any.worker-expected.txt 2020-08-14 17:26:11 UTC (rev 265676)
@@ -1,9 +1,9 @@
PASS writes should be written in the standard order
PASS writer.write() promises should resolve in the standard order
-FAIL controller.error() should work when called from within strategy.size() assert_unreached: Should have rejected: ready should reject with error1 Reached unreachable code
+PASS controller.error() should work when called from within strategy.size()
PASS close() should work when called from within strategy.size()
PASS abort() should work when called from within strategy.size()
-FAIL releaseLock() should abort the write() when called within strategy.size() assert_unreached: Should have rejected: ready promise should reject Reached unreachable code
-FAIL original reader should error when new reader is created within strategy.size() assert_unreached: Should have rejected: ready promise should reject Reached unreachable code
+PASS releaseLock() should abort the write() when called within strategy.size()
+PASS original reader should error when new reader is created within strategy.size()
Modified: trunk/Source/WebCore/ChangeLog (265675 => 265676)
--- trunk/Source/WebCore/ChangeLog 2020-08-14 17:22:40 UTC (rev 265675)
+++ trunk/Source/WebCore/ChangeLog 2020-08-14 17:26:11 UTC (rev 265676)
@@ -1,3 +1,17 @@
+2020-08-14 Youenn Fablet <[email protected]>
+
+ WritableStreamDefaultWriterEnsureReadyPromiseRejected should create a new readPromise if the current readyPromise is not pending
+ https://bugs.webkit.org/show_bug.cgi?id=215500
+
+ Reviewed by Geoffrey Garen.
+
+ Create new promise if current is not pending.
+ Also mark it as handled so that it does not end up call onunhandledrejection.
+ Covered by rebased tests.
+
+ * Modules/streams/WritableStreamInternals.js:
+ (writableStreamDefaultWriterEnsureClosedPromiseRejected):
+
2020-08-13 Sergio Villar Senin <[email protected]>
[WebXR] Implement WebXRSession::updateRenderState()
Modified: trunk/Source/WebCore/Modules/streams/WritableStreamInternals.js (265675 => 265676)
--- trunk/Source/WebCore/Modules/streams/WritableStreamInternals.js 2020-08-14 17:22:40 UTC (rev 265675)
+++ trunk/Source/WebCore/Modules/streams/WritableStreamInternals.js 2020-08-14 17:26:11 UTC (rev 265676)
@@ -380,7 +380,17 @@
function writableStreamDefaultWriterEnsureReadyPromiseRejected(writer, error)
{
- @getByIdDirectPrivate(writer, "readyPromise").@reject.@call(@undefined, error);
+ let readyPromiseCapability = @getByIdDirectPrivate(writer, "readyPromise");
+ let readyPromise = readyPromiseCapability.@promise;
+
+ if ((@getPromiseInternalField(readyPromise, @promiseFieldFlags) & @promiseStateMask) !== @promiseStatePending) {
+ readyPromiseCapability = @newPromiseCapability(@Promise);
+ readyPromise = readyPromiseCapability.@promise;
+ @putByIdDirectPrivate(writer, "readyPromise", readyPromiseCapability);
+ }
+
+ readyPromiseCapability.@reject.@call(@undefined, error);
+ @putPromiseInternalField(readyPromise, @promiseFieldFlags, @getPromiseInternalField(readyPromise, @promiseFieldFlags) | @promiseFlagsIsHandled);
}
function writableStreamDefaultWriterGetDesiredSize(writer)