Diff
Modified: trunk/LayoutTests/ChangeLog (270032 => 270033)
--- trunk/LayoutTests/ChangeLog 2020-11-19 16:34:39 UTC (rev 270032)
+++ trunk/LayoutTests/ChangeLog 2020-11-19 17:23:47 UTC (rev 270033)
@@ -1,3 +1,16 @@
+2020-11-19 Chris Dumez <cdu...@apple.com>
+
+ Worklet.addModule() should reject promise with an AbortError when the network load fails
+ https://bugs.webkit.org/show_bug.cgi?id=219135
+
+ Reviewed by Geoffrey Garen.
+
+ Update existing tests to reflect behavior change.
+
+ * http/wpt/webaudio/audioworklet-addModule-cors.sub.https.html:
+ * webaudio/audioworklet-addModule-failure-expected.txt:
+ * webaudio/audioworklet-addModule-failure.html:
+
2020-11-19 Commit Queue <commit-qu...@webkit.org>
Unreviewed, reverting r270009.
Modified: trunk/LayoutTests/http/wpt/webaudio/audioworklet-addModule-cors.sub.https.html (270032 => 270033)
--- trunk/LayoutTests/http/wpt/webaudio/audioworklet-addModule-cors.sub.https.html 2020-11-19 16:34:39 UTC (rev 270032)
+++ trunk/LayoutTests/http/wpt/webaudio/audioworklet-addModule-cors.sub.https.html 2020-11-19 17:23:47 UTC (rev 270033)
@@ -16,7 +16,7 @@
promise_test((t) => {
const context = new OfflineAudioContext(2, 100, 44100);
- return promise_rejects_dom(t, "NetworkError", context.audioWorklet.addModule("https://{{hosts[alt][]}}:{{ports[https][0]}}/WebKit/webaudio/resources/dummy-worklet.py"));
+ return promise_rejects_dom(t, "AbortError", context.audioWorklet.addModule("https://{{hosts[alt][]}}:{{ports[https][0]}}/WebKit/webaudio/resources/dummy-worklet.py"));
}, "cross origin fails without CORS headers");
promise_test((t) => {
Modified: trunk/LayoutTests/imported/w3c/ChangeLog (270032 => 270033)
--- trunk/LayoutTests/imported/w3c/ChangeLog 2020-11-19 16:34:39 UTC (rev 270032)
+++ trunk/LayoutTests/imported/w3c/ChangeLog 2020-11-19 17:23:47 UTC (rev 270033)
@@ -1,5 +1,18 @@
2020-11-19 Chris Dumez <cdu...@apple.com>
+ Worklet.addModule() should reject promise with an AbortError when the network load fails
+ https://bugs.webkit.org/show_bug.cgi?id=219135
+
+ Reviewed by Geoffrey Garen.
+
+ Rebaseline WPT tests now that more checks are passing (or keep failing with slighly different
+ output).
+
+ * web-platform-tests/worklets/audio-worklet-credentials.https-expected.txt:
+ * web-platform-tests/worklets/audio-worklet-import.https-expected.txt:
+
+2020-11-19 Chris Dumez <cdu...@apple.com>
+
Resync web-platform-tests/beacon tests from upstream
https://bugs.webkit.org/show_bug.cgi?id=219123
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/worklets/audio-worklet-credentials.https-expected.txt (270032 => 270033)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/worklets/audio-worklet-credentials.https-expected.txt 2020-11-19 16:34:39 UTC (rev 270032)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/worklets/audio-worklet-credentials.https-expected.txt 2020-11-19 17:23:47 UTC (rev 270033)
@@ -1,11 +1,11 @@
CONSOLE MESSAGE: Origin https://localhost:9443 is not allowed by Access-Control-Allow-Origin.
-FAIL Importing a same-origin script with the default WorkletOptions should send the credentials promise_test: Unhandled rejection with value: object "NetworkError: Failed to fetch module, error: Response is not 2xx"
+FAIL Importing a same-origin script with the default WorkletOptions should send the credentials promise_test: Unhandled rejection with value: object "AbortError: Failed to fetch module, error: Response is not 2xx"
PASS Importing a remote-origin script with the default WorkletOptions should not send the credentials
-FAIL Importing a same-origin script with credentials=omit should not send the credentials promise_test: Unhandled rejection with value: object "NetworkError: Failed to fetch module, error: Response is not 2xx"
+FAIL Importing a same-origin script with credentials=omit should not send the credentials promise_test: Unhandled rejection with value: object "AbortError: Failed to fetch module, error: Response is not 2xx"
PASS Importing a remote-origin script with credentials=omit should not send the credentials
-FAIL Importing a same-origin script with credentials=same-origin should send the credentials promise_test: Unhandled rejection with value: object "NetworkError: Failed to fetch module, error: Response is not 2xx"
+FAIL Importing a same-origin script with credentials=same-origin should send the credentials promise_test: Unhandled rejection with value: object "AbortError: Failed to fetch module, error: Response is not 2xx"
PASS Importing a remote-origin script with credentials=same-origin should not send the credentials
-FAIL Importing a same-origin script with credentials=include should send the credentials promise_test: Unhandled rejection with value: object "NetworkError: Failed to fetch module, error: Response is not 2xx"
-FAIL Importing a remote-origin script with credentials=include should send the credentials promise_test: Unhandled rejection with value: object "NetworkError: Failed to fetch module, error: Origin https://localhost:9443 is not allowed by Access-Control-Allow-Origin."
+FAIL Importing a same-origin script with credentials=include should send the credentials promise_test: Unhandled rejection with value: object "AbortError: Failed to fetch module, error: Response is not 2xx"
+FAIL Importing a remote-origin script with credentials=include should send the credentials promise_test: Unhandled rejection with value: object "AbortError: Failed to fetch module, error: Origin https://localhost:9443 is not allowed by Access-Control-Allow-Origin."
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/worklets/audio-worklet-import.https-expected.txt (270032 => 270033)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/worklets/audio-worklet-import.https-expected.txt 2020-11-19 16:34:39 UTC (rev 270032)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/worklets/audio-worklet-import.https-expected.txt 2020-11-19 17:23:47 UTC (rev 270033)
@@ -6,16 +6,16 @@
PASS Importing nested scripts resolves the given promise
PASS Importing cyclic scripts resolves the given promise
PASS Importing a script which throws should still resolve the given promise.
-FAIL Importing a non-existent script rejects the given promise with an AbortError. promise_rejects_dom: function "function () { throw e }" threw object "NetworkError: Failed to fetch module, error: Response is not 2xx" that is not a DOMException AbortError: property "code" is equal to 19, expected 20
+PASS Importing a non-existent script rejects the given promise with an AbortError.
PASS Importing an invalid URL should reject the given promise with a SyntaxError.
PASS Importing a blob URL should resolve the given promise.
-FAIL Importing a file:// URL should reject the given promise. promise_rejects_dom: function "function () { throw e }" threw object "NetworkError: Failed to fetch module, error: Cross origin requests are only supported for HTTP." that is not a DOMException AbortError: property "code" is equal to 19, expected 20
-FAIL Importing a data URL should resolve the given promise. promise_test: Unhandled rejection with value: object "NetworkError: Failed to fetch module, error: Cross origin requests are only supported for HTTP."
-FAIL Importing about:blank should reject the given promise. promise_rejects_dom: function "function () { throw e }" threw object "NetworkError: Failed to fetch module, error: Cross origin requests are only supported for HTTP." that is not a DOMException AbortError: property "code" is equal to 19, expected 20
+PASS Importing a file:// URL should reject the given promise.
+FAIL Importing a data URL should resolve the given promise. promise_test: Unhandled rejection with value: object "AbortError: Failed to fetch module, error: Cross origin requests are only supported for HTTP."
+PASS Importing about:blank should reject the given promise.
PASS Importing a cross origin resource with the Access-Control-Allow-Origin header should resolve the given promise
-FAIL Importing a cross origin resource without the Access-Control-Allow-Origin header should reject the given promise promise_rejects_dom: function "function () { throw e }" threw object "NetworkError: Failed to fetch module, error: Origin https://localhost:9443 is not allowed by Access-Control-Allow-Origin." that is not a DOMException AbortError: property "code" is equal to 19, expected 20
+PASS Importing a cross origin resource without the Access-Control-Allow-Origin header should reject the given promise
PASS Importing a cross-origin-redirected resource with the Access-Control-Allow-Origin header should resolve the given promise
-FAIL Importing a cross-origin-redirected resource without the Access-Control-Allow-Origin header should reject the given promise promise_rejects_dom: function "function () { throw e }" threw object "NetworkError: Failed to fetch module, error: Origin https://localhost:9443 is not allowed by Access-Control-Allow-Origin." that is not a DOMException AbortError: property "code" is equal to 19, expected 20
+PASS Importing a cross-origin-redirected resource without the Access-Control-Allow-Origin header should reject the given promise
FAIL Importing a script that has a syntax error should reject the given promise. assert_unreached: Should have rejected: undefined Reached unreachable code
FAIL Importing a nested script that has a syntax error should reject the given promise. assert_unreached: Should have rejected: undefined Reached unreachable code
FAIL Importing a script that imports an invalid identifier should reject the given promise. assert_unreached: Should have rejected: undefined Reached unreachable code
Modified: trunk/LayoutTests/webaudio/audioworklet-addModule-failure-expected.txt (270032 => 270033)
--- trunk/LayoutTests/webaudio/audioworklet-addModule-failure-expected.txt 2020-11-19 16:34:39 UTC (rev 270032)
+++ trunk/LayoutTests/webaudio/audioworklet-addModule-failure-expected.txt 2020-11-19 17:23:47 UTC (rev 270033)
@@ -4,7 +4,7 @@
PASS context.audioWorklet.addModule(invalidURL); rejected promise with SyntaxError: Module URL is invalid.
-PASS context.audioWorklet.addModule('doesnotExist.js'); rejected promise with NetworkError: Failed to fetch module, error: The requested URL was not found on this server..
+PASS context.audioWorklet.addModule('doesnotExist.js'); rejected promise with AbortError: Failed to fetch module, error: The requested URL was not found on this server..
PASS successfullyParsed is true
TEST COMPLETE
Modified: trunk/LayoutTests/webaudio/audioworklet-addModule-failure.html (270032 => 270033)
--- trunk/LayoutTests/webaudio/audioworklet-addModule-failure.html 2020-11-19 16:34:39 UTC (rev 270032)
+++ trunk/LayoutTests/webaudio/audioworklet-addModule-failure.html 2020-11-19 17:23:47 UTC (rev 270033)
@@ -11,7 +11,7 @@
async function test() {
context = new OfflineAudioContext(2, 100, 44100);
await shouldRejectWithErrorName("context.audioWorklet.addModule(invalidURL);", "SyntaxError");
- await shouldRejectWithErrorName("context.audioWorklet.addModule('doesnotExist.js');", "NetworkError");
+ await shouldRejectWithErrorName("context.audioWorklet.addModule('doesnotExist.js');", "AbortError");
finishJSTest();
}
Modified: trunk/Source/WebCore/ChangeLog (270032 => 270033)
--- trunk/Source/WebCore/ChangeLog 2020-11-19 16:34:39 UTC (rev 270032)
+++ trunk/Source/WebCore/ChangeLog 2020-11-19 17:23:47 UTC (rev 270033)
@@ -1,3 +1,20 @@
+2020-11-19 Chris Dumez <cdu...@apple.com>
+
+ Worklet.addModule() should reject promise with an AbortError when the network load fails
+ https://bugs.webkit.org/show_bug.cgi?id=219135
+
+ Reviewed by Geoffrey Garen.
+
+ Worklet.addModule() should reject promise with an AbortError when the network load fails:
+ - https://html.spec.whatwg.org/multipage/worklets.html#dom-worklet-addmodule
+
+ This also aligns our behavior with Blink.
+
+ No new tests, rebaselined existing tests.
+
+ * worklets/WorkletGlobalScope.cpp:
+ (WebCore::WorkletGlobalScope::notifyFinished):
+
2020-11-19 Antti Koivisto <an...@apple.com>
[LFC][Integration] Use inline iterator in CompositeEditCommand::deleteInsignificantText
Modified: trunk/Source/WebCore/worklets/WorkletGlobalScope.cpp (270032 => 270033)
--- trunk/Source/WebCore/worklets/WorkletGlobalScope.cpp 2020-11-19 16:34:39 UTC (rev 270032)
+++ trunk/Source/WebCore/worklets/WorkletGlobalScope.cpp 2020-11-19 17:23:47 UTC (rev 270033)
@@ -198,7 +198,7 @@
auto completedJob = m_scriptFetchJobs.takeFirst();
if (m_scriptLoader->failed()) {
- didCompleteScriptFetchJob(WTFMove(completedJob), Exception { NetworkError, makeString("Failed to fetch module, error: ", m_scriptLoader->error().localizedDescription()) });
+ didCompleteScriptFetchJob(WTFMove(completedJob), Exception { AbortError, makeString("Failed to fetch module, error: ", m_scriptLoader->error().localizedDescription()) });
return;
}