Changeset 269227 in webkit


Ignore:
Timestamp:
Oct 31, 2020 9:11:57 AM (3 years ago)
Author:
Chris Dumez
Message:

Promises returned by our DOM API have the caller's global instead of the callee's
https://bugs.webkit.org/show_bug.cgi?id=218363

Reviewed by Darin Adler and Ryosuke Niwa.

LayoutTests/imported/w3c:

  • web-platform-tests/fetch/range/sw.https.window.js:

Re-import latest version of the test from upstream. Without those upstream changes, there would be a testharness error
when running this test.

  • web-platform-tests/html/cross-origin-embedder-policy/coep-on-response-from-service-worker.https-expected.txt:
  • web-platform-tests/service-workers/service-worker/controller-with-no-fetch-event-handler.https-expected.txt:
  • web-platform-tests/service-workers/service-worker/fetch-event-redirect.https-expected.txt:
  • web-platform-tests/service-workers/service-worker/fetch-request-resources.https-expected.txt:
  • web-platform-tests/service-workers/service-worker/fetch-response-taint.https-expected.txt:
  • web-platform-tests/service-workers/service-worker/redirected-response.https-expected.txt:
  • web-platform-tests/webaudio/the-audio-api/the-audiocontext-interface/promise-methods-after-discard-expected.txt:
  • web-platform-tests/webaudio/the-audio-api/the-offlineaudiocontext-interface/startrendering-after-discard-expected.txt:

Rebaseline WPT tests that are now passing.

Source/WebCore:

Promises returned by our DOM APIs were using the caller's global instead of the
callee's global. This behavior was inconsistent with Chrome and Firefox, and was
causing failures in web-platform-tests. Because the global of the promise was
wrong, the global of the values passed when settling the promise (e.g. the global
of the exception used to reject a promise) was also wrong. This patch fixes this.

After fixing the global of DOM promises, some tests started failing because they
expect the promises coming from subframes to still get settled *after* their
iframe has been removed from the document. Such promises get settled properly
in Firefox and Chrome. They also used to settle properly in WebKit because we
were incorrectly using the caller's global. The issue was that after an iframe
gets detached, Document::stopActiveDOMObjects() would get called, which would
stop the EventLoopTaskGroup associated with the document and clear all pending
tasks from this group in the event loop. To address this, when a
Document::stopActiveDOMObjects(), we now mark the Document's EventLoopTaskGroup
as "ready to stop" instead of stopping it. Only once ALL groups in the EventLoop
are ready to stop, do we actually stop all those groups. This is important
because each document has its own group but all documents of similar origins
share the same EventLoop.

Tests: fast/js-promise-from-detached-iframe.html

http/tests/eventloop/promise-from-cross-origin-detached-iframe.html
webaudio/promise-global-object.html

  • bindings/js/JSDOMPromiseDeferred.h:

(WebCore::DeferredPromise::shouldIgnoreRequestToFulfill const):
(WebCore::callPromiseFunction):

  • dom/Document.cpp:

(WebCore::Document::stopActiveDOMObjects):
(WebCore::Document::eventLoop):

  • dom/EventLoop.cpp:

(WebCore::EventLoop::registerGroup):
(WebCore::EventLoop::unregisterGroup):
(WebCore::EventLoop::stopAssociatedGroupsIfNecessary):

  • dom/EventLoop.h:

(WebCore::EventLoopTaskGroup::EventLoopTaskGroup):
(WebCore::EventLoopTaskGroup::~EventLoopTaskGroup):
(WebCore::EventLoopTaskGroup::isReadyToStop const):
(WebCore::EventLoopTaskGroup::markAsReadyToStop):
(WebCore::EventLoopTaskGroup::stopAndDiscardAllTasks):

  • workers/WorkerOrWorkletGlobalScope.cpp:

(WebCore::WorkerOrWorkletGlobalScope::prepareForDestruction):

LayoutTests:

  • fast/js-promise-from-detached-iframe-expected.txt: Added.
  • fast/js-promise-from-detached-iframe.html: Added.

Add layout test to verify that JS promises from iframes properly get settled after the
the iframe gets removed from the doucment. I have verified that this test passes in
both Firefox and Chrome.

  • http/tests/eventloop/promise-from-cross-origin-detached-iframe-expected.txt: Added.
  • http/tests/eventloop/promise-from-cross-origin-detached-iframe.html: Added.
  • http/tests/eventloop/resources/promise-from-cross-origin-detached-iframe-subframe.html: Added.

Similar test as above but in a cross-origin iframe. Ryosuke recommended adding this test
since event loops only shared between documents of similar origins. I have verified that this
test passes in both Firefox and Chrome.

  • platform/mac/editing/input/reveal-caret-of-multiline-input-expected.txt:

Rebaseline existing test that has slightly different output.

  • requestidlecallback/requestidlecallback-document-gc-expected.txt:
  • requestidlecallback/requestidlecallback-document-gc.html:

Tweak test to check that enough documents are gc's at regular intervals, instead of expecting
them to be collected in a 0-timer.

  • webaudio/promise-global-object-expected.txt: Added.
  • webaudio/promise-global-object.html: Added.

Add test to verify that the global object of the promise is correct when the promise comes
from calling a DOM API in an subframe. Previously, we would incorrectly use the caller's
global instead of the callee's global. I have verified that this test passes in both Firefox
and Chrome.

