Changeset 270033 in webkit


Ignore:
Timestamp:
Nov 19, 2020 9:23:47 AM (3 years ago)
Author:
Chris Dumez
Message:

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.

LayoutTests/imported/w3c:

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:

Source/WebCore:

Worklet.addModule() should reject promise with an AbortError when the network load fails:

This also aligns our behavior with Blink.

No new tests, rebaselined existing tests.

  • worklets/WorkletGlobalScope.cpp:

(WebCore::WorkletGlobalScope::notifyFinished):

LayoutTests:

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:
Location:
trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r270031 r270033  
     12020-11-19  Chris Dumez  <cdumez@apple.com>
     2
     3        Worklet.addModule() should reject promise with an AbortError when the network load fails
     4        https://bugs.webkit.org/show_bug.cgi?id=219135
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        Update existing tests to reflect behavior change.
     9
     10        * http/wpt/webaudio/audioworklet-addModule-cors.sub.https.html:
     11        * webaudio/audioworklet-addModule-failure-expected.txt:
     12        * webaudio/audioworklet-addModule-failure.html:
     13
    1142020-11-19  Commit Queue  <commit-queue@webkit.org>
    215
  • trunk/LayoutTests/http/wpt/webaudio/audioworklet-addModule-cors.sub.https.html

    r268872 r270033  
    1717promise_test((t) => {
    1818    const context = new OfflineAudioContext(2, 100, 44100);
    19     return promise_rejects_dom(t, "NetworkError", context.audioWorklet.addModule("https://{{hosts[alt][]}}:{{ports[https][0]}}/WebKit/webaudio/resources/dummy-worklet.py"));
     19    return promise_rejects_dom(t, "AbortError", context.audioWorklet.addModule("https://{{hosts[alt][]}}:{{ports[https][0]}}/WebKit/webaudio/resources/dummy-worklet.py"));
    2020}, "cross origin fails without CORS headers");
    2121
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r270032 r270033  
     12020-11-19  Chris Dumez  <cdumez@apple.com>
     2
     3        Worklet.addModule() should reject promise with an AbortError when the network load fails
     4        https://bugs.webkit.org/show_bug.cgi?id=219135
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        Rebaseline WPT tests now that more checks are passing (or keep failing with slighly different
     9        output).
     10
     11        * web-platform-tests/worklets/audio-worklet-credentials.https-expected.txt:
     12        * web-platform-tests/worklets/audio-worklet-import.https-expected.txt:
     13
    1142020-11-19  Chris Dumez  <cdumez@apple.com>
    215
  • trunk/LayoutTests/imported/w3c/web-platform-tests/worklets/audio-worklet-credentials.https-expected.txt

    r270016 r270033  
    11CONSOLE MESSAGE: Origin https://localhost:9443 is not allowed by Access-Control-Allow-Origin.
    22
    3 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"
     3FAIL 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"
    44PASS Importing a remote-origin script with the default WorkletOptions should not send the credentials
    5 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"
     5FAIL 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"
    66PASS Importing a remote-origin script with credentials=omit should not send the credentials
    7 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"
     7FAIL 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"
    88PASS Importing a remote-origin script with credentials=same-origin should not send the credentials
    9 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"
    10 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."
     9FAIL 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"
     10FAIL 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."
    1111
  • trunk/LayoutTests/imported/w3c/web-platform-tests/worklets/audio-worklet-import.https-expected.txt

    r270016 r270033  
    77PASS Importing cyclic scripts resolves the given promise
    88PASS Importing a script which throws should still resolve the given promise.
    9 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
     9PASS Importing a non-existent script rejects the given promise with an AbortError.
    1010PASS Importing an invalid URL should reject the given promise with a SyntaxError.
    1111PASS Importing a blob URL should resolve the given promise.
    12 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
    13 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."
    14 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
     12PASS Importing a file:// URL should reject the given promise.
     13FAIL 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."
     14PASS Importing about:blank should reject the given promise.
    1515PASS Importing a cross origin resource with the Access-Control-Allow-Origin header should resolve the given promise
    16 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
     16PASS Importing a cross origin resource without the Access-Control-Allow-Origin header should reject the given promise
    1717PASS Importing a cross-origin-redirected resource with the Access-Control-Allow-Origin header should resolve the given promise
    18 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
     18PASS Importing a cross-origin-redirected resource without the Access-Control-Allow-Origin header should reject the given promise
    1919FAIL Importing a script that has a syntax error should reject the given promise. assert_unreached: Should have rejected: undefined Reached unreachable code
    2020FAIL Importing a nested script that has a syntax error should reject the given promise. assert_unreached: Should have rejected: undefined Reached unreachable code
  • trunk/LayoutTests/webaudio/audioworklet-addModule-failure-expected.txt

    r268057 r270033  
    55
    66PASS context.audioWorklet.addModule(invalidURL); rejected promise  with SyntaxError: Module URL is invalid.
    7 PASS context.audioWorklet.addModule('doesnotExist.js'); rejected promise  with NetworkError: Failed to fetch module, error: The requested URL was not found on this server..
     7PASS context.audioWorklet.addModule('doesnotExist.js'); rejected promise  with AbortError: Failed to fetch module, error: The requested URL was not found on this server..
    88PASS successfullyParsed is true
    99
  • trunk/LayoutTests/webaudio/audioworklet-addModule-failure.html

    r268057 r270033  
    1212    context = new OfflineAudioContext(2, 100, 44100);
    1313    await shouldRejectWithErrorName("context.audioWorklet.addModule(invalidURL);", "SyntaxError");
    14     await shouldRejectWithErrorName("context.audioWorklet.addModule('doesnotExist.js');", "NetworkError");
     14    await shouldRejectWithErrorName("context.audioWorklet.addModule('doesnotExist.js');", "AbortError");
    1515    finishJSTest();
    1616}
  • trunk/Source/WebCore/ChangeLog

    r270029 r270033  
     12020-11-19  Chris Dumez  <cdumez@apple.com>
     2
     3        Worklet.addModule() should reject promise with an AbortError when the network load fails
     4        https://bugs.webkit.org/show_bug.cgi?id=219135
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        Worklet.addModule() should reject promise with an AbortError when the network load fails:
     9        - https://html.spec.whatwg.org/multipage/worklets.html#dom-worklet-addmodule
     10
     11        This also aligns our behavior with Blink.
     12
     13        No new tests, rebaselined existing tests.
     14
     15        * worklets/WorkletGlobalScope.cpp:
     16        (WebCore::WorkletGlobalScope::notifyFinished):
     17
    1182020-11-19  Antti Koivisto  <antti@apple.com>
    219
  • trunk/Source/WebCore/worklets/WorkletGlobalScope.cpp

    r269974 r270033  
    199199
    200200    if (m_scriptLoader->failed()) {
    201         didCompleteScriptFetchJob(WTFMove(completedJob), Exception { NetworkError, makeString("Failed to fetch module, error: ", m_scriptLoader->error().localizedDescription()) });
     201        didCompleteScriptFetchJob(WTFMove(completedJob), Exception { AbortError, makeString("Failed to fetch module, error: ", m_scriptLoader->error().localizedDescription()) });
    202202        return;
    203203    }
Note: See TracChangeset for help on using the changeset viewer.