Location:
trunk
Files:
7 added
21 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r269226 r269227  
     12020-10-31  Chris Dumez  <cdumez@apple.com>
     2
     3        Promises returned by our DOM API have the caller's global instead of the callee's
     4        https://bugs.webkit.org/show_bug.cgi?id=218363
     5
     6        Reviewed by Darin Adler and Ryosuke Niwa.
     7
     8        * fast/js-promise-from-detached-iframe-expected.txt: Added.
     9        * fast/js-promise-from-detached-iframe.html: Added.
     10        Add layout test to verify that JS promises from iframes properly get settled after the
     11        the iframe gets removed from the doucment. I have verified that this test passes in
     12        both Firefox and Chrome.
     13
     14        * http/tests/eventloop/promise-from-cross-origin-detached-iframe-expected.txt: Added.
     15        * http/tests/eventloop/promise-from-cross-origin-detached-iframe.html: Added.
     16        * http/tests/eventloop/resources/promise-from-cross-origin-detached-iframe-subframe.html: Added.
     17        Similar test as above but in a cross-origin iframe. Ryosuke recommended adding this test
     18        since event loops only shared between documents of similar origins. I have verified that this
     19        test passes in both Firefox and Chrome.
     20
     21        * platform/mac/editing/input/reveal-caret-of-multiline-input-expected.txt:
     22        Rebaseline existing test that has slightly different output.
     23
     24        * requestidlecallback/requestidlecallback-document-gc-expected.txt:
     25        * requestidlecallback/requestidlecallback-document-gc.html:
     26        Tweak test to check that enough documents are gc's at regular intervals, instead of expecting
     27        them to be collected in a 0-timer.
     28
     29        * webaudio/promise-global-object-expected.txt: Added.
     30        * webaudio/promise-global-object.html: Added.
     31        Add test to verify that the global object of the promise is correct when the promise comes
     32        from calling a DOM API in an subframe. Previously, we would incorrectly use the caller's
     33        global instead of the callee's global. I have verified that this test passes in both Firefox
     34        and Chrome.
     35
    1362020-10-31  Sam Weinig  <weinig@apple.com>
    237
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r269214 r269227  
     12020-10-31  Chris Dumez  <cdumez@apple.com>
     2
     3        Promises returned by our DOM API have the caller's global instead of the callee's
     4        https://bugs.webkit.org/show_bug.cgi?id=218363
     5
     6        Reviewed by Darin Adler and Ryosuke Niwa.
     7
     8        * web-platform-tests/fetch/range/sw.https.window.js:
     9        Re-import latest version of the test from upstream. Without those upstream changes, there would be a testharness error
     10        when running this test.
     11
     12        * web-platform-tests/html/cross-origin-embedder-policy/coep-on-response-from-service-worker.https-expected.txt:
     13        * web-platform-tests/service-workers/service-worker/controller-with-no-fetch-event-handler.https-expected.txt:
     14        * web-platform-tests/service-workers/service-worker/fetch-event-redirect.https-expected.txt:
     15        * web-platform-tests/service-workers/service-worker/fetch-request-resources.https-expected.txt:
     16        * web-platform-tests/service-workers/service-worker/fetch-response-taint.https-expected.txt:
     17        * web-platform-tests/service-workers/service-worker/redirected-response.https-expected.txt:
     18        * web-platform-tests/webaudio/the-audio-api/the-audiocontext-interface/promise-methods-after-discard-expected.txt:
     19        * web-platform-tests/webaudio/the-audio-api/the-offlineaudiocontext-interface/startrendering-after-discard-expected.txt:
     20        Rebaseline WPT tests that are now passing.
     21
    1222020-10-30  Chris Dumez  <cdumez@apple.com>
    223
  • trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/range/sw.https.window.js

    r264144 r269227  
    8787  // Fetching should reject
    8888  const fetchPromise = w.fetch('?action=use-stored-ranged-response', { mode: 'no-cors' });
    89   promise_rejects_js(t, TypeError, fetchPromise);
     89  await promise_rejects_js(t, w.TypeError, fetchPromise);
    9090
    9191  // Script loading should error too
    9292  const loadScriptPromise = loadScript('?action=use-stored-ranged-response', { doc: w.document });
    93   promise_rejects_js(t, Error, loadScriptPromise);
     93  await promise_rejects_js(t, Error, loadScriptPromise);
    9494
    9595  await loadScriptPromise.catch(() => {});
  • trunk/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/coep-on-response-from-service-worker.https-expected.txt

    r267646 r269227  
    1010PASS making a same-origin request for no CORP
    1111PASS making a same-origin request for CORP: cross-origin
    12 FAIL making a cross-origin request for CORP: same-origin promise_rejects_js: function "function () { throw e }" threw object "TypeError: FetchEvent.respondWith received an error: TypeError: Cancelled load to https://127.0.0.1:9443/html/cross-origin-embedder-policy/resources/nothing-same-origin-corp.txt because it violates the resource's Cross-Origin-Resource-Policy response header." ("TypeError") expected instance of function "function TypeError() {
    13     [native code]
    14 }" ("TypeError")
     12PASS making a cross-origin request for CORP: same-origin
    1513FAIL making a cross-origin request for no CORP assert_unreached: Should have rejected: undefined Reached unreachable code
    1614PASS making a cross-origin request for CORP: cross-origin
    17 FAIL making a cross-origin request for CORP: same-origin [PASS THROUGH] promise_rejects_js: function "function () { throw e }" threw object "TypeError: Cancelled load to https://127.0.0.1:9443/html/cross-origin-embedder-policy/resources/nothing-same-origin-corp.txt?passthrough because it violates the resource's Cross-Origin-Resource-Policy response header." ("TypeError") expected instance of function "function TypeError() {
    18     [native code]
    19 }" ("TypeError")
     15PASS making a cross-origin request for CORP: same-origin [PASS THROUGH]
    2016FAIL making a cross-origin request for no CORP [PASS THROUGH] assert_unreached: Should have rejected: undefined Reached unreachable code
    2117PASS making a cross-origin request for CORP: cross-origin [PASS THROUGH]
    22 FAIL making a cross-origin request with CORS without ACAO promise_rejects_js: function "function () { throw e }" threw object "TypeError: FetchEvent.respondWith received an error: TypeError: Origin https://localhost:9443 is not allowed by Access-Control-Allow-Origin." ("TypeError") expected instance of function "function TypeError() {
    23     [native code]
    24 }" ("TypeError")
     18PASS making a cross-origin request with CORS without ACAO
    2519PASS making a cross-origin request with CORS
    2620PASS teardown
  • trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/controller-with-no-fetch-event-handler.https-expected.txt

    r267647 r269227  
    22PASS global setup
    33PASS cross-origin request, no-cors mode
    4 FAIL cross-origin request, cors denied promise_rejects_js: function "function () { throw e }" threw object "TypeError: Origin https://localhost:9443 is not allowed by Access-Control-Allow-Origin." ("TypeError") expected instance of function "function TypeError() {
    5     [native code]
    6 }" ("TypeError")
     4PASS cross-origin request, cors denied
    75PASS cross-origin request, cors approved
    86PASS cleanup global state
  • trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-redirect.https-expected.txt

    r267647 r269227  
    2020PASS Non-navigation, manual redirect, no-cors mode Request redirected to cors with credentials should succeed opaqueredirect interception and response should not be redirected
    2121PASS Non-navigation, follow redirect, cors mode Request redirected to same-origin without credentials should succeed interception and response should be redirected
    22 FAIL Non-navigation, follow redirect, cors mode Request redirected to no-cors without credentials should fail interception and response should not be redirected promise_rejects_js: Must fail to fetch: url=/nonav-follow-cors-redirects-to-nocors-nocreds?url=redirect.py%3FRedirect%3Dhttps%253A%252F%252F127.0.0.1%253A9443%252Fservice-workers%252Fservice-worker%252Fresources%252Fsuccess.py function "function () { throw e }" threw object "TypeError: FetchEvent.respondWith received an error: TypeError: Origin https://localhost:9443 is not allowed by Access-Control-Allow-Origin." ("TypeError") expected instance of function "function TypeError() {
    23     [native code]
    24 }" ("TypeError")
     22PASS Non-navigation, follow redirect, cors mode Request redirected to no-cors without credentials should fail interception and response should not be redirected
    2523PASS Non-navigation, follow redirect, cors mode Request redirected to cors without credentials should succeed interception and response should be redirected
    2624PASS Non-navigation, follow redirect, same-origin mode Request redirected to same-origin without credentials should succeed interception and response should be redirected
    27 FAIL Non-navigation, follow redirect, same-origin mode Request redirected to no-cors without credentials should fail interception and response should not be redirected promise_rejects_js: Must fail to fetch: url=/nonav-follow-sameorigin-redirects-to-nocors-nocreds?url=redirect.py%3FRedirect%3Dhttps%253A%252F%252F127.0.0.1%253A9443%252Fservice-workers%252Fservice-worker%252Fresources%252Fsuccess.py function "function () { throw e }" threw object "TypeError: FetchEvent.respondWith received an error: TypeError: Unsafe attempt to load URL https://127.0.0.1:9443/service-workers/service-worker/resources/success.py from origin https://localhost:9443. Domains, protocols and ports must match.
    28 " ("TypeError") expected instance of function "function TypeError() {
    29     [native code]
    30 }" ("TypeError")
    31 FAIL Non-navigation, follow redirect, same-origin mode Request redirected to cors without credentials should fail interception and response should not be redirected promise_rejects_js: Must fail to fetch: url=/nonav-follow-sameorigin-redirects-to-cors-nocreds?url=redirect.py%3FRedirect%3Dhttps%253A%252F%252F127.0.0.1%253A9443%252Fservice-workers%252Fservice-worker%252Fresources%252Fsuccess.py%253FACAOrigin%253Dhttps%25253A%25252F%25252Flocalhost%25253A9443 function "function () { throw e }" threw object "TypeError: FetchEvent.respondWith received an error: TypeError: Unsafe attempt to load URL https://127.0.0.1:9443/service-workers/service-worker/resources/success.py?ACAOrigin=https%3A%2F%2Flocalhost%3A9443 from origin https://localhost:9443. Domains, protocols and ports must match.
    32 " ("TypeError") expected instance of function "function TypeError() {
    33     [native code]
    34 }" ("TypeError")
     25PASS Non-navigation, follow redirect, same-origin mode Request redirected to no-cors without credentials should fail interception and response should not be redirected
     26PASS Non-navigation, follow redirect, same-origin mode Request redirected to cors without credentials should fail interception and response should not be redirected
    3527PASS Non-navigation, follow redirect, no-cors mode Request redirected to same-origin without credentials should succeed interception and response should be redirected
    3628PASS Non-navigation, follow redirect, no-cors mode Request redirected to no-cors without credentials should succeed interception and response should not be redirected
    3729PASS Non-navigation, follow redirect, no-cors mode Request redirected to cors without credentials should succeed interception and response should not be redirected
    3830PASS Non-navigation, follow redirect, cors mode Request redirected to same-origin with credentials should succeed interception and response should be redirected
    39 FAIL Non-navigation, follow redirect, cors mode Request redirected to no-cors with credentials should fail interception and response should not be redirected promise_rejects_js: Must fail to fetch: url=/nonav-follow-cors-redirects-to-nocors-creds?url=redirect.py%3FRedirect%3Dhttps%253A%252F%252Ffoo%253Abar%2540127.0.0.1%253A9443%252Fservice-workers%252Fservice-worker%252Fresources%252Fsuccess.py function "function () { throw e }" threw object "TypeError: FetchEvent.respondWith received an error: TypeError: Cross-origin redirection to https://127.0.0.1:9443/service-workers/service-worker/resources/success.py denied by Cross-Origin Resource Sharing policy: redirection URL https://foo:bar@127.0.0.1:9443/service-workers/service-worker/resources/success.py has credentials" ("TypeError") expected instance of function "function TypeError() {
    40     [native code]
    41 }" ("TypeError")
    42 FAIL Non-navigation, follow redirect, cors mode Request redirected to cors with credentials should fail interception and response should be redirected promise_rejects_js: Must fail to fetch: url=/nonav-follow-cors-redirects-to-cors-creds?url=redirect.py%3FRedirect%3Dhttps%253A%252F%252Ffoo%253Abar%2540127.0.0.1%253A9443%252Fservice-workers%252Fservice-worker%252Fresources%252Fsuccess.py%253FACAOrigin%253Dhttps%25253A%25252F%25252Flocalhost%25253A9443 function "function () { throw e }" threw object "TypeError: FetchEvent.respondWith received an error: TypeError: Cross-origin redirection to https://127.0.0.1:9443/service-workers/service-worker/resources/success.py?ACAOrigin=https%3A%2F%2Flocalhost%3A9443 denied by Cross-Origin Resource Sharing policy: redirection URL https://foo:bar@127.0.0.1:9443/service-workers/service-worker/resources/success.py?ACAOrigin=https%3A%2F%2Flocalhost%3A9443 has credentials" ("TypeError") expected instance of function "function TypeError() {
    43     [native code]
    44 }" ("TypeError")
     31PASS Non-navigation, follow redirect, cors mode Request redirected to no-cors with credentials should fail interception and response should not be redirected
     32PASS Non-navigation, follow redirect, cors mode Request redirected to cors with credentials should fail interception and response should be redirected
    4533PASS Non-navigation, follow redirect, same-origin mode Request redirected to same-origin with credentials should succeed interception and response should be redirected
    46 FAIL Non-navigation, follow redirect, same-origin mode Request redirected to no-cors with credentials should fail interception and response should not be redirected promise_rejects_js: Must fail to fetch: url=/nonav-follow-sameorigin-redirects-to-nocors-creds?url=redirect.py%3FRedirect%3Dhttps%253A%252F%252Ffoo%253Abar%2540127.0.0.1%253A9443%252Fservice-workers%252Fservice-worker%252Fresources%252Fsuccess.py function "function () { throw e }" threw object "TypeError: FetchEvent.respondWith received an error: TypeError: Unsafe attempt to load URL https://127.0.0.1:9443/service-workers/service-worker/resources/success.py from origin https://localhost:9443. Domains, protocols and ports must match.
    47 " ("TypeError") expected instance of function "function TypeError() {
    48     [native code]
    49 }" ("TypeError")
    50 FAIL Non-navigation, follow redirect, same-origin mode Request redirected to cors with credentials should fail interception and response should not be redirected promise_rejects_js: Must fail to fetch: url=/nonav-follow-sameorigin-redirects-to-cors-creds?url=redirect.py%3FRedirect%3Dhttps%253A%252F%252Ffoo%253Abar%2540127.0.0.1%253A9443%252Fservice-workers%252Fservice-worker%252Fresources%252Fsuccess.py%253FACAOrigin%253Dhttps%25253A%25252F%25252Flocalhost%25253A9443 function "function () { throw e }" threw object "TypeError: FetchEvent.respondWith received an error: TypeError: Unsafe attempt to load URL https://127.0.0.1:9443/service-workers/service-worker/resources/success.py?ACAOrigin=https%3A%2F%2Flocalhost%3A9443 from origin https://localhost:9443. Domains, protocols and ports must match.
    51 " ("TypeError") expected instance of function "function TypeError() {
    52     [native code]
    53 }" ("TypeError")
     34PASS Non-navigation, follow redirect, same-origin mode Request redirected to no-cors with credentials should fail interception and response should not be redirected
     35PASS Non-navigation, follow redirect, same-origin mode Request redirected to cors with credentials should fail interception and response should not be redirected
    5436PASS Non-navigation, follow redirect, no-cors mode Request redirected to same-origin with credentials should succeed interception and response should be redirected
    5537PASS Non-navigation, follow redirect, no-cors mode Request redirected to no-cors with credentials should succeed interception and response should not be redirected
    5638PASS Non-navigation, follow redirect, no-cors mode Request redirected to cors with credentials should succeed interception and response should not be redirected
    57 FAIL Non-navigation, error redirect, cors mode Request redirected to same-origin without credentials should fail interception and response should not be redirected promise_rejects_js: Must fail to fetch: url=/nonav-error-cors-redirects-to-sameorigin-nocreds?url=redirect.py%3FRedirect%3Dhttps%253A%252F%252Flocalhost%253A9443%252Fservice-workers%252Fservice-worker%252Fresources%252Fsuccess.py function "function () { throw e }" threw object "TypeError: FetchEvent.respondWith received an error: TypeError: Not allowed to follow a redirection while loading https://localhost:9443/service-workers/service-worker/resources/redirect.py?Redirect=https%3A%2F%2Flocalhost%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Fsuccess.py" ("TypeError") expected instance of function "function TypeError() {
    58     [native code]
    59 }" ("TypeError")
    60 FAIL Non-navigation, error redirect, cors mode Request redirected to no-cors without credentials should fail interception and response should not be redirected promise_rejects_js: Must fail to fetch: url=/nonav-error-cors-redirects-to-nocors-nocreds?url=redirect.py%3FRedirect%3Dhttps%253A%252F%252F127.0.0.1%253A9443%252Fservice-workers%252Fservice-worker%252Fresources%252Fsuccess.py function "function () { throw e }" threw object "TypeError: FetchEvent.respondWith received an error: TypeError: Not allowed to follow a redirection while loading https://localhost:9443/service-workers/service-worker/resources/redirect.py?Redirect=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Fsuccess.py" ("TypeError") expected instance of function "function TypeError() {
    61     [native code]
    62 }" ("TypeError")
    63 FAIL Non-navigation, error redirect, cors mode Request redirected to cors without credentials should fail interception and response should not be redirected promise_rejects_js: Must fail to fetch: url=/nonav-error-cors-redirects-to-cors-nocreds?url=redirect.py%3FRedirect%3Dhttps%253A%252F%252F127.0.0.1%253A9443%252Fservice-workers%252Fservice-worker%252Fresources%252Fsuccess.py%253FACAOrigin%253Dhttps%25253A%25252F%25252Flocalhost%25253A9443 function "function () { throw e }" threw object "TypeError: FetchEvent.respondWith received an error: TypeError: Not allowed to follow a redirection while loading https://localhost:9443/service-workers/service-worker/resources/redirect.py?Redirect=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Fsuccess.py%3FACAOrigin%3Dhttps%253A%252F%252Flocalhost%253A9443" ("TypeError") expected instance of function "function TypeError() {
    64     [native code]
    65 }" ("TypeError")
    66 FAIL Non-navigation, error redirect, same-origin mode Request redirected to same-origin without credentials should fail interception and response should not be redirected promise_rejects_js: Must fail to fetch: url=/nonav-error-sameorigin-redirects-to-sameorigin-nocreds?url=redirect.py%3FRedirect%3Dhttps%253A%252F%252Flocalhost%253A9443%252Fservice-workers%252Fservice-worker%252Fresources%252Fsuccess.py function "function () { throw e }" threw object "TypeError: FetchEvent.respondWith received an error: TypeError: Not allowed to follow a redirection while loading https://localhost:9443/service-workers/service-worker/resources/redirect.py?Redirect=https%3A%2F%2Flocalhost%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Fsuccess.py" ("TypeError") expected instance of function "function TypeError() {
    67     [native code]
    68 }" ("TypeError")
    69 FAIL Non-navigation, error redirect, same-origin mode Request redirected to no-cors without credentials should fail interception and response should not be redirected promise_rejects_js: Must fail to fetch: url=/nonav-error-sameorigin-redirects-to-nocors-nocreds?url=redirect.py%3FRedirect%3Dhttps%253A%252F%252F127.0.0.1%253A9443%252Fservice-workers%252Fservice-worker%252Fresources%252Fsuccess.py function "function () { throw e }" threw object "TypeError: FetchEvent.respondWith received an error: TypeError: Not allowed to follow a redirection while loading https://localhost:9443/service-workers/service-worker/resources/redirect.py?Redirect=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Fsuccess.py" ("TypeError") expected instance of function "function TypeError() {
    70     [native code]
    71 }" ("TypeError")
    72 FAIL Non-navigation, error redirect, same-origin mode Request redirected to cors without credentials should fail interception and response should not be redirected promise_rejects_js: Must fail to fetch: url=/nonav-error-sameorigin-redirects-to-cors-nocreds?url=redirect.py%3FRedirect%3Dhttps%253A%252F%252F127.0.0.1%253A9443%252Fservice-workers%252Fservice-worker%252Fresources%252Fsuccess.py%253FACAOrigin%253Dhttps%25253A%25252F%25252Flocalhost%25253A9443 function "function () { throw e }" threw object "TypeError: FetchEvent.respondWith received an error: TypeError: Not allowed to follow a redirection while loading https://localhost:9443/service-workers/service-worker/resources/redirect.py?Redirect=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Fsuccess.py%3FACAOrigin%3Dhttps%253A%252F%252Flocalhost%253A9443" ("TypeError") expected instance of function "function TypeError() {
    73     [native code]
    74 }" ("TypeError")
    75 FAIL Non-navigation, error redirect, no-cors mode Request redirected to same-origin without credentials should fail interception and response should not be redirected promise_rejects_js: Must fail to fetch: url=/nonav-error-nocors-redirects-to-sameorigin-nocreds?url=redirect.py%3FRedirect%3Dhttps%253A%252F%252Flocalhost%253A9443%252Fservice-workers%252Fservice-worker%252Fresources%252Fsuccess.py function "function () { throw e }" threw object "TypeError: FetchEvent.respondWith received an error: TypeError: Not allowed to follow a redirection while loading https://localhost:9443/service-workers/service-worker/resources/redirect.py?Redirect=https%3A%2F%2Flocalhost%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Fsuccess.py" ("TypeError") expected instance of function "function TypeError() {
    76     [native code]
    77 }" ("TypeError")
    78 FAIL Non-navigation, error redirect, no-cors mode Request redirected to no-cors without credentials should fail interception and response should not be redirected promise_rejects_js: Must fail to fetch: url=/nonav-error-nocors-redirects-to-nocors-nocreds?url=redirect.py%3FRedirect%3Dhttps%253A%252F%252F127.0.0.1%253A9443%252Fservice-workers%252Fservice-worker%252Fresources%252Fsuccess.py function "function () { throw e }" threw object "TypeError: FetchEvent.respondWith received an error: TypeError: Not allowed to follow a redirection while loading https://localhost:9443/service-workers/service-worker/resources/redirect.py?Redirect=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Fsuccess.py" ("TypeError") expected instance of function "function TypeError() {
    79     [native code]
    80 }" ("TypeError")
    81 FAIL Non-navigation, error redirect, no-cors mode Request redirected to cors without credentials should fail interception and response should not be redirected promise_rejects_js: Must fail to fetch: url=/nonav-error-nocors-redirects-to-cors-nocreds?url=redirect.py%3FRedirect%3Dhttps%253A%252F%252F127.0.0.1%253A9443%252Fservice-workers%252Fservice-worker%252Fresources%252Fsuccess.py%253FACAOrigin%253Dhttps%25253A%25252F%25252Flocalhost%25253A9443 function "function () { throw e }" threw object "TypeError: FetchEvent.respondWith received an error: TypeError: Not allowed to follow a redirection while loading https://localhost:9443/service-workers/service-worker/resources/redirect.py?Redirect=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Fsuccess.py%3FACAOrigin%3Dhttps%253A%252F%252Flocalhost%253A9443" ("TypeError") expected instance of function "function TypeError() {
    82     [native code]
    83 }" ("TypeError")
    84 FAIL Non-navigation, error redirect, cors mode Request redirected to same-origin with credentials should fail interception and response should not be redirected promise_rejects_js: Must fail to fetch: url=/nonav-error-cors-redirects-to-sameorigin-creds?url=redirect.py%3FRedirect%3Dhttps%253A%252F%252Ffoo%253Abar%2540localhost%253A9443%252Fservice-workers%252Fservice-worker%252Fresources%252Fsuccess.py function "function () { throw e }" threw object "TypeError: FetchEvent.respondWith received an error: TypeError: Not allowed to follow a redirection while loading https://localhost:9443/service-workers/service-worker/resources/redirect.py?Redirect=https%3A%2F%2Ffoo%3Abar%40localhost%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Fsuccess.py" ("TypeError") expected instance of function "function TypeError() {
    85     [native code]
    86 }" ("TypeError")
    87 FAIL Non-navigation, error redirect, cors mode Request redirected to no-cors with credentials should fail interception and response should not be redirected promise_rejects_js: Must fail to fetch: url=/nonav-error-cors-redirects-to-nocors-creds?url=redirect.py%3FRedirect%3Dhttps%253A%252F%252Ffoo%253Abar%2540127.0.0.1%253A9443%252Fservice-workers%252Fservice-worker%252Fresources%252Fsuccess.py function "function () { throw e }" threw object "TypeError: FetchEvent.respondWith received an error: TypeError: Not allowed to follow a redirection while loading https://localhost:9443/service-workers/service-worker/resources/redirect.py?Redirect=https%3A%2F%2Ffoo%3Abar%40127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Fsuccess.py" ("TypeError") expected instance of function "function TypeError() {
    88     [native code]
    89 }" ("TypeError")
    90 FAIL Non-navigation, error redirect, cors mode Request redirected to cors with credentials should fail interception and response should not be redirected promise_rejects_js: Must fail to fetch: url=/nonav-error-cors-redirects-to-cors-creds?url=redirect.py%3FRedirect%3Dhttps%253A%252F%252Ffoo%253Abar%2540127.0.0.1%253A9443%252Fservice-workers%252Fservice-worker%252Fresources%252Fsuccess.py%253FACAOrigin%253Dhttps%25253A%25252F%25252Flocalhost%25253A9443 function "function () { throw e }" threw object "TypeError: FetchEvent.respondWith received an error: TypeError: Not allowed to follow a redirection while loading https://localhost:9443/service-workers/service-worker/resources/redirect.py?Redirect=https%3A%2F%2Ffoo%3Abar%40127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Fsuccess.py%3FACAOrigin%3Dhttps%253A%252F%252Flocalhost%253A9443" ("TypeError") expected instance of function "function TypeError() {
    91     [native code]
    92 }" ("TypeError")
    93 FAIL Non-navigation, error redirect, same-origin mode Request redirected to same-origin with credentials should fail interception and response should not be redirected promise_rejects_js: Must fail to fetch: url=/nonav-error-sameorigin-redirects-to-sameorigin-creds?url=redirect.py%3FRedirect%3Dhttps%253A%252F%252Ffoo%253Abar%2540localhost%253A9443%252Fservice-workers%252Fservice-worker%252Fresources%252Fsuccess.py function "function () { throw e }" threw object "TypeError: FetchEvent.respondWith received an error: TypeError: Not allowed to follow a redirection while loading https://localhost:9443/service-workers/service-worker/resources/redirect.py?Redirect=https%3A%2F%2Ffoo%3Abar%40localhost%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Fsuccess.py" ("TypeError") expected instance of function "function TypeError() {
    94     [native code]
    95 }" ("TypeError")
    96 FAIL Non-navigation, error redirect, same-origin mode Request redirected to no-cors with credentials should fail interception and response should not be redirected promise_rejects_js: Must fail to fetch: url=/nonav-error-sameorigin-redirects-to-nocors-creds?url=redirect.py%3FRedirect%3Dhttps%253A%252F%252Ffoo%253Abar%2540127.0.0.1%253A9443%252Fservice-workers%252Fservice-worker%252Fresources%252Fsuccess.py function "function () { throw e }" threw object "TypeError: FetchEvent.respondWith received an error: TypeError: Not allowed to follow a redirection while loading https://localhost:9443/service-workers/service-worker/resources/redirect.py?Redirect=https%3A%2F%2Ffoo%3Abar%40127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Fsuccess.py" ("TypeError") expected instance of function "function TypeError() {
    97     [native code]
    98 }" ("TypeError")
    99 FAIL Non-navigation, error redirect, same-origin mode Request redirected to cors with credentials should fail interception and response should not be redirected promise_rejects_js: Must fail to fetch: url=/nonav-error-sameorigin-redirects-to-cors-creds?url=redirect.py%3FRedirect%3Dhttps%253A%252F%252Ffoo%253Abar%2540127.0.0.1%253A9443%252Fservice-workers%252Fservice-worker%252Fresources%252Fsuccess.py%253FACAOrigin%253Dhttps%25253A%25252F%25252Flocalhost%25253A9443 function "function () { throw e }" threw object "TypeError: FetchEvent.respondWith received an error: TypeError: Not allowed to follow a redirection while loading https://localhost:9443/service-workers/service-worker/resources/redirect.py?Redirect=https%3A%2F%2Ffoo%3Abar%40127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Fsuccess.py%3FACAOrigin%3Dhttps%253A%252F%252Flocalhost%253A9443" ("TypeError") expected instance of function "function TypeError() {
    100     [native code]
    101 }" ("TypeError")
    102 FAIL Non-navigation, error redirect, no-cors mode Request redirected to same-origin with credentials should fail interception and response should not be redirected promise_rejects_js: Must fail to fetch: url=/nonav-error-nocors-redirects-to-sameorigin-creds?url=redirect.py%3FRedirect%3Dhttps%253A%252F%252Ffoo%253Abar%2540localhost%253A9443%252Fservice-workers%252Fservice-worker%252Fresources%252Fsuccess.py function "function () { throw e }" threw object "TypeError: FetchEvent.respondWith received an error: TypeError: Not allowed to follow a redirection while loading https://localhost:9443/service-workers/service-worker/resources/redirect.py?Redirect=https%3A%2F%2Ffoo%3Abar%40localhost%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Fsuccess.py" ("TypeError") expected instance of function "function TypeError() {
    103     [native code]
    104 }" ("TypeError")
    105 FAIL Non-navigation, error redirect, no-cors mode Request redirected to no-cors with credentials should fail interception and response should not be redirected promise_rejects_js: Must fail to fetch: url=/nonav-error-nocors-redirects-to-nocors-creds?url=redirect.py%3FRedirect%3Dhttps%253A%252F%252Ffoo%253Abar%2540127.0.0.1%253A9443%252Fservice-workers%252Fservice-worker%252Fresources%252Fsuccess.py function "function () { throw e }" threw object "TypeError: FetchEvent.respondWith received an error: TypeError: Not allowed to follow a redirection while loading https://localhost:9443/service-workers/service-worker/resources/redirect.py?Redirect=https%3A%2F%2Ffoo%3Abar%40127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Fsuccess.py" ("TypeError") expected instance of function "function TypeError() {
    106     [native code]
    107 }" ("TypeError")
    108 FAIL Non-navigation, error redirect, no-cors mode Request redirected to cors with credentials should fail interception and response should not be redirected promise_rejects_js: Must fail to fetch: url=/nonav-error-nocors-redirects-to-cors-creds?url=redirect.py%3FRedirect%3Dhttps%253A%252F%252Ffoo%253Abar%2540127.0.0.1%253A9443%252Fservice-workers%252Fservice-worker%252Fresources%252Fsuccess.py%253FACAOrigin%253Dhttps%25253A%25252F%25252Flocalhost%25253A9443 function "function () { throw e }" threw object "TypeError: FetchEvent.respondWith received an error: TypeError: Not allowed to follow a redirection while loading https://localhost:9443/service-workers/service-worker/resources/redirect.py?Redirect=https%3A%2F%2Ffoo%3Abar%40127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Fsuccess.py%3FACAOrigin%3Dhttps%253A%252F%252Flocalhost%253A9443" ("TypeError") expected instance of function "function TypeError() {
    109     [native code]
    110 }" ("TypeError")
     39PASS Non-navigation, error redirect, cors mode Request redirected to same-origin without credentials should fail interception and response should not be redirected
     40PASS Non-navigation, error redirect, cors mode Request redirected to no-cors without credentials should fail interception and response should not be redirected
     41PASS Non-navigation, error redirect, cors mode Request redirected to cors without credentials should fail interception and response should not be redirected
     42PASS Non-navigation, error redirect, same-origin mode Request redirected to same-origin without credentials should fail interception and response should not be redirected
     43PASS Non-navigation, error redirect, same-origin mode Request redirected to no-cors without credentials should fail interception and response should not be redirected
     44PASS Non-navigation, error redirect, same-origin mode Request redirected to cors without credentials should fail interception and response should not be redirected
     45PASS Non-navigation, error redirect, no-cors mode Request redirected to same-origin without credentials should fail interception and response should not be redirected
     46PASS Non-navigation, error redirect, no-cors mode Request redirected to no-cors without credentials should fail interception and response should not be redirected
     47PASS Non-navigation, error redirect, no-cors mode Request redirected to cors without credentials should fail interception and response should not be redirected
     48PASS Non-navigation, error redirect, cors mode Request redirected to same-origin with credentials should fail interception and response should not be redirected
     49PASS Non-navigation, error redirect, cors mode Request redirected to no-cors with credentials should fail interception and response should not be redirected
     50PASS Non-navigation, error redirect, cors mode Request redirected to cors with credentials should fail interception and response should not be redirected
     51PASS Non-navigation, error redirect, same-origin mode Request redirected to same-origin with credentials should fail interception and response should not be redirected
     52PASS Non-navigation, error redirect, same-origin mode Request redirected to no-cors with credentials should fail interception and response should not be redirected
     53PASS Non-navigation, error redirect, same-origin mode Request redirected to cors with credentials should fail interception and response should not be redirected
     54PASS Non-navigation, error redirect, no-cors mode Request redirected to same-origin with credentials should fail interception and response should not be redirected
     55PASS Non-navigation, error redirect, no-cors mode Request redirected to no-cors with credentials should fail interception and response should not be redirected
     56PASS Non-navigation, error redirect, no-cors mode Request redirected to cors with credentials should fail interception and response should not be redirected
    11157PASS restore global state
    11258
  • trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-request-resources.https-expected.txt

    r267647 r269227  
    1 
    2 Harness Error (FAIL), message = Unhandled rejection: FetchEvent.respondWith received an error: undefined
    31
    42PASS Verify FetchEvent for resources.
  • trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-response-taint.https-expected.txt

    r267647 r269227  
    1010PASS fetching url:"https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?" mode:"cors" credentials:"same-origin" should succeed.
    1111PASS fetching url:"https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?" mode:"cors" credentials:"include" should succeed.
    12 FAIL url:"https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?" mode:"same-origin" credentials:"omit" should fail. promise_rejects_js: function "function () { throw e }" threw object "TypeError: Cross origin requests are not allowed when using same-origin fetch mode." ("TypeError") expected instance of function "function TypeError() {
    13     [native code]
    14 }" ("TypeError")
    15 FAIL url:"https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?" mode:"same-origin" credentials:"same-origin" should fail. promise_rejects_js: function "function () { throw e }" threw object "TypeError: Cross origin requests are not allowed when using same-origin fetch mode." ("TypeError") expected instance of function "function TypeError() {
    16     [native code]
    17 }" ("TypeError")
    18 FAIL url:"https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?" mode:"same-origin" credentials:"include" should fail. promise_rejects_js: function "function () { throw e }" threw object "TypeError: Cross origin requests are not allowed when using same-origin fetch mode." ("TypeError") expected instance of function "function TypeError() {
    19     [native code]
    20 }" ("TypeError")
     12PASS url:"https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?" mode:"same-origin" credentials:"omit" should fail.
     13PASS url:"https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?" mode:"same-origin" credentials:"same-origin" should fail.
     14PASS url:"https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?" mode:"same-origin" credentials:"include" should fail.
    2115PASS fetching url:"https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?" mode:"no-cors" credentials:"omit" should succeed.
    2216PASS fetching url:"https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?" mode:"no-cors" credentials:"same-origin" should succeed.
    2317PASS fetching url:"https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?" mode:"no-cors" credentials:"include" should succeed.
    24 FAIL url:"https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?" mode:"cors" credentials:"omit" should fail. promise_rejects_js: function "function () { throw e }" threw object "TypeError: FetchEvent.respondWith received an error: TypeError: Origin https://localhost:9443 is not allowed by Access-Control-Allow-Origin." ("TypeError") expected instance of function "function TypeError() {
    25     [native code]
    26 }" ("TypeError")
    27 FAIL url:"https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?" mode:"cors" credentials:"same-origin" should fail. promise_rejects_js: function "function () { throw e }" threw object "TypeError: FetchEvent.respondWith received an error: TypeError: Origin https://localhost:9443 is not allowed by Access-Control-Allow-Origin." ("TypeError") expected instance of function "function TypeError() {
    28     [native code]
    29 }" ("TypeError")
    30 FAIL url:"https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?" mode:"cors" credentials:"include" should fail. promise_rejects_js: function "function () { throw e }" threw object "TypeError: FetchEvent.respondWith received an error: TypeError: Origin https://localhost:9443 is not allowed by Access-Control-Allow-Origin." ("TypeError") expected instance of function "function TypeError() {
    31     [native code]
    32 }" ("TypeError")
     18PASS url:"https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?" mode:"cors" credentials:"omit" should fail.
     19PASS url:"https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?" mode:"cors" credentials:"same-origin" should fail.
     20PASS url:"https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?" mode:"cors" credentials:"include" should fail.
    3321PASS fetching url:"https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?ACAOrigin=*" mode:"cors" credentials:"omit" should succeed.
    3422PASS fetching url:"https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?ACAOrigin=*" mode:"cors" credentials:"same-origin" should succeed.
    35 FAIL url:"https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?ACAOrigin=*" mode:"cors" credentials:"include" should fail. promise_rejects_js: function "function () { throw e }" threw object "TypeError: FetchEvent.respondWith received an error: TypeError: Cannot use wildcard in Access-Control-Allow-Origin when credentials flag is true." ("TypeError") expected instance of function "function TypeError() {
    36     [native code]
    37 }" ("TypeError")
     23PASS url:"https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?ACAOrigin=*" mode:"cors" credentials:"include" should fail.
    3824PASS fetching url:"https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?ACAOrigin=https://localhost:9443&ACACredentials=true" mode:"cors" credentials:"include" should succeed.
    3925PASS fetching url:"https://localhost:9443/?url=https%3A%2F%2Flocalhost%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=same-origin&credentials=omit&" mode:"same-origin" credentials:"omit" should succeed.
     
    4632PASS fetching url:"https://localhost:9443/?url=https%3A%2F%2Flocalhost%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=same-origin&credentials=omit&" mode:"cors" credentials:"same-origin" should succeed.
    4733PASS fetching url:"https://localhost:9443/?url=https%3A%2F%2Flocalhost%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=same-origin&credentials=omit&" mode:"cors" credentials:"include" should succeed.
    48 FAIL url:"https://127.0.0.1:9443/?url=https%3A%2F%2Flocalhost%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=same-origin&credentials=omit&" mode:"same-origin" credentials:"omit" should fail. promise_rejects_js: function "function () { throw e }" threw object "TypeError: Cross origin requests are not allowed when using same-origin fetch mode." ("TypeError") expected instance of function "function TypeError() {
    49     [native code]
    50 }" ("TypeError")
    51 FAIL url:"https://127.0.0.1:9443/?url=https%3A%2F%2Flocalhost%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=same-origin&credentials=omit&" mode:"same-origin" credentials:"same-origin" should fail. promise_rejects_js: function "function () { throw e }" threw object "TypeError: Cross origin requests are not allowed when using same-origin fetch mode." ("TypeError") expected instance of function "function TypeError() {
    52     [native code]
    53 }" ("TypeError")
    54 FAIL url:"https://127.0.0.1:9443/?url=https%3A%2F%2Flocalhost%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=same-origin&credentials=omit&" mode:"same-origin" credentials:"include" should fail. promise_rejects_js: function "function () { throw e }" threw object "TypeError: Cross origin requests are not allowed when using same-origin fetch mode." ("TypeError") expected instance of function "function TypeError() {
    55     [native code]
    56 }" ("TypeError")
     34PASS url:"https://127.0.0.1:9443/?url=https%3A%2F%2Flocalhost%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=same-origin&credentials=omit&" mode:"same-origin" credentials:"omit" should fail.
     35PASS url:"https://127.0.0.1:9443/?url=https%3A%2F%2Flocalhost%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=same-origin&credentials=omit&" mode:"same-origin" credentials:"same-origin" should fail.
     36PASS url:"https://127.0.0.1:9443/?url=https%3A%2F%2Flocalhost%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=same-origin&credentials=omit&" mode:"same-origin" credentials:"include" should fail.
    5737PASS fetching url:"https://127.0.0.1:9443/?url=https%3A%2F%2Flocalhost%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=same-origin&credentials=omit&" mode:"no-cors" credentials:"omit" should succeed.
    5838PASS fetching url:"https://127.0.0.1:9443/?url=https%3A%2F%2Flocalhost%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=same-origin&credentials=omit&" mode:"no-cors" credentials:"same-origin" should succeed.
     
    7050PASS fetching url:"https://localhost:9443/?url=https%3A%2F%2Flocalhost%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=same-origin&credentials=same-origin&" mode:"cors" credentials:"same-origin" should succeed.
    7151PASS fetching url:"https://localhost:9443/?url=https%3A%2F%2Flocalhost%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=same-origin&credentials=same-origin&" mode:"cors" credentials:"include" should succeed.
    72 FAIL url:"https://127.0.0.1:9443/?url=https%3A%2F%2Flocalhost%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=same-origin&credentials=same-origin&" mode:"same-origin" credentials:"omit" should fail. promise_rejects_js: function "function () { throw e }" threw object "TypeError: Cross origin requests are not allowed when using same-origin fetch mode." ("TypeError") expected instance of function "function TypeError() {
    73     [native code]
    74 }" ("TypeError")
    75 FAIL url:"https://127.0.0.1:9443/?url=https%3A%2F%2Flocalhost%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=same-origin&credentials=same-origin&" mode:"same-origin" credentials:"same-origin" should fail. promise_rejects_js: function "function () { throw e }" threw object "TypeError: Cross origin requests are not allowed when using same-origin fetch mode." ("TypeError") expected instance of function "function TypeError() {
    76     [native code]
    77 }" ("TypeError")
    78 FAIL url:"https://127.0.0.1:9443/?url=https%3A%2F%2Flocalhost%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=same-origin&credentials=same-origin&" mode:"same-origin" credentials:"include" should fail. promise_rejects_js: function "function () { throw e }" threw object "TypeError: Cross origin requests are not allowed when using same-origin fetch mode." ("TypeError") expected instance of function "function TypeError() {
    79     [native code]
    80 }" ("TypeError")
     52PASS url:"https://127.0.0.1:9443/?url=https%3A%2F%2Flocalhost%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=same-origin&credentials=same-origin&" mode:"same-origin" credentials:"omit" should fail.
     53PASS url:"https://127.0.0.1:9443/?url=https%3A%2F%2Flocalhost%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=same-origin&credentials=same-origin&" mode:"same-origin" credentials:"same-origin" should fail.
     54PASS url:"https://127.0.0.1:9443/?url=https%3A%2F%2Flocalhost%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=same-origin&credentials=same-origin&" mode:"same-origin" credentials:"include" should fail.
    8155PASS fetching url:"https://127.0.0.1:9443/?url=https%3A%2F%2Flocalhost%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=same-origin&credentials=same-origin&" mode:"no-cors" credentials:"omit" should succeed.
    8256PASS fetching url:"https://127.0.0.1:9443/?url=https%3A%2F%2Flocalhost%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=same-origin&credentials=same-origin&" mode:"no-cors" credentials:"same-origin" should succeed.
     
    8559PASS fetching url:"https://127.0.0.1:9443/?url=https%3A%2F%2Flocalhost%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=same-origin&credentials=same-origin&" mode:"cors" credentials:"same-origin" should succeed.
    8660PASS fetching url:"https://127.0.0.1:9443/?url=https%3A%2F%2Flocalhost%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=same-origin&credentials=same-origin&" mode:"cors" credentials:"include" should succeed.
    87 FAIL url:"https://localhost:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=same-origin&credentials=omit&" mode:"same-origin" credentials:"omit" should fail. promise_rejects_js: function "function () { throw e }" threw object "TypeError: FetchEvent.respondWith received an error: TypeError: Cross origin requests are not allowed when using same-origin fetch mode." ("TypeError") expected instance of function "function TypeError() {
    88     [native code]
    89 }" ("TypeError")
    90 FAIL url:"https://localhost:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=same-origin&credentials=omit&" mode:"same-origin" credentials:"same-origin" should fail. promise_rejects_js: function "function () { throw e }" threw object "TypeError: FetchEvent.respondWith received an error: TypeError: Cross origin requests are not allowed when using same-origin fetch mode." ("TypeError") expected instance of function "function TypeError() {
    91     [native code]
    92 }" ("TypeError")
    93 FAIL url:"https://localhost:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=same-origin&credentials=omit&" mode:"same-origin" credentials:"include" should fail. promise_rejects_js: function "function () { throw e }" threw object "TypeError: FetchEvent.respondWith received an error: TypeError: Cross origin requests are not allowed when using same-origin fetch mode." ("TypeError") expected instance of function "function TypeError() {
    94     [native code]
    95 }" ("TypeError")
    96 FAIL url:"https://localhost:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=same-origin&credentials=omit&" mode:"no-cors" credentials:"omit" should fail. promise_rejects_js: function "function () { throw e }" threw object "TypeError: FetchEvent.respondWith received an error: TypeError: Cross origin requests are not allowed when using same-origin fetch mode." ("TypeError") expected instance of function "function TypeError() {
    97     [native code]
    98 }" ("TypeError")
    99 FAIL url:"https://localhost:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=same-origin&credentials=omit&" mode:"no-cors" credentials:"same-origin" should fail. promise_rejects_js: function "function () { throw e }" threw object "TypeError: FetchEvent.respondWith received an error: TypeError: Cross origin requests are not allowed when using same-origin fetch mode." ("TypeError") expected instance of function "function TypeError() {
    100     [native code]
    101 }" ("TypeError")
    102 FAIL url:"https://localhost:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=same-origin&credentials=omit&" mode:"no-cors" credentials:"include" should fail. promise_rejects_js: function "function () { throw e }" threw object "TypeError: FetchEvent.respondWith received an error: TypeError: Cross origin requests are not allowed when using same-origin fetch mode." ("TypeError") expected instance of function "function TypeError() {
    103     [native code]
    104 }" ("TypeError")
    105 FAIL url:"https://localhost:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=same-origin&credentials=omit&" mode:"cors" credentials:"omit" should fail. promise_rejects_js: function "function () { throw e }" threw object "TypeError: FetchEvent.respondWith received an error: TypeError: Cross origin requests are not allowed when using same-origin fetch mode." ("TypeError") expected instance of function "function TypeError() {
    106     [native code]
    107 }" ("TypeError")
    108 FAIL url:"https://localhost:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=same-origin&credentials=omit&" mode:"cors" credentials:"same-origin" should fail. promise_rejects_js: function "function () { throw e }" threw object "TypeError: FetchEvent.respondWith received an error: TypeError: Cross origin requests are not allowed when using same-origin fetch mode." ("TypeError") expected instance of function "function TypeError() {
    109     [native code]
    110 }" ("TypeError")
    111 FAIL url:"https://localhost:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=same-origin&credentials=omit&" mode:"cors" credentials:"include" should fail. promise_rejects_js: function "function () { throw e }" threw object "TypeError: FetchEvent.respondWith received an error: TypeError: Cross origin requests are not allowed when using same-origin fetch mode." ("TypeError") expected instance of function "function TypeError() {
    112     [native code]
    113 }" ("TypeError")
    114 FAIL url:"https://127.0.0.1:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=same-origin&credentials=omit&" mode:"same-origin" credentials:"omit" should fail. promise_rejects_js: function "function () { throw e }" threw object "TypeError: Cross origin requests are not allowed when using same-origin fetch mode." ("TypeError") expected instance of function "function TypeError() {
    115     [native code]
    116 }" ("TypeError")
    117 FAIL url:"https://127.0.0.1:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=same-origin&credentials=omit&" mode:"same-origin" credentials:"same-origin" should fail. promise_rejects_js: function "function () { throw e }" threw object "TypeError: Cross origin requests are not allowed when using same-origin fetch mode." ("TypeError") expected instance of function "function TypeError() {
    118     [native code]
    119 }" ("TypeError")
    120 FAIL url:"https://127.0.0.1:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=same-origin&credentials=omit&" mode:"same-origin" credentials:"include" should fail. promise_rejects_js: function "function () { throw e }" threw object "TypeError: Cross origin requests are not allowed when using same-origin fetch mode." ("TypeError") expected instance of function "function TypeError() {
    121     [native code]
    122 }" ("TypeError")
    123 FAIL url:"https://127.0.0.1:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=same-origin&credentials=omit&" mode:"no-cors" credentials:"omit" should fail. promise_rejects_js: function "function () { throw e }" threw object "TypeError: FetchEvent.respondWith received an error: TypeError: Cross origin requests are not allowed when using same-origin fetch mode." ("TypeError") expected instance of function "function TypeError() {
    124     [native code]
    125 }" ("TypeError")
    126 FAIL url:"https://127.0.0.1:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=same-origin&credentials=omit&" mode:"no-cors" credentials:"same-origin" should fail. promise_rejects_js: function "function () { throw e }" threw object "TypeError: FetchEvent.respondWith received an error: TypeError: Cross origin requests are not allowed when using same-origin fetch mode." ("TypeError") expected instance of function "function TypeError() {
    127     [native code]
    128 }" ("TypeError")
    129 FAIL url:"https://127.0.0.1:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=same-origin&credentials=omit&" mode:"no-cors" credentials:"include" should fail. promise_rejects_js: function "function () { throw e }" threw object "TypeError: FetchEvent.respondWith received an error: TypeError: Cross origin requests are not allowed when using same-origin fetch mode." ("TypeError") expected instance of function "function TypeError() {
    130     [native code]
    131 }" ("TypeError")
    132 FAIL url:"https://127.0.0.1:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=same-origin&credentials=omit&" mode:"cors" credentials:"omit" should fail. promise_rejects_js: function "function () { throw e }" threw object "TypeError: FetchEvent.respondWith received an error: TypeError: Cross origin requests are not allowed when using same-origin fetch mode." ("TypeError") expected instance of function "function TypeError() {
    133     [native code]
    134 }" ("TypeError")
    135 FAIL url:"https://127.0.0.1:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=same-origin&credentials=omit&" mode:"cors" credentials:"same-origin" should fail. promise_rejects_js: function "function () { throw e }" threw object "TypeError: FetchEvent.respondWith received an error: TypeError: Cross origin requests are not allowed when using same-origin fetch mode." ("TypeError") expected instance of function "function TypeError() {
    136     [native code]
    137 }" ("TypeError")
    138 FAIL url:"https://127.0.0.1:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=same-origin&credentials=omit&" mode:"cors" credentials:"include" should fail. promise_rejects_js: function "function () { throw e }" threw object "TypeError: FetchEvent.respondWith received an error: TypeError: Cross origin requests are not allowed when using same-origin fetch mode." ("TypeError") expected instance of function "function TypeError() {
    139     [native code]
    140 }" ("TypeError")
    141 FAIL url:"https://localhost:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=no-cors&credentials=omit&" mode:"same-origin" credentials:"omit" should fail. promise_rejects_js: function "function () { throw e }" threw object "TypeError: Response served by service worker is opaque" ("TypeError") expected instance of function "function TypeError() {
    142     [native code]
    143 }" ("TypeError")
    144 FAIL url:"https://localhost:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=no-cors&credentials=omit&" mode:"same-origin" credentials:"same-origin" should fail. promise_rejects_js: function "function () { throw e }" threw object "TypeError: Response served by service worker is opaque" ("TypeError") expected instance of function "function TypeError() {
    145     [native code]
    146 }" ("TypeError")
    147 FAIL url:"https://localhost:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=no-cors&credentials=omit&" mode:"same-origin" credentials:"include" should fail. promise_rejects_js: function "function () { throw e }" threw object "TypeError: Response served by service worker is opaque" ("TypeError") expected instance of function "function TypeError() {
    148     [native code]
    149 }" ("TypeError")
     61PASS url:"https://localhost:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=same-origin&credentials=omit&" mode:"same-origin" credentials:"omit" should fail.
     62PASS url:"https://localhost:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=same-origin&credentials=omit&" mode:"same-origin" credentials:"same-origin" should fail.
     63PASS url:"https://localhost:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=same-origin&credentials=omit&" mode:"same-origin" credentials:"include" should fail.
     64PASS url:"https://localhost:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=same-origin&credentials=omit&" mode:"no-cors" credentials:"omit" should fail.
     65PASS url:"https://localhost:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=same-origin&credentials=omit&" mode:"no-cors" credentials:"same-origin" should fail.
     66PASS url:"https://localhost:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=same-origin&credentials=omit&" mode:"no-cors" credentials:"include" should fail.
     67PASS url:"https://localhost:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=same-origin&credentials=omit&" mode:"cors" credentials:"omit" should fail.
     68PASS url:"https://localhost:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=same-origin&credentials=omit&" mode:"cors" credentials:"same-origin" should fail.
     69PASS url:"https://localhost:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=same-origin&credentials=omit&" mode:"cors" credentials:"include" should fail.
     70PASS url:"https://127.0.0.1:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=same-origin&credentials=omit&" mode:"same-origin" credentials:"omit" should fail.
     71PASS url:"https://127.0.0.1:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=same-origin&credentials=omit&" mode:"same-origin" credentials:"same-origin" should fail.
     72PASS url:"https://127.0.0.1:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=same-origin&credentials=omit&" mode:"same-origin" credentials:"include" should fail.
     73PASS url:"https://127.0.0.1:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=same-origin&credentials=omit&" mode:"no-cors" credentials:"omit" should fail.
     74PASS url:"https://127.0.0.1:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=same-origin&credentials=omit&" mode:"no-cors" credentials:"same-origin" should fail.
     75PASS url:"https://127.0.0.1:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=same-origin&credentials=omit&" mode:"no-cors" credentials:"include" should fail.
     76PASS url:"https://127.0.0.1:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=same-origin&credentials=omit&" mode:"cors" credentials:"omit" should fail.
     77PASS url:"https://127.0.0.1:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=same-origin&credentials=omit&" mode:"cors" credentials:"same-origin" should fail.
     78PASS url:"https://127.0.0.1:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=same-origin&credentials=omit&" mode:"cors" credentials:"include" should fail.
     79PASS url:"https://localhost:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=no-cors&credentials=omit&" mode:"same-origin" credentials:"omit" should fail.
     80PASS url:"https://localhost:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=no-cors&credentials=omit&" mode:"same-origin" credentials:"same-origin" should fail.
     81PASS url:"https://localhost:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=no-cors&credentials=omit&" mode:"same-origin" credentials:"include" should fail.
    15082PASS fetching url:"https://localhost:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=no-cors&credentials=omit&" mode:"no-cors" credentials:"omit" should succeed.
    15183PASS fetching url:"https://localhost:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=no-cors&credentials=omit&" mode:"no-cors" credentials:"same-origin" should succeed.
    15284PASS fetching url:"https://localhost:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=no-cors&credentials=omit&" mode:"no-cors" credentials:"include" should succeed.
    153 FAIL url:"https://localhost:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=no-cors&credentials=omit&" mode:"cors" credentials:"omit" should fail. promise_rejects_js: function "function () { throw e }" threw object "TypeError: Response served by service worker is opaque" ("TypeError") expected instance of function "function TypeError() {
    154     [native code]
    155 }" ("TypeError")
    156 FAIL url:"https://localhost:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=no-cors&credentials=omit&" mode:"cors" credentials:"same-origin" should fail. promise_rejects_js: function "function () { throw e }" threw object "TypeError: Response served by service worker is opaque" ("TypeError") expected instance of function "function TypeError() {
    157     [native code]
    158 }" ("TypeError")
    159 FAIL url:"https://localhost:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=no-cors&credentials=omit&" mode:"cors" credentials:"include" should fail. promise_rejects_js: function "function () { throw e }" threw object "TypeError: Response served by service worker is opaque" ("TypeError") expected instance of function "function TypeError() {
    160     [native code]
    161 }" ("TypeError")
    162 FAIL url:"https://127.0.0.1:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=no-cors&credentials=omit&" mode:"same-origin" credentials:"omit" should fail. promise_rejects_js: function "function () { throw e }" threw object "TypeError: Cross origin requests are not allowed when using same-origin fetch mode." ("TypeError") expected instance of function "function TypeError() {
    163     [native code]
    164 }" ("TypeError")
    165 FAIL url:"https://127.0.0.1:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=no-cors&credentials=omit&" mode:"same-origin" credentials:"same-origin" should fail. promise_rejects_js: function "function () { throw e }" threw object "TypeError: Cross origin requests are not allowed when using same-origin fetch mode." ("TypeError") expected instance of function "function TypeError() {
    166     [native code]
    167 }" ("TypeError")
    168 FAIL url:"https://127.0.0.1:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=no-cors&credentials=omit&" mode:"same-origin" credentials:"include" should fail. promise_rejects_js: function "function () { throw e }" threw object "TypeError: Cross origin requests are not allowed when using same-origin fetch mode." ("TypeError") expected instance of function "function TypeError() {
    169     [native code]
    170 }" ("TypeError")
     85PASS url:"https://localhost:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=no-cors&credentials=omit&" mode:"cors" credentials:"omit" should fail.
     86PASS url:"https://localhost:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=no-cors&credentials=omit&" mode:"cors" credentials:"same-origin" should fail.
     87PASS url:"https://localhost:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=no-cors&credentials=omit&" mode:"cors" credentials:"include" should fail.
     88PASS url:"https://127.0.0.1:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=no-cors&credentials=omit&" mode:"same-origin" credentials:"omit" should fail.
     89PASS url:"https://127.0.0.1:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=no-cors&credentials=omit&" mode:"same-origin" credentials:"same-origin" should fail.
     90PASS url:"https://127.0.0.1:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=no-cors&credentials=omit&" mode:"same-origin" credentials:"include" should fail.
    17191PASS fetching url:"https://127.0.0.1:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=no-cors&credentials=omit&" mode:"no-cors" credentials:"omit" should succeed.
    17292PASS fetching url:"https://127.0.0.1:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=no-cors&credentials=omit&" mode:"no-cors" credentials:"same-origin" should succeed.
    17393PASS fetching url:"https://127.0.0.1:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=no-cors&credentials=omit&" mode:"no-cors" credentials:"include" should succeed.
    174 FAIL url:"https://127.0.0.1:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=no-cors&credentials=omit&" mode:"cors" credentials:"omit" should fail. promise_rejects_js: function "function () { throw e }" threw object "TypeError: Response served by service worker is opaque" ("TypeError") expected instance of function "function TypeError() {
    175     [native code]
    176 }" ("TypeError")
    177 FAIL url:"https://127.0.0.1:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=no-cors&credentials=omit&" mode:"cors" credentials:"same-origin" should fail. promise_rejects_js: function "function () { throw e }" threw object "TypeError: Response served by service worker is opaque" ("TypeError") expected instance of function "function TypeError() {
    178     [native code]
    179 }" ("TypeError")
    180 FAIL url:"https://127.0.0.1:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=no-cors&credentials=omit&" mode:"cors" credentials:"include" should fail. promise_rejects_js: function "function () { throw e }" threw object "TypeError: Response served by service worker is opaque" ("TypeError") expected instance of function "function TypeError() {
    181     [native code]
    182 }" ("TypeError")
     94PASS url:"https://127.0.0.1:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=no-cors&credentials=omit&" mode:"cors" credentials:"omit" should fail.
     95PASS url:"https://127.0.0.1:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=no-cors&credentials=omit&" mode:"cors" credentials:"same-origin" should fail.
     96PASS url:"https://127.0.0.1:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3F&mode=no-cors&credentials=omit&" mode:"cors" credentials:"include" should fail.
    18397FAIL url:"https://localhost:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FACAOrigin%3D*&mode=cors&credentials=omit&" mode:"same-origin" credentials:"omit" should fail. assert_unreached: Should have rejected: undefined Reached unreachable code
    18498FAIL url:"https://localhost:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FACAOrigin%3D*&mode=cors&credentials=omit&" mode:"same-origin" credentials:"same-origin" should fail. assert_unreached: Should have rejected: undefined Reached unreachable code
     
    190104PASS fetching url:"https://localhost:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FACAOrigin%3D*&mode=cors&credentials=omit&" mode:"cors" credentials:"same-origin" should succeed.
    191105PASS fetching url:"https://localhost:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FACAOrigin%3D*&mode=cors&credentials=omit&" mode:"cors" credentials:"include" should succeed.
    192 FAIL url:"https://127.0.0.1:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FACAOrigin%3D*&mode=cors&credentials=omit&" mode:"same-origin" credentials:"omit" should fail. promise_rejects_js: function "function () { throw e }" threw object "TypeError: Cross origin requests are not allowed when using same-origin fetch mode." ("TypeError") expected instance of function "function TypeError() {
    193     [native code]
    194 }" ("TypeError")
    195 FAIL url:"https://127.0.0.1:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FACAOrigin%3D*&mode=cors&credentials=omit&" mode:"same-origin" credentials:"same-origin" should fail. promise_rejects_js: function "function () { throw e }" threw object "TypeError: Cross origin requests are not allowed when using same-origin fetch mode." ("TypeError") expected instance of function "function TypeError() {
    196     [native code]
    197 }" ("TypeError")
    198 FAIL url:"https://127.0.0.1:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FACAOrigin%3D*&mode=cors&credentials=omit&" mode:"same-origin" credentials:"include" should fail. promise_rejects_js: function "function () { throw e }" threw object "TypeError: Cross origin requests are not allowed when using same-origin fetch mode." ("TypeError") expected instance of function "function TypeError() {
    199     [native code]
    200 }" ("TypeError")
     106PASS url:"https://127.0.0.1:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FACAOrigin%3D*&mode=cors&credentials=omit&" mode:"same-origin" credentials:"omit" should fail.
     107PASS url:"https://127.0.0.1:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FACAOrigin%3D*&mode=cors&credentials=omit&" mode:"same-origin" credentials:"same-origin" should fail.
     108PASS url:"https://127.0.0.1:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FACAOrigin%3D*&mode=cors&credentials=omit&" mode:"same-origin" credentials:"include" should fail.
    201109PASS fetching url:"https://127.0.0.1:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FACAOrigin%3D*&mode=cors&credentials=omit&" mode:"no-cors" credentials:"omit" should succeed.
    202110PASS fetching url:"https://127.0.0.1:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FACAOrigin%3D*&mode=cors&credentials=omit&" mode:"no-cors" credentials:"same-origin" should succeed.
     
    214122PASS fetching url:"https://localhost:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FACAOrigin%3Dhttps%3A%2F%2Flocalhost%3A9443%26ACACredentials%3Dtrue&mode=cors&credentials=include&" mode:"cors" credentials:"same-origin" should succeed.
    215123PASS fetching url:"https://localhost:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FACAOrigin%3Dhttps%3A%2F%2Flocalhost%3A9443%26ACACredentials%3Dtrue&mode=cors&credentials=include&" mode:"cors" credentials:"include" should succeed.
    216 FAIL url:"https://127.0.0.1:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FACAOrigin%3Dhttps%3A%2F%2Flocalhost%3A9443%26ACACredentials%3Dtrue&mode=cors&credentials=include&" mode:"same-origin" credentials:"omit" should fail. promise_rejects_js: function "function () { throw e }" threw object "TypeError: Cross origin requests are not allowed when using same-origin fetch mode." ("TypeError") expected instance of function "function TypeError() {
    217     [native code]
    218 }" ("TypeError")
    219 FAIL url:"https://127.0.0.1:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FACAOrigin%3Dhttps%3A%2F%2Flocalhost%3A9443%26ACACredentials%3Dtrue&mode=cors&credentials=include&" mode:"same-origin" credentials:"same-origin" should fail. promise_rejects_js: function "function () { throw e }" threw object "TypeError: Cross origin requests are not allowed when using same-origin fetch mode." ("TypeError") expected instance of function "function TypeError() {
    220     [native code]
    221 }" ("TypeError")
    222 FAIL url:"https://127.0.0.1:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FACAOrigin%3Dhttps%3A%2F%2Flocalhost%3A9443%26ACACredentials%3Dtrue&mode=cors&credentials=include&" mode:"same-origin" credentials:"include" should fail. promise_rejects_js: function "function () { throw e }" threw object "TypeError: Cross origin requests are not allowed when using same-origin fetch mode." ("TypeError") expected instance of function "function TypeError() {
    223     [native code]
    224 }" ("TypeError")
     124PASS url:"https://127.0.0.1:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FACAOrigin%3Dhttps%3A%2F%2Flocalhost%3A9443%26ACACredentials%3Dtrue&mode=cors&credentials=include&" mode:"same-origin" credentials:"omit" should fail.
     125PASS url:"https://127.0.0.1:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FACAOrigin%3Dhttps%3A%2F%2Flocalhost%3A9443%26ACACredentials%3Dtrue&mode=cors&credentials=include&" mode:"same-origin" credentials:"same-origin" should fail.
     126PASS url:"https://127.0.0.1:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FACAOrigin%3Dhttps%3A%2F%2Flocalhost%3A9443%26ACACredentials%3Dtrue&mode=cors&credentials=include&" mode:"same-origin" credentials:"include" should fail.
    225127PASS fetching url:"https://127.0.0.1:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FACAOrigin%3Dhttps%3A%2F%2Flocalhost%3A9443%26ACACredentials%3Dtrue&mode=cors&credentials=include&" mode:"no-cors" credentials:"omit" should succeed.
    226128PASS fetching url:"https://127.0.0.1:9443/?url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FACAOrigin%3Dhttps%3A%2F%2Flocalhost%3A9443%26ACACredentials%3Dtrue&mode=cors&credentials=include&" mode:"no-cors" credentials:"same-origin" should succeed.
  • trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/redirected-response.https-expected.txt

    r267647 r269227  
    77PASS mode: "follow", no mode change, no server redirect
    88PASS mode: "follow", no mode change
    9 FAIL mode: "error", mode change: "follow" promise_rejects_js: The redirected response from the service worker should be treated as an error when the redirect flag of request was 'error'. function "function () { throw e }" threw object "TypeError: Response served by service worker has redirections" ("TypeError") expected instance of function "function TypeError() {
    10     [native code]
    11 }" ("TypeError")
    12 FAIL mode: "manual", mode change: "follow" promise_rejects_js: The redirected response from the service worker should be treated as an error when the redirect flag of request was 'manual'. function "function () { throw e }" threw object "TypeError: Response served by service worker has redirections" ("TypeError") expected instance of function "function TypeError() {
    13     [native code]
    14 }" ("TypeError")
    15 FAIL mode: "follow", mode change: "manual" promise_rejects_js: The opaqueredirect response from the service worker should be treated as an error when the redirect flag of request was 'follow'. function "function () { throw e }" threw object "TypeError: Response served by service worker is opaque redirect" ("TypeError") expected instance of function "function TypeError() {
    16     [native code]
    17 }" ("TypeError")
    18 FAIL mode: "error", mode change: "manual" promise_rejects_js: The opaqueredirect response from the service worker should be treated as an error when the redirect flag of request was 'error'. function "function () { throw e }" threw object "TypeError: Response served by service worker is opaque redirect" ("TypeError") expected instance of function "function TypeError() {
    19     [native code]
    20 }" ("TypeError")
     9PASS mode: "error", mode change: "follow"
     10PASS mode: "manual", mode change: "follow"
     11PASS mode: "follow", mode change: "manual"
     12PASS mode: "error", mode change: "manual"
    2113PASS mode: "manual", no mode change
    2214PASS mode: "follow", generated redirect response
    23 FAIL mode: "error", generated redirect response promise_rejects_js: The generated redirect response from the service worker should be treated as an error when the redirect flag of request was 'error'. function "function () { throw e }" threw object "TypeError: Not allowed to follow a redirection while loading https://localhost:9443/service-workers/service-worker/dummy?url=https%3A%2F%2Flocalhost%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Fsimple.txt%3F&original-redirect-mode=error&sw=gen" ("TypeError") expected instance of function "function TypeError() {
    24     [native code]
    25 }" ("TypeError")
     15PASS mode: "error", generated redirect response
    2616PASS mode: "manual", generated redirect response
    2717PASS Fetch should follow the redirect response 20 times
    28 FAIL Fetch should not follow the redirect response 21 times. promise_rejects_js: Fetch should not follow the redirect response 21 times. function "function () { throw e }" threw object "TypeError: Too many redirections" ("TypeError") expected instance of function "function TypeError() {
    29     [native code]
    30 }" ("TypeError")
     18PASS Fetch should not follow the redirect response 21 times.
    3119PASS The URL for the service worker redirected request should be propagated to response.
    3220PASS restore global state (service worker registration)
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-audiocontext-interface/promise-methods-after-discard-expected.txt

    r269133 r269227  
    11
    2 FAIL suspend() promise_rejects_dom: function "function () { throw e }" threw an exception from the wrong global
    3 FAIL resume() promise_rejects_dom: function "function () { throw e }" threw an exception from the wrong global
    4 FAIL close() promise_rejects_dom: function "function () { throw e }" threw an exception from the wrong global
     2PASS suspend()
     3PASS resume()
     4PASS close()
    55
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-offlineaudiocontext-interface/startrendering-after-discard-expected.txt

    r269133 r269227  
    11
    2 FAIL startRendering() promise_rejects_dom: function "function () { throw e }" threw an exception from the wrong global
     2PASS startRendering()
    33
  • trunk/LayoutTests/requestidlecallback/requestidlecallback-document-gc-expected.txt

    r251924 r269227  
    44
    55
    6 PASS initialCount + frameCount / 2 > internals.numberOfLiveDocuments() is true
     6PASS enoughDocumentCollected() became true
    77PASS successfullyParsed is true
    88
  • trunk/LayoutTests/requestidlecallback/requestidlecallback-document-gc.html

    r251944 r269227  
    1717}
    1818
     19function enoughDocumentCollected()
     20{
     21    return initialCount + frameCount / 2 > internals.numberOfLiveDocuments();
     22}
     23
    1924function runTest() {
    2025    window.initialCount = internals.numberOfLiveDocuments();
     
    2631    }
    2732    document.querySelectorAll('iframe').forEach((frame) => frame.remove());
    28     setTimeout(() => {
     33    setInterval(() => {
    2934        GCController.collect();
    30         shouldBeTrue('initialCount + frameCount / 2 > internals.numberOfLiveDocuments()');
    31         finishJSTest();
    32     }, 0);
     35    }, 10);
     36    shouldBecomeEqual("enoughDocumentCollected()", "true", finishJSTest);
    3337}
    3438
  • trunk/Source/WebCore/ChangeLog

    r269225 r269227  
     12020-10-31  Chris Dumez  <cdumez@apple.com>
     2
     3        Promises returned by our DOM API have the caller's global instead of the callee's
     4        https://bugs.webkit.org/show_bug.cgi?id=218363
     5
     6        Reviewed by Darin Adler and Ryosuke Niwa.
     7
     8        Promises returned by our DOM APIs were using the caller's global instead of the
     9        callee's global. This behavior was inconsistent with Chrome and Firefox, and was
     10        causing failures in web-platform-tests. Because the global of the promise was
     11        wrong, the global of the values passed when settling the promise (e.g. the global
     12        of the exception used to reject a promise) was also wrong. This patch fixes this.
     13
     14        After fixing the global of DOM promises, some tests started failing because they
     15        expect the promises coming from subframes to still get settled *after* their
     16        iframe has been removed from the document. Such promises get settled properly
     17        in Firefox and Chrome. They also used to settle properly in WebKit because we
     18        were incorrectly using the caller's global. The issue was that after an iframe
     19        gets detached, Document::stopActiveDOMObjects() would get called, which would
     20        stop the EventLoopTaskGroup associated with the document and clear all pending
     21        tasks from this group in the event loop. To address this, when a
     22        Document::stopActiveDOMObjects(), we now mark the Document's EventLoopTaskGroup
     23        as "ready to stop" instead of stopping it. Only once ALL groups in the EventLoop
     24        are ready to stop, do we actually stop all those groups. This is important
     25        because each document has its own group but all documents of similar origins
     26        share the same EventLoop.
     27
     28        Tests: fast/js-promise-from-detached-iframe.html
     29               http/tests/eventloop/promise-from-cross-origin-detached-iframe.html
     30               webaudio/promise-global-object.html
     31
     32        * bindings/js/JSDOMPromiseDeferred.h:
     33        (WebCore::DeferredPromise::shouldIgnoreRequestToFulfill const):
     34        (WebCore::callPromiseFunction):
     35        * dom/Document.cpp:
     36        (WebCore::Document::stopActiveDOMObjects):
     37        (WebCore::Document::eventLoop):
     38        * dom/EventLoop.cpp:
     39        (WebCore::EventLoop::registerGroup):
     40        (WebCore::EventLoop::unregisterGroup):
     41        (WebCore::EventLoop::stopAssociatedGroupsIfNecessary):
     42        * dom/EventLoop.h:
     43        (WebCore::EventLoopTaskGroup::EventLoopTaskGroup):
     44        (WebCore::EventLoopTaskGroup::~EventLoopTaskGroup):
     45        (WebCore::EventLoopTaskGroup::isReadyToStop const):
     46        (WebCore::EventLoopTaskGroup::markAsReadyToStop):
     47        (WebCore::EventLoopTaskGroup::stopAndDiscardAllTasks):
     48        * workers/WorkerOrWorkletGlobalScope.cpp:
     49        (WebCore::WorkerOrWorkletGlobalScope::prepareForDestruction):
     50
    1512020-10-31  Zalan Bujtas  <zalan@apple.com>
    252
  • trunk/Source/WebCore/bindings/js/JSDOMPromiseDeferred.h

    r266142 r269227  
    177177    }
    178178
    179     bool shouldIgnoreRequestToFulfill() const { return isEmpty() || activeDOMObjectAreStopped(); }
     179    bool shouldIgnoreRequestToFulfill() const { return isEmpty(); }
    180180
    181181    JSC::JSPromise* deferred() const { return guarded(); }
     
    315315    auto catchScope = DECLARE_CATCH_SCOPE(vm);
    316316
    317     auto& globalObject = callerGlobalObject(lexicalGlobalObject, callFrame);
     317    auto& globalObject = *JSC::jsSecureCast<JSDOMGlobalObject*>(vm, &lexicalGlobalObject);
    318318    auto* promise = JSC::JSPromise::create(vm, globalObject.promiseStructure());
    319319    ASSERT(promise);
     
    334334    auto catchScope = DECLARE_CATCH_SCOPE(vm);
    335335
    336     auto& globalObject = callerGlobalObject(lexicalGlobalObject, callFrame);
     336    auto& globalObject = *JSC::jsSecureCast<JSDOMGlobalObject*>(vm, &lexicalGlobalObject);
    337337    auto* promise = JSC::JSPromise::create(vm, globalObject.promiseStructure());
    338338    ASSERT(promise);
  • trunk/Source/WebCore/dom/ActiveDOMObject.cpp

    r259252 r269227  
    154154    }
    155155
    156     void execute() final { m_target->dispatchEvent(m_event.get()); }
     156    void execute() final
     157    {
     158        // If this task executes after the script execution context has been stopped, don't
     159        // actually dispatch the event.
     160        if (m_object.isAllowedToRunScript())
     161            m_target->dispatchEvent(m_event.get());
     162    }
    157163
    158164private:
  • trunk/Source/WebCore/dom/Document.cpp

    r269027 r269227  
    27132713{
    27142714    if (m_documentTaskGroup)
    2715         m_documentTaskGroup->stopAndDiscardAllTasks();
     2715        m_documentTaskGroup->markAsReadyToStop();
    27162716    ScriptExecutionContext::stopActiveDOMObjects();
    27172717    platformSuspendOrStopActiveDOMObjects();
     
    63716371        m_documentTaskGroup = makeUnique<EventLoopTaskGroup>(windowEventLoop());
    63726372        if (activeDOMObjectsAreStopped())
    6373             m_documentTaskGroup->stopAndDiscardAllTasks();
     6373            m_documentTaskGroup->markAsReadyToStop();
    63746374        else if (activeDOMObjectsAreSuspended())
    63756375            m_documentTaskGroup->suspend();
  • trunk/Source/WebCore/dom/EmptyScriptExecutionContext.h

    r268868 r269227  
    110110        }
    111111
    112         void scheduleToRun() final { ASSERT_NOT_REACHED(); };
    113         bool isContextThread() const final { return false; };
     112        void scheduleToRun() final { ASSERT_NOT_REACHED(); }
     113        bool isContextThread() const final { return true; }
    114114
    115115        MicrotaskQueue m_queue;
  • trunk/Source/WebCore/dom/EventLoop.cpp

    r253091 r269227  
    5858        return;
    5959    scheduleToRunIfNeeded();
     60}
     61
     62void EventLoop::registerGroup(EventLoopTaskGroup& group)
     63{
     64    ASSERT(isContextThread());
     65    m_associatedGroups.add(group);
     66}
     67
     68void EventLoop::unregisterGroup(EventLoopTaskGroup& group)
     69{
     70    ASSERT(isContextThread());
     71    if (m_associatedGroups.remove(group))
     72        stopAssociatedGroupsIfNecessary();
     73}
     74
     75void EventLoop::stopAssociatedGroupsIfNecessary()
     76{
     77    ASSERT(isContextThread());
     78    for (auto& group : m_associatedGroups) {
     79        if (!group.isReadyToStop())
     80            return;
     81    }
     82    auto associatedGroups = std::exchange(m_associatedGroups, { });
     83    for (auto& group : associatedGroups)
     84        group.stopAndDiscardAllTasks();
    6085}
    6186
  • trunk/Source/WebCore/dom/EventLoop.h

    r253265 r269227  
    8080    void stopGroup(EventLoopTaskGroup&);
    8181
     82    void registerGroup(EventLoopTaskGroup&);
     83    void unregisterGroup(EventLoopTaskGroup&);
     84    void stopAssociatedGroupsIfNecessary();
     85
    8286protected:
    8387    EventLoop() = default;
     
    9296    // Use a global queue instead of multiple task queues since HTML5 spec allows UA to pick arbitrary queue.
    9397    Vector<std::unique_ptr<EventLoopTask>> m_tasks;
     98    WeakHashSet<EventLoopTaskGroup> m_associatedGroups;
    9499    WeakHashSet<EventLoopTaskGroup> m_groupsWithSuspenedTasks;
    95100    bool m_isScheduledToRun { false };
     
    104109        : m_eventLoop(makeWeakPtr(eventLoop))
    105110    {
     111        eventLoop.registerGroup(*this);
     112    }
     113
     114    ~EventLoopTaskGroup()
     115    {
     116        if (auto* eventLoop = m_eventLoop.get())
     117            eventLoop->unregisterGroup(*this);
    106118    }
    107119
     
    118130    }
    119131
     132    // Marks the group as ready to stop but it won't actually be stopped
     133    // until all groups in this event loop are ready to stop.
     134    void markAsReadyToStop()
     135    {
     136        if (isReadyToStop())
     137            return;
     138
     139        m_state = State::ReadyToStop;
     140        if (auto* eventLoop = m_eventLoop.get())
     141            eventLoop->stopAssociatedGroupsIfNecessary();
     142    }
     143
     144    // This gets called by the event loop when all groups in the EventLoop as ready to stop.
    120145    void stopAndDiscardAllTasks()
    121146    {
     147        ASSERT(isReadyToStop());
    122148        m_state = State::Stopped;
    123149        if (auto* eventLoop = m_eventLoop.get())
     
    127153    void suspend()
    128154    {
    129         ASSERT(m_state != State::Stopped);
     155        ASSERT(!isStoppedPermanently());
     156        ASSERT(!isReadyToStop());
    130157        m_state = State::Suspended;
    131158        // We don't remove suspended tasks to preserve the ordering.
     
    135162    void resume()
    136163    {
    137         ASSERT(m_state != State::Stopped);
     164        ASSERT(!isStoppedPermanently());
     165        ASSERT(!isReadyToStop());
    138166        m_state = State::Running;
    139167        if (auto* eventLoop = m_eventLoop.get())
     
    143171    bool isStoppedPermanently() { return m_state == State::Stopped; }
    144172    bool isSuspended() { return m_state == State::Suspended; }
     173    bool isReadyToStop() const { return m_state == State::ReadyToStop; }
    145174
    146175    void queueTask(std::unique_ptr<EventLoopTask>&&);
     
    155184
    156185private:
    157     enum class State : uint8_t { Running, Suspended, Stopped };
     186    enum class State : uint8_t { Running, Suspended, ReadyToStop, Stopped };
    158187
    159188    WeakPtr<EventLoop> m_eventLoop;
  • trunk/Source/WebCore/workers/WorkerOrWorkletGlobalScope.cpp

    r268900 r269227  
    4949void WorkerOrWorkletGlobalScope::prepareForDestruction()
    5050{
    51     if (m_defaultTaskGroup)
    52         m_defaultTaskGroup->stopAndDiscardAllTasks();
     51    if (m_defaultTaskGroup) {
     52        m_defaultTaskGroup->markAsReadyToStop();
     53        ASSERT(m_defaultTaskGroup->isStoppedPermanently());
     54    }
    5355
    5456    stopActiveDOMObjects();
Note: See TracChangeset for help on using the changeset viewer.