Resync service-workers web platform tests from upstream
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 28 Nov 2018 01:14:50 +0000 (01:14 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 28 Nov 2018 01:14:50 +0000 (01:14 +0000)
https://bugs.webkit.org/show_bug.cgi?id=192035

Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

Resync service-workers web platform tests from upstream 73507a79fc.

* web-platform-tests/: Updated.

LayoutTests:

* TestExpectations:
* tests-options.json:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@238592 268f45cc-cd09-0410-ab3c-d52691b4dbfc

357 files changed:
LayoutTests/ChangeLog
LayoutTests/TestExpectations
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/resources/import-expectations.json
LayoutTests/imported/w3c/web-platform-tests/interfaces/service-workers.idl [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/META.yml [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/OWNERS [deleted file]
LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/META.yml [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/OWNERS [deleted file]
LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/resources/cache-keys-attributes-for-service-worker.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/resources/vary.py [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/resources/w3c-import.log
LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/script-tests/cache-abort.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/script-tests/cache-add.js
LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/script-tests/cache-keys.js
LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/script-tests/cache-match.js
LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/script-tests/cache-storage-match.js
LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/script-tests/w3c-import.log
LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/serviceworker/cache-abort.https-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/serviceworker/cache-abort.https.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/serviceworker/cache-add.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/serviceworker/cache-keys-attributes-for-service-worker.https-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/serviceworker/cache-keys-attributes-for-service-worker.https.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/serviceworker/cache-keys.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/serviceworker/cache-match.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/serviceworker/w3c-import.log
LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/w3c-import.log
LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/window/cache-abort.https-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/window/cache-abort.https.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/window/cache-add.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/window/cache-keys.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/window/cache-match.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/window/cache-match.https.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/window/w3c-import.log
LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/worker/cache-abort.https-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/worker/cache-abort.https.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/worker/cache-add.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/worker/cache-keys.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/worker/cache-match.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/worker/w3c-import.log
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/Service-Worker-Allowed-header.https-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/Service-Worker-Allowed-header.https.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/ServiceWorkerGlobalScope/resources/unregister-controlling-worker.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/ServiceWorkerGlobalScope/resources/w3c-import.log
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/ServiceWorkerGlobalScope/w3c-import.log
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/about-blank-replacement.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/about-blank-replacement.https.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/activation-after-registration.https.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/activation.https.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/active.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/active.https.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/appcache-ordering-main.https.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/claim-worker-fetch.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/claim-worker-fetch.https.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/client-id.https.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/clients-get-client-types.https.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/clients-get.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/clients-get.https.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/clients-matchall-exact-controller.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/clients-matchall-exact-controller.https.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/clients-matchall-include-uncontrolled.https.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/clients-matchall-order.https.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/clients-matchall.https.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/controller-on-disconnect.https.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/controller-on-load.https.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/controller-with-no-fetch-event-handler.https-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/controller-with-no-fetch-event-handler.https.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/dedicated-worker-service-worker-interception.https-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/dedicated-worker-service-worker-interception.https.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/detached-context.https.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/embed-and-object-are-not-intercepted.https-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/embed-and-object-are-not-intercepted.https.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/extendable-event-async-waituntil.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/extendable-event-async-waituntil.https.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/extendable-event-waituntil.https.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-audio-tainting.https-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-audio-tainting.https.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-canvas-tainting-cache.https-expected.txt [deleted file]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-canvas-tainting-cache.https.html [deleted file]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-canvas-tainting-double-write.https-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-canvas-tainting-double-write.https.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-canvas-tainting-image-cache.https-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-canvas-tainting-image-cache.https.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-canvas-tainting-image.https-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-canvas-tainting-image.https.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-canvas-tainting-video-cache.https-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-canvas-tainting-video-cache.https.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-canvas-tainting-video-with-range-request.https-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-canvas-tainting-video-with-range-request.https.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-canvas-tainting-video.https-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-canvas-tainting-video.https.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-canvas-tainting.https-expected.txt [deleted file]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-canvas-tainting.https.html [deleted file]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-cors-exposed-header-names.https-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-cors-exposed-header-names.https.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-cors-xhr.https.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-is-history-backward-navigation-manual.https.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-is-history-forward-navigation-manual.https.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-is-reload-iframe-navigation-manual.https-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-is-reload-iframe-navigation-manual.https.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-is-reload-navigation-manual.https.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-redirect.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-redirect.https.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-referrer-policy.https.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-respond-with-custom-response.https-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-respond-with-custom-response.https.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-respond-with-readable-stream.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-respond-with-readable-stream.https.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event.https.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-frame-resource.https.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-header-visibility.https.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-request-css-base-url.https.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-request-css-cross-origin-mime-check.https-expected.txt [deleted file]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-request-css-cross-origin-mime-check.https.html [deleted file]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-request-css-cross-origin.https-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-request-css-cross-origin.https.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-request-css-images.https.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-request-html-imports.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-request-html-imports.https.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-request-no-freshness-headers.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-request-no-freshness-headers.https.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-request-resources.https.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-request-xhr-sync-on-worker.https-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-request-xhr-sync-on-worker.https.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-request-xhr-sync.https.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-response-taint.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-response-taint.https.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-response-xhr.https.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-waits-for-activate.https.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/getregistration.https.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/http-to-https-redirect-and-register.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/http-to-https-redirect-and-register.https.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/import-module-scripts.https-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/import-module-scripts.https.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/import-scripts-mime-types.https-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/import-scripts-mime-types.https.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/import-scripts-updated-flag.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/import-scripts-updated-flag.https.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/installing.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/installing.https.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/interfaces-sw.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/interfaces-window.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/interfaces-window.https.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/invalid-blobtype.https.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/invalid-header.https.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/iso-latin1-header.https.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/local-url-inherit-controller.https-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/local-url-inherit-controller.https.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/multi-globals/current/w3c-import.log
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/multi-globals/incumbent/w3c-import.log
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/multi-globals/relevant/w3c-import.log
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/multi-globals/w3c-import.log
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/multipart-image.https-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/multipart-image.https.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/navigate-window.https.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/navigation-preload/broken-chunked-encoding.https.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/navigation-preload/navigationPreload.https.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/navigation-preload/resource-timing.https.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/navigation-preload/resources/broken-chunked-encoding-worker.js
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/navigation-preload/resources/chunked-encoding-scope.py
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/navigation-preload/resources/empty-preload-response-body-scope.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/navigation-preload/resources/resource-timing-worker.js
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/navigation-preload/resources/w3c-import.log
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/navigation-preload/w3c-import.log
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/navigation-redirect.https.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/navigation-timing.https-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/navigation-timing.https.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/onactivate-script-error.https.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/postmessage-from-waiting-serviceworker.https.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/postmessage-to-client-message-queue.https-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/postmessage-to-client-message-queue.https.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/postmessage-to-client.https.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/postmessage.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/postmessage.https.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/redirected-response.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/redirected-response.https.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/referer.https.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/referrer-policy-header.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/referrer-policy-header.https.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/registration-events.https.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/registration-iframe.https.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/registration-mime-types.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/registration-scope.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/registration-script-url.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/registration-security-error.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/registration-service-worker-attributes.https.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/registration-updateviacache.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/registration-updateviacache.https.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resource-timing-cross-origin.https-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resource-timing-cross-origin.https.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resource-timing.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resource-timing.https.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/about-blank-replacement-blank-dynamic-nested-frame.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/about-blank-replacement-blank-nested-frame.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/about-blank-replacement-ping-frame.py
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/about-blank-replacement-popup-frame.py
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/about-blank-replacement-srcdoc-nested-frame.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/claim-nested-worker-fetch-iframe.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/claim-nested-worker-fetch-parent-worker.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/classic-worker.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/client-navigate-worker.js
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/clients-get-cross-origin-frame.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/clients-get-resultingClientId-worker.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/clients-get-worker.js
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/cors-approved.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/cors-approved.txt.headers [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/cors-denied.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/dummy-shared-worker-interceptor.js
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/dummy-shared-worker-interceptor.js.headers [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/echo-content.py [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/embed-and-object-are-not-intercepted-worker.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/embed-image-is-not-intercepted-iframe.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/embed-is-not-intercepted-iframe.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/embedded-content-from-server.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/embedded-content-from-service-worker.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/enable-client-message-queue.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-access-control.py
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-canvas-tainting-double-write-worker.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-canvas-tainting-iframe.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-canvas-tainting-tests.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-cors-exposed-header-names-worker.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-event-network-fallback-worker.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-event-respond-with-custom-response-worker.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-event-respond-with-readable-stream-iframe.html [deleted file]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-event-respond-with-readable-stream-worker.js
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-event-test-worker.js
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-request-css-cross-origin-mime-check-iframe.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-request-css-cross-origin-mime-check-worker.js [deleted file]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-request-css-cross-origin-read-contents.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-request-css-cross-origin-worker.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-request-no-freshness-headers-iframe.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-request-no-freshness-headers-script.py [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-request-redirect-iframe.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-request-xhr-iframe.https.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-request-xhr-sync-on-worker-worker.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-request-xhr-worker.js
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-rewrite-worker.js
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/http-to-https-redirect-and-register-iframe.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/iframe-with-image.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/import-scripts-mime-types-worker.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/import-scripts-updated-flag-worker.js
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/imported-classic-script.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/imported-module-script.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/install-worker.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/interfaces-idls.js [deleted file]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/interfaces-worker.sub.js
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/local-url-inherit-controller-frame.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/local-url-inherit-controller-worker.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/malformed-http-response.asis [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/message-vs-microtask.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/module-worker.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/multipart-image-iframe.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/multipart-image-worker.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/multipart-image.py [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/navigation-redirect-other-origin.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/navigation-redirect-out-scope.py
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/navigation-redirect-scope1.py
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/navigation-redirect-scope2.py
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/navigation-timing-worker.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/nested-iframe-parent.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/nested_load_worker.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/object-image-is-not-intercepted-iframe.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/object-is-not-intercepted-iframe.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/pass-through-worker.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/pass.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/performance-timeline-worker.js
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/postmessage-dictionary-transferables-worker.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/range-request-to-different-origins-worker.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/range-request-with-different-cors-modes-worker.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/redirect-worker.js
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/registration-tests-mime-types.js
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/registration-tests-scope.js
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/registration-tests-script-url.js
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/registration-tests-security-error.js
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/resource-timing-iframe.sub.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/resource-timing-worker.js
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/sandboxed-iframe-fetch-event-iframe.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/sandboxed-iframe-fetch-event-iframe.py [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/sandboxed-iframe-fetch-event-worker.js
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/scope1/redirect.py [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/scope1/w3c-import.log [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/scope2/w3c-import.log [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/scope2/worker_interception_redirect_webworker.py [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/service-worker-header.py [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/service-worker-interception-dynamic-import-worker.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/service-worker-interception-network-worker.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/service-worker-interception-service-worker.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/service-worker-interception-static-import-worker.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/simple-intercept-worker.js.headers [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/skip-waiting-installed-worker.js
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/square.png.sub.headers [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/stalling-service-worker.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/test-helpers.sub.js
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/update-during-installation-worker.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/update-missing-import-scripts-imported-worker.py [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/update-missing-import-scripts-main-worker.py [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/update-registration-with-type.py [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/update/w3c-import.log
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/update_shell.py [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/vtt-frame.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/w3c-import.log
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/worker-client-id-worker.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/worker-fetching-cross-origin.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/worker-interception-iframe.https.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/worker-interception-redirect-serviceworker.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/worker-interception-redirect-webworker.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/worker-testharness.js
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/worker_interception_redirect_webworker.py [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/sandboxed-iframe-fetch-event.https.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/service-worker-header.https-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/service-worker-header.https.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/serviceworkerobject-scripturl.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/serviceworkerobject-scripturl.https.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/skip-waiting-using-registration.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/skip-waiting-using-registration.https.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/skip-waiting-without-using-registration.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/skip-waiting-without-using-registration.https.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/state.https.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/synced-state.https.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/uncontrolled-page.https.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/unregister-then-register-new-script.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/unregister-then-register-new-script.https.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/unregister-then-register.https.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/update-after-navigation-fetch-event.https.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/update-after-navigation-redirect.https-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/update-after-navigation-redirect.https.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/update-missing-import-scripts.https-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/update-missing-import-scripts.https.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/update-not-allowed.https-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/update-not-allowed.https.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/update-recovery.https.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/update-registration-with-type.https-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/update-registration-with-type.https.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/update-result.https-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/update-result.https.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/w3c-import.log
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/waiting.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/waiting.https.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/websocket.https.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/webvtt-cross-origin.https-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/webvtt-cross-origin.https.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/windowclient-navigate.https.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/worker-client-id.https-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/worker-client-id.https.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/worker-in-sandboxed-iframe-by-csp-fetch-event.https-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/worker-in-sandboxed-iframe-by-csp-fetch-event.https.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/worker-interception-redirect.https-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/worker-interception-redirect.https.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/worker-interception.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/worker-interception.https.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/tools/blink-import.py
LayoutTests/imported/w3c/web-platform-tests/service-workers/tools/w3c-import.log
LayoutTests/imported/w3c/web-platform-tests/service-workers/w3c-import.log
LayoutTests/platform/ios-simulator/TestExpectations
LayoutTests/platform/mac/TestExpectations
LayoutTests/tests-options.json

index c6935e5..0376665 100644 (file)
@@ -1,3 +1,13 @@
+2018-11-27  Chris Dumez  <cdumez@apple.com>
+
+        Resync service-workers web platform tests from upstream
+        https://bugs.webkit.org/show_bug.cgi?id=192035
+
+        Reviewed by Youenn Fablet.
+
+        * TestExpectations:
+        * tests-options.json:
+
 2018-11-27  Simon Fraser  <simon.fraser@apple.com>
 
         Momentum scrolling ends at the wrong place when a scrolling overflow element has a non-zero border
index 826cfe4..3b8ba3f 100644 (file)
@@ -180,6 +180,31 @@ imported/w3c/web-platform-tests/secure-contexts/shared-worker-secure-first.https
 # Per specification, if the scripts are identical, we do not install the new script and return the existing registration.
 imported/w3c/web-platform-tests/service-workers/service-worker/import-scripts-redirect.https.html [ Skip ]
 
+# Newly imported service worker tests that are timing out.
+imported/w3c/web-platform-tests/service-workers/cache-storage/serviceworker/cache-abort.https.html [ Skip ]
+imported/w3c/web-platform-tests/service-workers/cache-storage/window/cache-abort.https.html [ Skip ]
+imported/w3c/web-platform-tests/service-workers/cache-storage/worker/cache-abort.https.html [ Skip ]
+imported/w3c/web-platform-tests/service-workers/service-worker/dedicated-worker-service-worker-interception.https.html [ Skip ]
+imported/w3c/web-platform-tests/service-workers/service-worker/embed-and-object-are-not-intercepted.https.html [ Skip ]
+imported/w3c/web-platform-tests/service-workers/service-worker/fetch-canvas-tainting-image-cache.https.html [ Skip ]
+imported/w3c/web-platform-tests/service-workers/service-worker/fetch-canvas-tainting-video-cache.https.html [ Skip ]
+imported/w3c/web-platform-tests/service-workers/service-worker/fetch-canvas-tainting-video-with-range-request.https.html [ Skip ]
+imported/w3c/web-platform-tests/service-workers/service-worker/fetch-canvas-tainting-video.https.html [ Skip ]
+imported/w3c/web-platform-tests/service-workers/service-worker/fetch-mixed-content-to-inscope.https.html [ Skip ]
+imported/w3c/web-platform-tests/service-workers/service-worker/fetch-mixed-content-to-outscope.https.html [ Skip ]
+imported/w3c/web-platform-tests/service-workers/service-worker/multipart-image.https.html [ Skip ]
+imported/w3c/web-platform-tests/service-workers/service-worker/postmessage-to-client-message-queue.https.html [ Skip ]
+imported/w3c/web-platform-tests/service-workers/service-worker/skip-waiting-using-registration.https.html [ Skip ]
+imported/w3c/web-platform-tests/service-workers/service-worker/skip-waiting-without-using-registration.https.html [ Skip ]
+imported/w3c/web-platform-tests/service-workers/service-worker/update-after-navigation-fetch-event.https.html [ Skip ]
+imported/w3c/web-platform-tests/service-workers/service-worker/update-not-allowed.https.html [ Skip ]
+imported/w3c/web-platform-tests/service-workers/service-worker/worker-in-sandboxed-iframe-by-csp-fetch-event.https.html [ Skip ]
+
+# Newly imported service worker tests that are flaky.
+imported/w3c/web-platform-tests/service-workers/service-worker/navigation-redirect-to-http.https.html [ Pass Failure ]
+imported/w3c/web-platform-tests/service-workers/service-worker/resource-timing.https.html [ Pass Failure ]
+imported/w3c/web-platform-tests/service-workers/service-worker/worker-client-id.https.html [ Pass Failure ]
+
 # This test is timing out because it relies on http://www1.localhost:8800 host for cross origin checks.
 imported/w3c/web-platform-tests/cors/remote-origin.htm [ Skip ]
 
@@ -239,8 +264,6 @@ imported/w3c/web-platform-tests/fetch/api/redirect/redirect-mode-worker.html [ D
 imported/w3c/web-platform-tests/fetch/api/redirect/redirect-to-dataurl.html [ DumpJSConsoleLogInStdErr ]
 
 webkit.org/b/181901 imported/w3c/web-platform-tests/service-workers/service-worker/fetch-cors-xhr.https.html [ DumpJSConsoleLogInStdErr ]
-webkit.org/b/181897 imported/w3c/web-platform-tests/service-workers/service-worker/fetch-canvas-tainting.https.html [ DumpJSConsoleLogInStdErr ]
-webkit.org/b/181900 imported/w3c/web-platform-tests/service-workers/service-worker/fetch-canvas-tainting-cache.https.html [ DumpJSConsoleLogInStdErr ]
 imported/w3c/web-platform-tests/service-workers/service-worker/fetch-response-taint.https.html [ DumpJSConsoleLogInStdErr ]
 imported/w3c/web-platform-tests/service-workers/service-worker/register-closed-window.https.html [ DumpJSConsoleLogInStdErr ]
 imported/w3c/web-platform-tests/service-workers/service-worker/registration-security-error.https.html [ DumpJSConsoleLogInStdErr ]
index 5205959..7d8baf8 100644 (file)
@@ -1,3 +1,14 @@
+2018-11-27  Chris Dumez  <cdumez@apple.com>
+
+        Resync service-workers web platform tests from upstream
+        https://bugs.webkit.org/show_bug.cgi?id=192035
+
+        Reviewed by Youenn Fablet.
+
+        Resync service-workers web platform tests from upstream 73507a79fc.
+
+        * web-platform-tests/: Updated.
+
 2018-11-27  Javier Fernandez  <jfernandez@igalia.com>
 
         [css-grid] align-self center and position sticky don't work together
index ec40b55..cd39a72 100644 (file)
     "web-platform-tests/selectors": "skip", 
     "web-platform-tests/selectors-api": "skip", 
     "web-platform-tests/server-timing": "import", 
-    "web-platform-tests/service-workers/cache-storage": "import", 
-    "web-platform-tests/service-workers/service-worker": "import", 
-    "web-platform-tests/service-workers/tools": "import", 
+    "web-platform-tests/service-workers": "import", 
     "web-platform-tests/shadow-dom": "import", 
     "web-platform-tests/shadow-dom/untriaged": "skip", 
     "web-platform-tests/speech-api": "skip", 
diff --git a/LayoutTests/imported/w3c/web-platform-tests/interfaces/service-workers.idl b/LayoutTests/imported/w3c/web-platform-tests/interfaces/service-workers.idl
new file mode 100644 (file)
index 0000000..fb2e033
--- /dev/null
@@ -0,0 +1,212 @@
+// GENERATED CONTENT - DO NOT EDIT
+// Content was automatically extracted by Reffy into reffy-reports
+// (https://github.com/tidoust/reffy-reports)
+// Source: Service Workers 1 (https://w3c.github.io/ServiceWorker/v1/)
+
+[SecureContext, Exposed=(Window,Worker)]
+interface ServiceWorker : EventTarget {
+  readonly attribute USVString scriptURL;
+  readonly attribute ServiceWorkerState state;
+  void postMessage(any message, optional sequence<object> transfer = []);
+
+  // event
+  attribute EventHandler onstatechange;
+};
+ServiceWorker includes AbstractWorker;
+
+enum ServiceWorkerState {
+  "installing",
+  "installed",
+  "activating",
+  "activated",
+  "redundant"
+};
+
+[SecureContext, Exposed=(Window,Worker)]
+interface ServiceWorkerRegistration : EventTarget {
+  readonly attribute ServiceWorker? installing;
+  readonly attribute ServiceWorker? waiting;
+  readonly attribute ServiceWorker? active;
+
+  readonly attribute USVString scope;
+  readonly attribute ServiceWorkerUpdateViaCache updateViaCache;
+
+  [NewObject] Promise<void> update();
+  [NewObject] Promise<boolean> unregister();
+
+  // event
+  attribute EventHandler onupdatefound;
+};
+
+enum ServiceWorkerUpdateViaCache {
+  "imports",
+  "all",
+  "none"
+};
+
+partial interface Navigator {
+  [SecureContext, SameObject] readonly attribute ServiceWorkerContainer serviceWorker;
+};
+
+partial interface WorkerNavigator {
+  [SecureContext, SameObject] readonly attribute ServiceWorkerContainer serviceWorker;
+};
+
+[SecureContext, Exposed=(Window,Worker)]
+interface ServiceWorkerContainer : EventTarget {
+  readonly attribute ServiceWorker? controller;
+  readonly attribute Promise<ServiceWorkerRegistration> ready;
+
+  [NewObject] Promise<ServiceWorkerRegistration> register(USVString scriptURL, optional RegistrationOptions options);
+
+  [NewObject] Promise<any> getRegistration(optional USVString clientURL = "");
+  [NewObject] Promise<FrozenArray<ServiceWorkerRegistration>> getRegistrations();
+
+  void startMessages();
+
+  // events
+  attribute EventHandler oncontrollerchange;
+  attribute EventHandler onmessage; // event.source of message events is ServiceWorker object
+  attribute EventHandler onmessageerror;
+};
+
+dictionary RegistrationOptions {
+  USVString scope;
+  WorkerType type = "classic";
+  ServiceWorkerUpdateViaCache updateViaCache = "imports";
+};
+
+[Global=(Worker,ServiceWorker), Exposed=ServiceWorker]
+interface ServiceWorkerGlobalScope : WorkerGlobalScope {
+  [SameObject] readonly attribute Clients clients;
+  [SameObject] readonly attribute ServiceWorkerRegistration registration;
+
+  [NewObject] Promise<void> skipWaiting();
+
+  attribute EventHandler oninstall;
+  attribute EventHandler onactivate;
+  attribute EventHandler onfetch;
+
+  // event
+  attribute EventHandler onmessage; // event.source of the message events is Client object
+  attribute EventHandler onmessageerror;
+};
+
+[Exposed=ServiceWorker]
+interface Client {
+  readonly attribute USVString url;
+  readonly attribute FrameType frameType;
+  readonly attribute DOMString id;
+  readonly attribute ClientType type;
+  void postMessage(any message, optional sequence<object> transfer = []);
+};
+
+[Exposed=ServiceWorker]
+interface WindowClient : Client {
+  readonly attribute VisibilityState visibilityState;
+  readonly attribute boolean focused;
+  [SameObject] readonly attribute FrozenArray<USVString> ancestorOrigins;
+  [NewObject] Promise<WindowClient> focus();
+  [NewObject] Promise<WindowClient?> navigate(USVString url);
+};
+
+enum FrameType {
+  "auxiliary",
+  "top-level",
+  "nested",
+  "none"
+};
+
+[Exposed=ServiceWorker]
+interface Clients {
+  // The objects returned will be new instances every time
+  [NewObject] Promise<any> get(DOMString id);
+  [NewObject] Promise<FrozenArray<Client>> matchAll(optional ClientQueryOptions options);
+  [NewObject] Promise<WindowClient?> openWindow(USVString url);
+  [NewObject] Promise<void> claim();
+};
+
+dictionary ClientQueryOptions {
+  boolean includeUncontrolled = false;
+  ClientType type = "window";
+};
+
+enum ClientType {
+  "window",
+  "worker",
+  "sharedworker",
+  "all"
+};
+
+[Constructor(DOMString type, optional ExtendableEventInit eventInitDict), Exposed=ServiceWorker]
+interface ExtendableEvent : Event {
+  void waitUntil(Promise<any> f);
+};
+
+dictionary ExtendableEventInit : EventInit {
+  // Defined for the forward compatibility across the derived events
+};
+
+[Constructor(DOMString type, FetchEventInit eventInitDict), Exposed=ServiceWorker]
+interface FetchEvent : ExtendableEvent {
+  [SameObject] readonly attribute Request request;
+  readonly attribute DOMString clientId;
+
+  void respondWith(Promise<Response> r);
+};
+
+dictionary FetchEventInit : ExtendableEventInit {
+  required Request request;
+  DOMString clientId = "";
+};
+
+[Constructor(DOMString type, optional ExtendableMessageEventInit eventInitDict), Exposed=ServiceWorker]
+interface ExtendableMessageEvent : ExtendableEvent {
+  readonly attribute any data;
+  readonly attribute USVString origin;
+  readonly attribute DOMString lastEventId;
+  [SameObject] readonly attribute (Client or ServiceWorker or MessagePort)? source;
+  readonly attribute FrozenArray<MessagePort> ports;
+};
+
+dictionary ExtendableMessageEventInit : ExtendableEventInit {
+  any data = null;
+  USVString origin = "";
+  DOMString lastEventId = "";
+  (Client or ServiceWorker or MessagePort)? source = null;
+  sequence<MessagePort> ports = [];
+};
+
+partial interface WindowOrWorkerGlobalScope {
+  [SecureContext, SameObject] readonly attribute CacheStorage caches;
+};
+
+[SecureContext, Exposed=(Window,Worker)]
+interface Cache {
+  [NewObject] Promise<any> match(RequestInfo request, optional CacheQueryOptions options);
+  [NewObject] Promise<FrozenArray<Response>> matchAll(optional RequestInfo request, optional CacheQueryOptions options);
+  [NewObject] Promise<void> add(RequestInfo request);
+  [NewObject] Promise<void> addAll(sequence<RequestInfo> requests);
+  [NewObject] Promise<void> put(RequestInfo request, Response response);
+  [NewObject] Promise<boolean> delete(RequestInfo request, optional CacheQueryOptions options);
+  [NewObject] Promise<FrozenArray<Request>> keys(optional RequestInfo request, optional CacheQueryOptions options);
+};
+
+dictionary CacheQueryOptions {
+  boolean ignoreSearch = false;
+  boolean ignoreMethod = false;
+  boolean ignoreVary = false;
+};
+
+[SecureContext, Exposed=(Window,Worker)]
+interface CacheStorage {
+  [NewObject] Promise<any> match(RequestInfo request, optional MultiCacheQueryOptions options);
+  [NewObject] Promise<boolean> has(DOMString cacheName);
+  [NewObject] Promise<Cache> open(DOMString cacheName);
+  [NewObject] Promise<boolean> delete(DOMString cacheName);
+  [NewObject] Promise<sequence<DOMString>> keys();
+};
+
+dictionary MultiCacheQueryOptions : CacheQueryOptions {
+  DOMString cacheName;
+};
diff --git a/LayoutTests/imported/w3c/web-platform-tests/service-workers/META.yml b/LayoutTests/imported/w3c/web-platform-tests/service-workers/META.yml
new file mode 100644 (file)
index 0000000..03a0dd0
--- /dev/null
@@ -0,0 +1,6 @@
+spec: https://w3c.github.io/ServiceWorker/
+suggested_reviewers:
+  - asutherland
+  - mkruisselbrink
+  - mattto
+  - wanderview
diff --git a/LayoutTests/imported/w3c/web-platform-tests/service-workers/OWNERS b/LayoutTests/imported/w3c/web-platform-tests/service-workers/OWNERS
deleted file mode 100644 (file)
index f429364..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-@ehsan
-@mkruisselbrink
-@mattto
diff --git a/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/META.yml b/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/META.yml
new file mode 100644 (file)
index 0000000..bf34474
--- /dev/null
@@ -0,0 +1,3 @@
+suggested_reviewers:
+  - inexorabletash
+  - wanderview
diff --git a/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/OWNERS b/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/OWNERS
deleted file mode 100644 (file)
index 2e63dd2..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-@inexorabletash
-@wanderview
diff --git a/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/resources/cache-keys-attributes-for-service-worker.js b/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/resources/cache-keys-attributes-for-service-worker.js
new file mode 100644 (file)
index 0000000..ee574d2
--- /dev/null
@@ -0,0 +1,22 @@
+self.addEventListener('fetch', (event) => {
+    const params = new URL(event.request.url).searchParams;
+    if (params.has('ignore')) {
+      return;
+    }
+    if (!params.has('name')) {
+      event.respondWith(Promise.reject(TypeError('No name is provided.')));
+      return;
+    }
+
+    event.respondWith(Promise.resolve().then(async () => {
+        const name = params.get('name');
+        await caches.delete('foo');
+        const cache = await caches.open('foo');
+        await cache.put(event.request, new Response('hello'));
+        const keys = await cache.keys();
+
+        const original = event.request[name];
+        const stored = keys[0][name];
+        return new Response(`original: ${original}, stored: ${stored}`);
+      }));
+  });
diff --git a/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/resources/vary.py b/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/resources/vary.py
new file mode 100644 (file)
index 0000000..59e39bc
--- /dev/null
@@ -0,0 +1,25 @@
+def main(request, response):
+  if "clear-vary-value-override-cookie" in request.GET:
+    response.unset_cookie("vary-value-override")
+    return "vary cookie cleared"
+
+  set_cookie_vary = request.GET.first("set-vary-value-override-cookie",
+                                      default="")
+  if set_cookie_vary:
+    response.set_cookie("vary-value-override", set_cookie_vary)
+    return "vary cookie set"
+
+  # If there is a vary-value-override cookie set, then use its value
+  # for the VARY header no matter what the query string is set to.  This
+  # override is necessary to test the case when two URLs are identical
+  # (including query), but differ by VARY header.
+  cookie_vary = request.cookies.get("vary-value-override");
+  if cookie_vary:
+    response.headers.set("vary", cookie_vary)
+  else:
+    # If there is no cookie, then use the query string value, if present.
+    query_vary = request.GET.first("vary", default="")
+    if query_vary:
+      response.headers.set("vary", query_vary)
+
+  return "vary response"
index d46bdf5..3971497 100644 (file)
@@ -1,7 +1,7 @@
 The tests in this directory were imported from the W3C repository.
 Do NOT modify these tests directly in WebKit.
 Instead, create a pull request on the WPT github:
-       https://github.com/w3c/web-platform-tests
+       https://github.com/web-platform-tests/wpt
 
 Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport
 
@@ -15,6 +15,7 @@ None
 ------------------------------------------------------------------------
 List of files:
 /LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/resources/blank.html
+/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/resources/cache-keys-attributes-for-service-worker.js
 /LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/resources/common-worker.js
 /LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/resources/credentials-iframe.html
 /LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/resources/credentials-worker.js
@@ -22,3 +23,4 @@ List of files:
 /LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/resources/iframe.html
 /LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/resources/simple.txt
 /LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/resources/test-helpers.js
+/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/resources/vary.py
diff --git a/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/script-tests/cache-abort.js b/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/script-tests/cache-abort.js
new file mode 100644 (file)
index 0000000..ec4130f
--- /dev/null
@@ -0,0 +1,81 @@
+if (self.importScripts) {
+  importScripts('/resources/testharness.js');
+  importScripts('../resources/test-helpers.js');
+  importScripts('/common/utils.js');
+}
+
+// We perform the same tests on put, add, addAll. Parameterise the tests to
+// reduce repetition.
+const methodsToTest = {
+  put: async (cache, request) => {
+    const response = await fetch(request);
+    return cache.put(request, response);
+  },
+  add: async (cache, request) => cache.add(request),
+  addAll: async (cache, request) => cache.addAll([request]),
+};
+
+for (const method in methodsToTest) {
+  const perform = methodsToTest[method];
+
+  cache_test(async (cache, test) => {
+    const controller = new AbortController();
+    const signal = controller.signal;
+    controller.abort();
+    const request = new Request('../resources/simple.txt', { signal });
+    return promise_rejects(test, 'AbortError', perform(cache, request),
+                          `${method} should reject`);
+  }, `${method}() on an already-aborted request should reject with AbortError`);
+
+  cache_test(async (cache, test) => {
+    const controller = new AbortController();
+    const signal = controller.signal;
+    const request = new Request('../resources/simple.txt', { signal });
+    const promise = perform(cache, request);
+    controller.abort();
+    return promise_rejects(test, 'AbortError', promise,
+                          `${method} should reject`);
+  }, `${method}() synchronously followed by abort should reject with ` +
+     `AbortError`);
+
+  cache_test(async (cache, test) => {
+    const controller = new AbortController();
+    const signal = controller.signal;
+    const stateKey = token();
+    const abortKey = token();
+    const request = new Request(
+        `../../../fetch/api/resources/infinite-slow-response.py?stateKey=${stateKey}&abortKey=${abortKey}`,
+        { signal });
+
+    const promise = perform(cache, request);
+
+    // Wait for the server to start sending the response body.
+    let opened = false;
+    do {
+      // Normally only one fetch to 'stash-take' is needed, but the fetches
+      // will be served in reverse order sometimes
+      // (i.e., 'stash-take' gets served before 'infinite-slow-response').
+
+      const response =
+            await fetch(`../../../fetch/api/resources/stash-take.py?key=${stateKey}`);
+      const body = await response.json();
+      if (body === 'open') opened = true;
+    } while (!opened);
+
+    // Sadly the above loop cannot guarantee that the browser has started
+    // processing the response body. This delay is needed to make the test
+    // failures non-flaky in Chrome version 66. My deepest apologies.
+    await new Promise(resolve => setTimeout(resolve, 250));
+
+    controller.abort();
+
+    await promise_rejects(test, 'AbortError', promise,
+                          `${method} should reject`);
+
+    // infinite-slow-response.py doesn't know when to stop.
+    return fetch(`../../../fetch/api/resources/stash-put.py?key=${abortKey}`);
+  }, `${method}() followed by abort after headers received should reject ` +
+     `with AbortError`);
+}
+
+done();
index c03faeb..a482c42 100644 (file)
@@ -267,4 +267,84 @@ cache_test(function(cache, test) {
       'twice.');
   }, 'Cache.addAll called with the same Request object specified twice');
 
+cache_test(async function(cache, test) {
+    const url = '../resources/vary.py?vary=x-shape';
+    let requests = [
+      new Request(url, { headers: { 'x-shape': 'circle' }}),
+      new Request(url, { headers: { 'x-shape': 'square' }}),
+    ];
+    let result = await cache.addAll(requests);
+    assert_equals(result, undefined, 'Cache.addAll() should succeed');
+  }, 'Cache.addAll should succeed when entries differ by vary header');
+
+cache_test(async function(cache, test) {
+    const url = '../resources/vary.py?vary=x-shape';
+    let requests = [
+      new Request(url, { headers: { 'x-shape': 'circle' }}),
+      new Request(url, { headers: { 'x-shape': 'circle' }}),
+    ];
+    await promise_rejects(
+      test,
+      'InvalidStateError',
+      cache.addAll(requests),
+      'Cache.addAll() should reject when entries are duplicate by vary header');
+  }, 'Cache.addAll should reject when entries are duplicate by vary header');
+
+// VARY header matching is asymmetric.  Determining if two entries are duplicate
+// depends on which entry's response is used in the comparison.  The target
+// response's VARY header determines what request headers are examined.  This
+// test verifies that Cache.addAll() duplicate checking handles this asymmetric
+// behavior correctly.
+cache_test(async function(cache, test) {
+    const base_url = '../resources/vary.py';
+
+    // Define a request URL that sets a VARY header in the
+    // query string to be echoed back by the server.
+    const url = base_url + '?vary=x-size';
+
+    // Set a cookie to override the VARY header of the response
+    // when the request is made with credentials.  This will
+    // take precedence over the query string vary param.  This
+    // is a bit confusing, but it's necessary to construct a test
+    // where the URL is the same, but the VARY headers differ.
+    //
+    // Note, the test could also pass this information in additional
+    // request headers.  If the cookie approach becomes too unwieldy
+    // this test could be rewritten to use that technique.
+    await fetch(base_url + '?set-vary-value-override-cookie=x-shape');
+    test.add_cleanup(_ => fetch(base_url + '?clear-vary-value-override-cookie'));
+
+    let requests = [
+      // This request will result in a Response with a "Vary: x-shape"
+      // header.  This *will not* result in a duplicate match with the
+      // other entry.
+      new Request(url, { headers: { 'x-shape': 'circle',
+                                    'x-size': 'big' },
+                         credentials: 'same-origin' }),
+
+      // This request will result in a Response with a "Vary: x-size"
+      // header.  This *will* result in a duplicate match with the other
+      // entry.
+      new Request(url, { headers: { 'x-shape': 'square',
+                                    'x-size': 'big' },
+                         credentials: 'omit' }),
+    ];
+    await promise_rejects(
+      test,
+      'InvalidStateError',
+      cache.addAll(requests),
+      'Cache.addAll() should reject when one entry has a vary header ' +
+      'matching an earlier entry.');
+
+    // Test the reverse order now.
+    await promise_rejects(
+      test,
+      'InvalidStateError',
+      cache.addAll(requests.reverse()),
+      'Cache.addAll() should reject when one entry has a vary header ' +
+      'matching a later entry.');
+
+  }, 'Cache.addAll should reject when one entry has a vary header ' +
+     'matching another entry');
+
 done();
index 96bd43b..a94c18f 100644 (file)
@@ -179,6 +179,20 @@ prepopulated_cache_test(simple_entries, function(cache, entries) {
         });
   }, 'Cache.keys without parameters');
 
+prepopulated_cache_test(vary_entries, function(cache, entries) {
+    return cache.keys()
+      .then(function(result) {
+          assert_request_array_equals(
+            result,
+            [
+              entries.vary_cookie_is_cookie.request,
+              entries.vary_cookie_is_good.request,
+              entries.vary_cookie_absent.request,
+            ],
+            'Cache.keys without parameters should match all entries.');
+        });
+  }, 'Cache.keys without parameters and VARY entries');
+
 prepopulated_cache_test(simple_entries, function(cache, entries) {
     return cache.keys(new Request(entries.cat.request.url, {method: 'HEAD'}))
       .then(function(result) {
index 3d00f0f..ba359fe 100644 (file)
@@ -1,6 +1,7 @@
 if (self.importScripts) {
     importScripts('/resources/testharness.js');
     importScripts('../resources/test-helpers.js');
+    importScripts('/common/get-host-info.sub.js');
 }
 
 prepopulated_cache_test(simple_entries, function(cache, entries) {
@@ -318,4 +319,22 @@ cache_test(function(cache) {
         });
   }, 'Cache produces large Responses that can be cloned and read correctly.');
 
+cache_test(async (cache) => {
+    const url = get_host_info().HTTPS_REMOTE_ORIGIN +
+      '/service-workers/cache-storage/resources/simple.txt?pipe=' +
+      'header(access-control-allow-origin,*)|' +
+      'header(access-control-expose-headers,*)|' +
+      'header(foo,bar)|' +
+      'header(set-cookie,X)';
+
+    const response = await fetch(url);
+    await cache.put(new Request(url), response);
+    const cached_response = await cache.match(url);
+
+    const headers = cached_response.headers;
+    assert_equals(headers.get('access-control-expose-headers'), '*');
+    assert_equals(headers.get('foo'), 'bar');
+    assert_equals(headers.get('set-cookie'), null);
+  }, 'cors-exposed header should be stored correctly.');
+
 done();
index 3546520..54be7e7 100644 (file)
@@ -117,7 +117,10 @@ promise_test(function(test) {
 
 promise_test(function(test) {
     var transaction = create_unique_transaction();
-    return self.caches.has('foo')
+    return self.caches.delete('foo')
+      .then(function() {
+          return self.caches.has('foo');
+        })
       .then(function(has_foo) {
           assert_false(has_foo, "The cache should not exist.");
           return self.caches.match(transaction.request, {cacheName: 'foo'});
index 6d5781a..8e9895f 100644 (file)
@@ -1,7 +1,7 @@
 The tests in this directory were imported from the W3C repository.
 Do NOT modify these tests directly in WebKit.
 Instead, create a pull request on the WPT github:
-       https://github.com/w3c/web-platform-tests
+       https://github.com/web-platform-tests/wpt
 
 Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport
 
@@ -14,6 +14,7 @@ Property values requiring vendor prefixes:
 None
 ------------------------------------------------------------------------
 List of files:
+/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/script-tests/cache-abort.js
 /LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/script-tests/cache-add.js
 /LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/script-tests/cache-delete.js
 /LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/script-tests/cache-keys.js
diff --git a/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/serviceworker/cache-abort.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/serviceworker/cache-abort.https-expected.txt
new file mode 100644 (file)
index 0000000..bbdcc46
--- /dev/null
@@ -0,0 +1,14 @@
+
+Harness Error (TIMEOUT), message = null
+
+PASS Cache Storage: Abort 
+FAIL put() on an already-aborted request should reject with AbortError assert_unreached: Should have rejected: put should reject Reached unreachable code
+FAIL put() synchronously followed by abort should reject with AbortError assert_unreached: Should have rejected: put should reject Reached unreachable code
+TIMEOUT put() followed by abort after headers received should reject with AbortError Test timed out
+NOTRUN add() on an already-aborted request should reject with AbortError 
+NOTRUN add() synchronously followed by abort should reject with AbortError 
+NOTRUN add() followed by abort after headers received should reject with AbortError 
+NOTRUN addAll() on an already-aborted request should reject with AbortError 
+NOTRUN addAll() synchronously followed by abort should reject with AbortError 
+NOTRUN addAll() followed by abort after headers received should reject with AbortError 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/serviceworker/cache-abort.https.html b/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/serviceworker/cache-abort.https.html
new file mode 100644 (file)
index 0000000..5a8b539
--- /dev/null
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<title>Cache Storage: Abort</title>
+<link rel="help" href="https://fetch.spec.whatwg.org/#request-signal">
+<meta name="timeout" content="long">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="../../service-worker/resources/test-helpers.sub.js"></script>
+<script>
+service_worker_test('../script-tests/cache-abort.js');
+</script>
index 05fd95b..98e5795 100644 (file)
@@ -18,4 +18,7 @@ PASS Cache.addAll with string URL arguments
 PASS Cache.addAll with Request arguments 
 PASS Cache.addAll with a mix of succeeding and failing requests 
 PASS Cache.addAll called with the same Request object specified twice 
+PASS Cache.addAll should succeed when entries differ by vary header 
+PASS Cache.addAll should reject when entries are duplicate by vary header 
+PASS Cache.addAll should reject when one entry has a vary header matching another entry 
 
diff --git a/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/serviceworker/cache-keys-attributes-for-service-worker.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/serviceworker/cache-keys-attributes-for-service-worker.https-expected.txt
new file mode 100644 (file)
index 0000000..9931eaa
--- /dev/null
@@ -0,0 +1,4 @@
+
+FAIL Request.IsReloadNavigation should persist. assert_equals: expected "original: false, stored: false" but got "original: undefined, stored: undefined"
+FAIL Request.IsHistoryNavigation should persist. assert_equals: expected "original: false, stored: false" but got "original: undefined, stored: undefined"
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/serviceworker/cache-keys-attributes-for-service-worker.https.html b/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/serviceworker/cache-keys-attributes-for-service-worker.https.html
new file mode 100644 (file)
index 0000000..b6044c5
--- /dev/null
@@ -0,0 +1,75 @@
+<!DOCTYPE html>
+<title>Cache.keys (checking request attributes that can be set only on service workers)</title>
+<link rel="help" href="https://w3c.github.io/ServiceWorker/#cache-keys">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="../../service-worker/resources/test-helpers.sub.js"></script>
+<script>
+const worker = '../resources/cache-keys-attributes-for-service-worker.js';
+
+function wait(ms) {
+  return new Promise(resolve => step_timeout(resolve, ms));
+}
+
+promise_test(async (t) => {
+    const scope = '../resources/blank.html?name=isReloadNavigation';
+    let frame;
+    let reg;
+
+    try {
+      reg = await service_worker_unregister_and_register(t, worker, scope);
+      await wait_for_state(t, reg.installing, 'activated');
+      frame = await with_iframe(scope);
+      assert_equals(frame.contentDocument.body.textContent,
+                    'original: false, stored: false');
+      await new Promise((resolve) => {
+        frame.onload = resolve;
+        frame.contentWindow.location.reload();
+      });
+      assert_equals(frame.contentDocument.body.textContent,
+                    'original: true, stored: true');
+    } finally {
+      if (frame) {
+        frame.remove();
+      }
+      if (reg) {
+        await reg.unregister();
+      }
+    }
+}, 'Request.IsReloadNavigation should persist.');
+
+promise_test(async (t) => {
+    const scope = '../resources/blank.html?name=isHistoryNavigation';
+    let frame;
+    let reg;
+
+    try {
+      reg = await service_worker_unregister_and_register(t, worker, scope);
+      await wait_for_state(t, reg.installing, 'activated');
+      frame = await with_iframe(scope);
+      assert_equals(frame.contentDocument.body.textContent,
+                    'original: false, stored: false');
+      // Use step_timeout(0) to ensure the history entry is created for Blink
+      // and WebKit. See https://bugs.webkit.org/show_bug.cgi?id=42861.
+      await wait(0);
+      await new Promise((resolve) => {
+        frame.onload = resolve;
+        frame.src = '../resources/blank.html?ignore';
+      });
+      await wait(0);
+      await new Promise((resolve) => {
+        frame.onload = resolve;
+        frame.contentWindow.history.go(-1);
+      });
+      assert_equals(frame.contentDocument.body.textContent,
+                    'original: true, stored: true');
+    } finally {
+      if (frame) {
+        frame.remove();
+      }
+      if (reg) {
+        await reg.unregister();
+      }
+    }
+}, 'Request.IsHistoryNavigation should persist.');
+</script>
index fb93b89..c7d1916 100644 (file)
@@ -12,5 +12,6 @@ PASS Cache.keys supports ignoreVary
 PASS Cache.keys with URL containing fragment 
 PASS Cache.keys with string fragment "http" as query 
 PASS Cache.keys without parameters 
+PASS Cache.keys without parameters and VARY entries 
 PASS Cache.keys with a HEAD Request 
 
index 7195d7b..53a4a1e 100644 (file)
@@ -20,4 +20,5 @@ PASS Cache.match with POST Request
 PASS Cache.match with a non-2xx Response 
 PASS Cache.match with a network error Response 
 PASS Cache produces large Responses that can be cloned and read correctly. 
+FAIL cors-exposed header should be stored correctly. assert_equals: expected (string) "bar" but got (object) null
 
index 174703e..170fb92 100644 (file)
@@ -1,7 +1,7 @@
 The tests in this directory were imported from the W3C repository.
 Do NOT modify these tests directly in WebKit.
 Instead, create a pull request on the WPT github:
-       https://github.com/w3c/web-platform-tests
+       https://github.com/web-platform-tests/wpt
 
 Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport
 
@@ -14,8 +14,10 @@ Property values requiring vendor prefixes:
 None
 ------------------------------------------------------------------------
 List of files:
+/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/serviceworker/cache-abort.https.html
 /LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/serviceworker/cache-add.https.html
 /LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/serviceworker/cache-delete.https.html
+/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/serviceworker/cache-keys-attributes-for-service-worker.https.html
 /LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/serviceworker/cache-keys.https.html
 /LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/serviceworker/cache-match.https.html
 /LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/serviceworker/cache-matchAll.https.html
index 0824061..a53e929 100644 (file)
@@ -1,7 +1,7 @@
 The tests in this directory were imported from the W3C repository.
 Do NOT modify these tests directly in WebKit.
 Instead, create a pull request on the WPT github:
-       https://github.com/w3c/web-platform-tests
+       https://github.com/web-platform-tests/wpt
 
 Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport
 
@@ -14,5 +14,5 @@ Property values requiring vendor prefixes:
 None
 ------------------------------------------------------------------------
 List of files:
-/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/OWNERS
+/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/META.yml
 /LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/common.https.html
diff --git a/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/window/cache-abort.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/window/cache-abort.https-expected.txt
new file mode 100644 (file)
index 0000000..5e3f2de
--- /dev/null
@@ -0,0 +1,13 @@
+
+Harness Error (TIMEOUT), message = null
+
+FAIL put() on an already-aborted request should reject with AbortError assert_unreached: Should have rejected: put should reject Reached unreachable code
+FAIL put() synchronously followed by abort should reject with AbortError assert_unreached: Should have rejected: put should reject Reached unreachable code
+TIMEOUT put() followed by abort after headers received should reject with AbortError Test timed out
+NOTRUN add() on an already-aborted request should reject with AbortError 
+NOTRUN add() synchronously followed by abort should reject with AbortError 
+NOTRUN add() followed by abort after headers received should reject with AbortError 
+NOTRUN addAll() on an already-aborted request should reject with AbortError 
+NOTRUN addAll() synchronously followed by abort should reject with AbortError 
+NOTRUN addAll() followed by abort after headers received should reject with AbortError 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/window/cache-abort.https.html b/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/window/cache-abort.https.html
new file mode 100644 (file)
index 0000000..405d34d
--- /dev/null
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<title>Cache Storage: Abort</title>
+<link rel="help" href="https://fetch.spec.whatwg.org/#request-signal">
+<meta name="timeout" content="long">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="../resources/test-helpers.js"></script>
+<script src="/common/utils.js"></script>
+<script src="../script-tests/cache-abort.js"></script>
index cf74cfa..636c82f 100644 (file)
@@ -17,4 +17,7 @@ PASS Cache.addAll with string URL arguments
 PASS Cache.addAll with Request arguments 
 PASS Cache.addAll with a mix of succeeding and failing requests 
 PASS Cache.addAll called with the same Request object specified twice 
+PASS Cache.addAll should succeed when entries differ by vary header 
+PASS Cache.addAll should reject when entries are duplicate by vary header 
+PASS Cache.addAll should reject when one entry has a vary header matching another entry 
 
index 0b4164b..49a8090 100644 (file)
@@ -11,5 +11,6 @@ PASS Cache.keys supports ignoreVary
 PASS Cache.keys with URL containing fragment 
 PASS Cache.keys with string fragment "http" as query 
 PASS Cache.keys without parameters 
+PASS Cache.keys without parameters and VARY entries 
 PASS Cache.keys with a HEAD Request 
 
index 4f52e50..dff99fa 100644 (file)
@@ -19,4 +19,5 @@ PASS Cache.match with POST Request
 PASS Cache.match with a non-2xx Response 
 PASS Cache.match with a network error Response 
 PASS Cache produces large Responses that can be cloned and read correctly. 
+FAIL cors-exposed header should be stored correctly. assert_equals: expected (string) "bar" but got (object) null
 
index ffc6498..f28efad 100644 (file)
@@ -4,5 +4,6 @@
 <meta name="timeout" content="long">
 <script src="/resources/testharness.js"></script>
 <script src="/resources/testharnessreport.js"></script>
+<script src="/common/get-host-info.sub.js"></script>
 <script src="../resources/test-helpers.js"></script>
 <script src="../script-tests/cache-match.js"></script>
index a91ec6b..03a8bf8 100644 (file)
@@ -1,7 +1,7 @@
 The tests in this directory were imported from the W3C repository.
 Do NOT modify these tests directly in WebKit.
 Instead, create a pull request on the WPT github:
-       https://github.com/w3c/web-platform-tests
+       https://github.com/web-platform-tests/wpt
 
 Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport
 
@@ -14,6 +14,7 @@ Property values requiring vendor prefixes:
 None
 ------------------------------------------------------------------------
 List of files:
+/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/window/cache-abort.https.html
 /LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/window/cache-add.https.html
 /LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/window/cache-delete.https.html
 /LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/window/cache-keys.https.html
diff --git a/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/worker/cache-abort.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/worker/cache-abort.https-expected.txt
new file mode 100644 (file)
index 0000000..5e3f2de
--- /dev/null
@@ -0,0 +1,13 @@
+
+Harness Error (TIMEOUT), message = null
+
+FAIL put() on an already-aborted request should reject with AbortError assert_unreached: Should have rejected: put should reject Reached unreachable code
+FAIL put() synchronously followed by abort should reject with AbortError assert_unreached: Should have rejected: put should reject Reached unreachable code
+TIMEOUT put() followed by abort after headers received should reject with AbortError Test timed out
+NOTRUN add() on an already-aborted request should reject with AbortError 
+NOTRUN add() synchronously followed by abort should reject with AbortError 
+NOTRUN add() followed by abort after headers received should reject with AbortError 
+NOTRUN addAll() on an already-aborted request should reject with AbortError 
+NOTRUN addAll() synchronously followed by abort should reject with AbortError 
+NOTRUN addAll() followed by abort after headers received should reject with AbortError 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/worker/cache-abort.https.html b/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/worker/cache-abort.https.html
new file mode 100644 (file)
index 0000000..68bbade
--- /dev/null
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<title>>Cache Storage: Abort</title>
+<link rel="help" href="https://fetch.spec.whatwg.org/#request-signal">
+<meta name="timeout" content="long">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script>
+fetch_tests_from_worker(new Worker('../script-tests/cache-abort.js'));
+</script>
index cf74cfa..636c82f 100644 (file)
@@ -17,4 +17,7 @@ PASS Cache.addAll with string URL arguments
 PASS Cache.addAll with Request arguments 
 PASS Cache.addAll with a mix of succeeding and failing requests 
 PASS Cache.addAll called with the same Request object specified twice 
+PASS Cache.addAll should succeed when entries differ by vary header 
+PASS Cache.addAll should reject when entries are duplicate by vary header 
+PASS Cache.addAll should reject when one entry has a vary header matching another entry 
 
index 0b4164b..49a8090 100644 (file)
@@ -11,5 +11,6 @@ PASS Cache.keys supports ignoreVary
 PASS Cache.keys with URL containing fragment 
 PASS Cache.keys with string fragment "http" as query 
 PASS Cache.keys without parameters 
+PASS Cache.keys without parameters and VARY entries 
 PASS Cache.keys with a HEAD Request 
 
index 4f52e50..dff99fa 100644 (file)
@@ -19,4 +19,5 @@ PASS Cache.match with POST Request
 PASS Cache.match with a non-2xx Response 
 PASS Cache.match with a network error Response 
 PASS Cache produces large Responses that can be cloned and read correctly. 
+FAIL cors-exposed header should be stored correctly. assert_equals: expected (string) "bar" but got (object) null
 
index cb55ffd..bcd63e3 100644 (file)
@@ -1,7 +1,7 @@
 The tests in this directory were imported from the W3C repository.
 Do NOT modify these tests directly in WebKit.
 Instead, create a pull request on the WPT github:
-       https://github.com/w3c/web-platform-tests
+       https://github.com/web-platform-tests/wpt
 
 Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport
 
@@ -14,6 +14,7 @@ Property values requiring vendor prefixes:
 None
 ------------------------------------------------------------------------
 List of files:
+/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/worker/cache-abort.https.html
 /LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/worker/cache-add.https.html
 /LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/worker/cache-delete.https.html
 /LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/worker/cache-keys.https.html
diff --git a/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/Service-Worker-Allowed-header.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/Service-Worker-Allowed-header.https-expected.txt
new file mode 100644 (file)
index 0000000..e1759e0
--- /dev/null
@@ -0,0 +1,10 @@
+
+PASS Registering within Service-Worker-Allowed path 
+PASS Registering within Service-Worker-Allowed path (absolute URL) 
+PASS Registering within Service-Worker-Allowed path with parent reference 
+PASS Registering outside Service-Worker-Allowed path 
+PASS Registering outside Service-Worker-Allowed path with parent reference 
+PASS Service-Worker-Allowed is cross-origin to script, registering on a normally allowed scope 
+PASS Service-Worker-Allowed is cross-origin to script, registering on a normally disallowed scope 
+PASS Service-Worker-Allowed is cross-origin to page, same-origin to script 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/Service-Worker-Allowed-header.https.html b/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/Service-Worker-Allowed-header.https.html
new file mode 100644 (file)
index 0000000..316067c
--- /dev/null
@@ -0,0 +1,104 @@
+<!DOCTYPE html>
+<title>Service Worker: Service-Worker-Allowed header</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/get-host-info.sub.js"></script>
+<script src="resources/test-helpers.sub.js"></script>
+<script>
+
+const host_info = get_host_info();
+
+// Returns a URL for a service worker script whose Service-Worker-Allowed
+// header value is set to |allowed_path|. If |origin| is specified, that origin
+// is used.
+function build_script_url(allowed_path, origin) {
+  const script = 'resources/empty-worker.js';
+  const url = origin ? `${origin}${base_path()}${script}` : script;
+  return `${url}?pipe=header(Service-Worker-Allowed,${allowed_path})`;
+}
+
+promise_test(async t => {
+  const script = build_script_url('/allowed-path');
+  const scope = '/allowed-path';
+  const registration = await service_worker_unregister_and_register(
+      t, script, scope);
+  assert_true(registration instanceof ServiceWorkerRegistration, 'registered');
+  assert_equals(registration.scope, normalizeURL(scope));
+  return registration.unregister();
+}, 'Registering within Service-Worker-Allowed path');
+
+promise_test(async t => {
+  const script = build_script_url(new URL('/allowed-path', document.location));
+  const scope = '/allowed-path';
+  const registration = await service_worker_unregister_and_register(
+      t, script, scope);
+  assert_true(registration instanceof ServiceWorkerRegistration, 'registered');
+  assert_equals(registration.scope, normalizeURL(scope));
+  return registration.unregister();
+}, 'Registering within Service-Worker-Allowed path (absolute URL)');
+
+promise_test(async t => {
+  const script = build_script_url('../allowed-path-with-parent');
+  const scope = 'allowed-path-with-parent';
+  const registration = await service_worker_unregister_and_register(
+      t, script, scope);
+  assert_true(registration instanceof ServiceWorkerRegistration, 'registered');
+  assert_equals(registration.scope, normalizeURL(scope));
+  return registration.unregister();
+}, 'Registering within Service-Worker-Allowed path with parent reference');
+
+promise_test(async t => {
+  const script = build_script_url('../allowed-path');
+  const scope = '/disallowed-path';
+  await service_worker_unregister(t, scope);
+  return promise_rejects(t,
+      'SecurityError',
+      navigator.serviceWorker.register(script, {scope: scope}),
+      'register should fail');
+}, 'Registering outside Service-Worker-Allowed path');
+
+promise_test(async t => {
+  const script = build_script_url('../allowed-path-with-parent');
+  const scope = '/allowed-path-with-parent';
+  await service_worker_unregister(t, scope);
+  return promise_rejects(t,
+      'SecurityError',
+      navigator.serviceWorker.register(script, {scope: scope}),
+      'register should fail');
+}, 'Registering outside Service-Worker-Allowed path with parent reference');
+
+promise_test(async t => {
+  const script = build_script_url(
+      host_info.HTTPS_REMOTE_ORIGIN + '/');
+  const scope = 'resources/this-scope-is-normally-allowed'
+  const registration = await service_worker_unregister_and_register(
+      t, script, scope);
+  assert_true(registration instanceof ServiceWorkerRegistration, 'registered');
+  assert_equals(registration.scope, normalizeURL(scope));
+  return registration.unregister();
+}, 'Service-Worker-Allowed is cross-origin to script, registering on a normally allowed scope');
+
+promise_test(async t => {
+  const script = build_script_url(
+      host_info.HTTPS_REMOTE_ORIGIN + '/');
+  const scope = '/this-scope-is-normally-disallowed'
+  const registration = await service_worker_unregister_and_register(
+      t, script, scope);
+  assert_true(registration instanceof ServiceWorkerRegistration, 'registered');
+  assert_equals(registration.scope, normalizeURL(scope));
+  return registration.unregister();
+}, 'Service-Worker-Allowed is cross-origin to script, registering on a normally disallowed scope');
+
+promise_test(async t => {
+  const script = build_script_url(
+      host_info.HTTPS_REMOTE_ORIGIN + '/cross-origin/',
+      host_info.HTTPS_REMOTE_ORIGIN);
+  const scope = '/cross-origin/';
+  await service_worker_unregister(t, scope);
+  return promise_rejects(t,
+      'SecurityError',
+      navigator.serviceWorker.register(script, {scope: scope}),
+      'register should fail');
+}, 'Service-Worker-Allowed is cross-origin to page, same-origin to script');
+
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/ServiceWorkerGlobalScope/resources/unregister-controlling-worker.html b/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/ServiceWorkerGlobalScope/resources/unregister-controlling-worker.html
new file mode 100644 (file)
index 0000000..e69de29
index e851caa..c3e8e6d 100644 (file)
@@ -1,7 +1,7 @@
 The tests in this directory were imported from the W3C repository.
 Do NOT modify these tests directly in WebKit.
 Instead, create a pull request on the WPT github:
-       https://github.com/w3c/web-platform-tests
+       https://github.com/web-platform-tests/wpt
 
 Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport
 
index 39cdc43..277090f 100644 (file)
@@ -1,7 +1,7 @@
 The tests in this directory were imported from the W3C repository.
 Do NOT modify these tests directly in WebKit.
 Instead, create a pull request on the WPT github:
-       https://github.com/w3c/web-platform-tests
+       https://github.com/web-platform-tests/wpt
 
 Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport
 
@@ -17,6 +17,8 @@ List of files:
 /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/ServiceWorkerGlobalScope/close.https.html
 /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/ServiceWorkerGlobalScope/extendable-message-event-constructor.https.html
 /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/ServiceWorkerGlobalScope/extendable-message-event.https.html
+/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/ServiceWorkerGlobalScope/isSecureContext.https.html
+/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/ServiceWorkerGlobalScope/isSecureContext.serviceworker.js
 /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/ServiceWorkerGlobalScope/postmessage.https.html
 /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/ServiceWorkerGlobalScope/registration-attribute.https.html
 /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/ServiceWorkerGlobalScope/service-worker-error-event.https.html
index 42770b4..c50fce4 100644 (file)
@@ -1,7 +1,11 @@
+frame "<!--frame5-->" - has 1 onunload handler(s)
 
 
 FAIL Initial about:blank is controlled, exposed to clients.matchAll(), and matches final Client. assert_false: result: failure: could not find about:blank client expected false got true
 FAIL Initial about:blank modified by parent is controlled, exposed to clients.matchAll(), and matches final Client. assert_false: result: failure: could not find about:blank client expected false got true
 FAIL Popup initial about:blank is controlled, exposed to clients.matchAll(), and matches final Client. assert_false: result: failure: could not find about:blank client expected false got true
 PASS Initial about:blank is controlled, exposed to clients.matchAll(), and final Client is not controlled by a service worker. 
+FAIL Simple about:blank is controlled and is exposed to clients.matchAll(). assert_false: result: failure: could not find about:blank client expected false got true
+FAIL Nested about:srcdoc is controlled and is exposed to clients.matchAll(). assert_false: result: failure: could not find about:srcdoc client expected false got true
+FAIL Dynamic about:blank is controlled and is exposed to clients.matchAll(). assert_false: result: failure: could not find about:blank client expected false got true
 
index 3acfe1b..e1fefaf 100644 (file)
@@ -58,7 +58,7 @@ function getClientIdByURL(worker, url) {
   });
 }
 
-async function doAsyncTest(t, scope, extraSearchParams) {
+async function doAsyncTest(t, scope) {
   let reg = await service_worker_unregister_and_register(t, worker, scope);
   await wait_for_state(t, reg.installing, 'activated');
 
@@ -70,20 +70,30 @@ async function doAsyncTest(t, scope, extraSearchParams) {
   let initialResult = frame.contentWindow.nested().document.body.textContent;
   assert_false(initialResult.startsWith('failure:'), `result: ${initialResult}`);
 
+  assert_equals(frame.contentWindow.navigator.serviceWorker.controller.scriptURL,
+                frame.contentWindow.nested().navigator.serviceWorker.controller.scriptURL,
+                'nested about:blank should have same controlling service worker');
+
   // Next, ask the service worker to find the final client ID for the fully
   // loaded nested frame.
-  let nestedURL = new URL(scope, window.location);
-  nestedURL.searchParams.set('nested', true);
-  extraSearchParams = extraSearchParams || {};
-  for (let p in extraSearchParams) {
-    nestedURL.searchParams.set(p, extraSearchParams[p]);
-  }
+  let nestedURL = new URL(frame.contentWindow.nested().location);
   let finalResult = await getClientIdByURL(reg.active, nestedURL);
   assert_false(finalResult.startsWith('failure:'), `result: ${finalResult}`);
 
-  // The initial about:blank client and the final loaded client should have
-  // the same ID value.
-  assert_equals(initialResult, finalResult, 'client ID values should match');
+  // If the nested frame doesn't have a URL to load, then there is no fetch
+  // event and the body should be empty.  We can't verify the final client ID
+  // against anything.
+  if (nestedURL.href === 'about:blank' ||
+      nestedURL.href === 'about:srcdoc') {
+    assert_equals('', initialResult, 'about:blank text content should be blank');
+  }
+
+  // If the nested URL is not about:blank, though, then the fetch event handler
+  // should have populated the body with the client id of the initial about:blank.
+  // Verify the final client id matches.
+  else {
+    assert_equals(initialResult, finalResult, 'client ID values should match');
+  }
 
   frame.remove();
   await service_worker_unregister_and_done(t, scope);
@@ -101,8 +111,7 @@ promise_test(async function(t) {
   // worker can ping the client to verify its existence.  This ping-pong
   // check is performed during the initial load and when verifying the
   // final loaded client.
-  await doAsyncTest(t, 'resources/about-blank-replacement-ping-frame.py',
-                    { 'ping': true });
+  await doAsyncTest(t, 'resources/about-blank-replacement-ping-frame.py');
 }, 'Initial about:blank modified by parent is controlled, exposed to ' +
    'clients.matchAll(), and matches final Client.');
 
@@ -142,5 +151,27 @@ promise_test(async function(t) {
 }, 'Initial about:blank is controlled, exposed to clients.matchAll(), and ' +
    'final Client is not controlled by a service worker.');
 
+promise_test(async function(t) {
+  // Execute a test where the nested frame is an iframe without a src
+  // attribute.  This simple nested about:blank should still inherit the
+  // controller and be visible to clients.matchAll().
+  await doAsyncTest(t, 'resources/about-blank-replacement-blank-nested-frame.html');
+}, 'Simple about:blank is controlled and is exposed to clients.matchAll().');
+
+promise_test(async function(t) {
+  // Execute a test where the nested frame is an iframe using a non-empty
+  // srcdoc containing only a tag pair so its textContent is still empty.
+  // This nested iframe should still inherit the controller and be visible
+  // to clients.matchAll().
+  await doAsyncTest(t, 'resources/about-blank-replacement-srcdoc-nested-frame.html');
+}, 'Nested about:srcdoc is controlled and is exposed to clients.matchAll().');
+
+promise_test(async function(t) {
+  // Execute a test where the nested frame is dynamically added without a src
+  // attribute.  This simple nested about:blank should still inherit the
+  // controller and be visible to clients.matchAll().
+  await doAsyncTest(t, 'resources/about-blank-replacement-blank-dynamic-nested-frame.html');
+}, 'Dynamic about:blank is controlled and is exposed to clients.matchAll().');
+
 </script>
 </body>
index ff0990d..29f97e3 100644 (file)
@@ -5,25 +5,24 @@
 <script src="resources/test-helpers.sub.js"></script>
 <body>
 <script>
-var t = async_test('activation occurs after registration');
-t.step(function() {
+promise_test(function(t) {
     var scope = 'resources/blank.html';
     var registration;
 
-    service_worker_unregister_and_register(
+    return service_worker_unregister_and_register(
         t, 'resources/empty-worker.js', scope)
       .then(function(r) {
+          t.add_cleanup(function() {
+              return service_worker_unregister(t, scope);
+            });
+
           registration = r;
           assert_equals(
               r.installing.state,
               'installing',
               'worker should be in the "installing" state upon registration');
           return wait_for_state(t, r.installing, 'activated');
-        })
-      .then(function() {
-          service_worker_unregister_and_done(t, scope);
-        })
-      .catch(unreached_rejection(t));
-});
+        });
+}, 'activation occurs after registration');
 </script>
 </body>
index 15d386e..5755758 100644 (file)
@@ -1,29 +1,11 @@
 <!DOCTYPE html>
 <meta charset="utf-8">
 <title>service worker: activation</title>
-<body>
 <script src="/resources/testharness.js"></script>
 <script src="/resources/testharnessreport.js"></script>
 <script src="resources/test-helpers.sub.js"></script>
+<body>
 <script>
-// Registers, waits for activation, then unregisters on a dummy scope.
-//
-// This helper can be used in tests that assert that activation doesn't happen.
-// It would not be sufficient to check the .waiting/.active properties once,
-// since activation could be scheduled and just hasn't happened yet. Since this
-// helper shows that activation of another registration completed, we can be
-// sure that activation really will not happen.
-function wait_for_activation_on_dummy_scope(t) {
-  var dummy_scope = 'resources/there/is/no/there/there';
-  var registration;
-  return navigator.serviceWorker.register('resources/empty-worker.js',
-      { scope: dummy_scope })
-    .then(r => {
-        registration = r;
-        return wait_for_state(t, registration.installing, 'activated');
-      })
-    .then(() => registration.unregister());
-}
 // Returns {registration, iframe}, where |registration| has an active and
 // waiting worker. The active worker controls |iframe| and has an inflight
 // message event that can be finished by calling
@@ -67,7 +49,7 @@ function setup_activation_test(t, scope, worker_url) {
         return wait_for_state(t, registration.installing, 'installed');
       })
     .then(() => {
-        return wait_for_activation_on_dummy_scope(t);
+        return wait_for_activation_on_dummy_scope(t, self);
       })
     .then(() => {
         assert_not_equals(registration.waiting, null);
@@ -87,7 +69,7 @@ promise_test(t => {
           iframe = result.iframe;
           // Finish the in-flight request.
           registration.active.postMessage('go');
-          return wait_for_activation_on_dummy_scope(t);
+          return wait_for_activation_on_dummy_scope(t, self);
         })
       .then(() => {
           // The new worker is still waiting. Remove the frame and it should
index deee6a5..350a34b 100644 (file)
@@ -5,51 +5,46 @@
 <script src="resources/test-helpers.sub.js"></script>
 <body>
 <script>
+
+const SCRIPT = 'resources/empty-worker.js';
+const SCOPE = 'resources/blank.html';
+
 // "active" is set
-async_test(function(t) {
-    var step = t.step_func.bind(t);
-    var url = 'resources/empty-worker.js';
-    var scope = 'resources/blank.html';
-    var frame;
-    var registration;
+promise_test(async t => {
+
+  t.add_cleanup(async() => {
+    if (frame)
+      frame.remove();
+    if (registration)
+      await registration.unregister();
+  });
+
+  await service_worker_unregister(t, SCOPE);
+  const frame = await with_iframe(SCOPE);
+  const registration =
+      await navigator.serviceWorker.register(SCRIPT, {scope: SCOPE});
+  await wait_for_state(t, registration.installing, 'activating');
+  const container = frame.contentWindow.navigator.serviceWorker;
+  assert_equals(container.controller, null, 'controller');
+  assert_equals(registration.active.state, 'activating',
+                'registration.active');
+  assert_equals(registration.waiting, null, 'registration.waiting');
+  assert_equals(registration.installing, null, 'registration.installing');
 
-    service_worker_unregister(t, scope)
-      .then(step(function() { return with_iframe(scope); }))
-      .then(step(function(f) {
-          frame = f;
-          return navigator.serviceWorker.register(url, {scope: scope});
-        }))
-      .then(step(function(r) {
-          registration = r;
-          return wait_for_state(t, r.installing, 'activating');
-        }))
-      .then(step(function() {
-          var container = frame.contentWindow.navigator.serviceWorker;
-          assert_equals(
-            container.controller,
-            null,
-            'On activating state a document should not have a controller');
-          assert_equals(
-            registration.active.scriptURL,
-            normalizeURL(url),
-            'On activating state a document should have an active worker ');
-          assert_equals(
-            registration.waiting,
-            null,
-            'On activating state a document should not have a waiting worker');
-          assert_equals(
-            registration.installing,
-            null,
-            'On activating state a document should not have an installing ' +
-                'worker');
+  // FIXME: Add a test for a frame created after installation.
+  // Should the existing frame ("frame") block activation?
+}, 'active is set');
 
-          // FIXME: Add a test for a frame created after installation.
-          // Should the existing frame ("frame") block activation?
-        }))
-      .then(step(function() {
-          frame.remove();
-          return service_worker_unregister_and_done(t, scope);
-        }))
-      .catch(unreached_rejection(t));
-  }, 'active is set');
+// Tests that the ServiceWorker objects returned from active attribute getter
+// that represent the same service worker are the same objects.
+promise_test(async t => {
+  const registration1 =
+      await service_worker_unregister_and_register(t, SCRIPT, SCOPE);
+  const registration2 = await navigator.serviceWorker.getRegistration(SCOPE);
+  assert_equals(registration1.active, registration2.active,
+                'ServiceWorkerRegistration.active should return the same ' +
+                'object');
+  await registration1.unregister();
+}, 'The ServiceWorker objects returned from active attribute getter that ' +
+   'represent the same service worker are the same objects');
 </script>
index 609d67e..921dae0 100644 (file)
@@ -60,8 +60,8 @@ function is_appcached() {
   });
 }
 
-async_test(function(t) {
-    service_worker_unregister(t, SERVICE_WORKER_SCOPE)
+promise_test(function(t) {
+    return service_worker_unregister(t, SERVICE_WORKER_SCOPE)
       .then(function() {
           return install_appcache();
         })
@@ -74,6 +74,10 @@ async_test(function(t) {
               t, SERVICE_WORKER_SCRIPT, SERVICE_WORKER_SCOPE);
         })
       .then(function(r) {
+          t.add_cleanup(function() {
+              return service_worker_unregister(t, SERVICE_WORKER_SCOPE);
+            });
+
           return wait_for_state(t, r.installing, 'activated');
         })
       .then(function() {
@@ -82,9 +86,7 @@ async_test(function(t) {
       .then(function(result) {
           assert_false(result, 'but serviceworkers should take priority');
           frames.forEach(function(f) { f.remove(); });
-          service_worker_unregister_and_done(t, SERVICE_WORKER_SCOPE);
-        })
-      .catch(unreached_rejection(t));
+        });
   }, 'serviceworkers take priority over appcaches');
 
 </script>
index c1bddf3..7c25da0 100644 (file)
@@ -1,3 +1,4 @@
 
 PASS fetch() in Worker should be intercepted after the client is claimed. 
+FAIL fetch() in nested Worker should be intercepted after the client is claimed. assert_equals: fetch() should not be intercepted. expected "a simple text file\n" but got "Fail: undefined"
 
index 2bc6536..4b49a81 100644 (file)
@@ -8,17 +8,29 @@
 <script>
 
 promise_test(function(t) {
-  var frame;
+  return runTest(t, 'resources/claim-worker-fetch-iframe.html');
+}, 'fetch() in Worker should be intercepted after the client is claimed.');
+
+promise_test(function(t) {
+  return runTest(t, 'resources/claim-nested-worker-fetch-iframe.html');
+}, 'fetch() in nested Worker should be intercepted after the client is claimed.');
+
+function runTest(t, iframe_url) {
   var resource = 'simple.txt';
 
+  var frame;
+  var registration;
   var worker;
   var scope = 'resources/';
   var script = 'resources/claim-worker.js';
 
   return Promise.resolve()
     // Create the test iframe with a dedicated worker.
-    .then(() => with_iframe('resources/claim-worker-fetch-iframe.html'))
-    .then(f => frame = f)
+    .then(() => with_iframe(iframe_url))
+    .then(f => {
+      t.add_cleanup(() => f.remove());
+      frame = f;
+    })
 
     // Check the controller and test with fetch in the worker.
     .then(() => assert_equals(frame.contentWindow.navigator.controller,
@@ -30,7 +42,10 @@ promise_test(function(t) {
                                          'fetch() should not be intercepted.'))
     // Register a service worker.
     .then(() => service_worker_unregister_and_register(t, script, scope))
-    .then(r => worker = r.installing)
+    .then(r => {
+      t.add_cleanup(() => r.unregister());
+      worker = r.installing;
+    })
     .then(() => wait_for_state(t, worker, 'activated'))
 
     // Let the service worker claim the iframe and the worker.
@@ -49,20 +64,17 @@ promise_test(function(t) {
 
     // Check the controller and test with fetch in the worker.
     .then(() => frame.contentWindow.navigator.serviceWorker.getRegistration(scope))
-    .then(r => assert_equals(frame.contentWindow.navigator.serviceWorker.controller,
-                             r.active,
+    .then(r => registration = r)
+    .then(() => assert_equals(frame.contentWindow.navigator.serviceWorker.controller,
+                             registration.active,
                              'Test iframe should be claimed.'))
     // TODO(horo): Check the worker's navigator.seviceWorker.controller.
     .then(() => frame.contentWindow.fetch_in_worker(resource))
     .then(response_text =>
           assert_equals(response_text,
                         'Intercepted!',
-                        'fetch() in the worker should be intercepted.'))
-
-    // Cleanup this testcase.
-    .then(() => frame.remove())
-    .then(() => service_worker_unregister_and_done(t, scope));
-}, 'fetch() in Worker should be intercepted after the client is claimed.')
+                        'fetch() in the worker should be intercepted.'));
+}
 
 </script>
 </body>
index a53c10c..b93b341 100644 (file)
@@ -4,15 +4,17 @@
 <script src="/resources/testharnessreport.js"></script>
 <script src="resources/test-helpers.sub.js"></script>
 <script>
-var test;
 var scope = 'resources/blank.html?client-id';
 var frame1, frame2;
 
-async_test(function(t) {
-    test = t;
-    service_worker_unregister_and_register(
+promise_test(function(t) {
+    return service_worker_unregister_and_register(
         t, 'resources/client-id-worker.js', scope)
       .then(function(registration) {
+          t.add_cleanup(function() {
+              return service_worker_unregister(t, scope);
+            });
+
           return wait_for_state(t, registration.installing, 'activated');
         })
       .then(function() { return with_iframe(scope + '#1'); })
@@ -25,11 +27,15 @@ async_test(function(t) {
       .then(function(f) {
           frame2 = f;
           var channel = new MessageChannel();
-          channel.port1.onmessage = t.step_func(on_message);
-          f.contentWindow.navigator.serviceWorker.controller.postMessage(
-              {port:channel.port2}, [channel.port2]);
+
+          return new Promise(function(resolve, reject) {
+              channel.port1.onmessage = resolve;
+              channel.port1.onmessageerror = reject;
+              f.contentWindow.navigator.serviceWorker.controller.postMessage(
+                  {port:channel.port2}, [channel.port2]);
+            });
         })
-      .catch(unreached_rejection(t));
+      .then(on_message);
   }, 'Client.id returns the client\'s ID.');
 
 function on_message(e) {
@@ -50,6 +56,5 @@ function on_message(e) {
   assert_equals(e.data[1], e.data[3]);
   frame1.remove();
   frame2.remove();
-  service_worker_unregister_and_done(test, scope);
 }
 </script>
index 897e368..63e3e51 100644 (file)
@@ -9,11 +9,13 @@ var frame_url = scope + '-frame.html';
 var shared_worker_url = scope + '-shared-worker.js';
 var worker_url = scope + '-worker.js';
 var client_ids = [];
+var registration;
 var frame;
 promise_test(function(t) {
     return service_worker_unregister_and_register(
         t, 'resources/clients-get-worker.js', scope)
-      .then(function(registration) {
+      .then(function(r) {
+          registration = r;
           add_completion_callback(function() { registration.unregister(); });
           return wait_for_state(t, registration.installing, 'activated');
         })
@@ -59,12 +61,10 @@ promise_test(function(t) {
         })
       .then(function(client_id) {
           client_ids.push(client_id);
-          var channel = new MessageChannel();
           var saw_message = new Promise(function(resolve) {
-              channel.port1.onmessage = resolve;
+              navigator.serviceWorker.onmessage = resolve;
             });
-          frame.contentWindow.navigator.serviceWorker.controller.postMessage(
-              {port: channel.port2, clientIds: client_ids}, [channel.port2]);
+          registration.active.postMessage({clientIds: client_ids});
           return saw_message;
         })
       .then(function(e) {
index 17d19e4..0f9c411 100644 (file)
@@ -1,3 +1,5 @@
 
 FAIL Test Clients.get() assert_array_equals: property 1, expected false but got true
+FAIL Test successful Clients.get(FetchEvent.resultingClientId) assert_false: Clients.get(FetchEvent.resultingClientId) resolved with a Client expected false got true
+PASS Test unsuccessful Clients.get(FetchEvent.resultingClientId) 
 
index 68c6d7f..4cfbf59 100644 (file)
 <script src="/resources/testharnessreport.js"></script>
 <script src="resources/test-helpers.sub.js"></script>
 <script>
-var scope = 'resources/clients-get-frame.html';
-var client_ids = [];
-var frame;
-promise_test(function(t) {
-    return service_worker_unregister_and_register(
-        t, 'resources/clients-get-worker.js', scope)
-      .then(function(registration) {
-          add_completion_callback(function() { registration.unregister(); });
-          return wait_for_state(t, registration.installing, 'activated');
-        })
-      .then(function() {
-          return with_iframe(scope + '#1');
-        })
-      .then(function(frame1) {
-          add_completion_callback(function() { frame1.remove(); });
-          frame1.focus();
-          return wait_for_clientId();
-        })
-      .then(function(client_id) {
-          client_ids.push(client_id);
-          return with_iframe(scope + '#2');
-        })
-      .then(function(frame2) {
-          frame = frame2;
-          add_completion_callback(function() { frame2.remove(); });
-          return wait_for_clientId();
-        })
-      .then(function(client_id) {
-          client_ids.push(client_id, 'invalid-id');
-          var channel = new MessageChannel();
-          var saw_message = new Promise(function(resolve) {
-              channel.port1.onmessage = resolve;
-            });
-          frame.contentWindow.navigator.serviceWorker.controller.postMessage(
-              {port: channel.port2, clientIds: client_ids}, [channel.port2]);
-          return saw_message;
-        })
-      .then(function(e) {
-          assert_equals(e.data.length, 3);
-          assert_array_equals(e.data[0], expected[0]);
-          assert_array_equals(e.data[1], expected[1]);
-          assert_equals(e.data[2], expected[2]);
-        });
-  }, 'Test Clients.get()');
-
 function wait_for_clientId() {
   return new Promise(function(resolve, reject) {
-      function get_client_id(e) {
-        window.removeEventListener('message', get_client_id);
-        resolve(e.data.clientId);
-      }
-      window.addEventListener('message', get_client_id, false);
-    });
+    window.onmessage = e => {
+      resolve(e.data.clientId);
+    };
+  });
 }
 
-var expected = [
+promise_test(async t => {
+  // Register service worker.
+  const scope = 'resources/clients-get-frame.html';
+  const client_ids = [];
+  const registration = await service_worker_unregister_and_register(
+    t, 'resources/clients-get-worker.js', scope);
+  t.add_cleanup(() => registration.unregister());
+  await wait_for_state(t, registration.installing, 'activated');
+
+  // Prepare for test cases.
+  // Case 1: frame1 which is focused.
+  const frame1 = await with_iframe(scope + '#1');
+  t.add_cleanup(() => frame1.remove());
+  frame1.focus();
+  client_ids.push(await wait_for_clientId());
+  // Case 2: frame2 which is not focused.
+  const frame2 = await with_iframe(scope + '#2');
+  t.add_cleanup(() =>  frame2.remove());
+  client_ids.push(await wait_for_clientId());
+  // Case 3: invalid id.
+  client_ids.push('invalid-id');
+
+  // Call clients.get() for each id on the service worker.
+  const message_event = await new Promise(resolve => {
+    navigator.serviceWorker.onmessage = resolve;
+    registration.active.postMessage({clientIds: client_ids});
+  });
+
+  const expected = [
     // visibilityState, focused, url, type, frameType
     ['visible', true, normalizeURL(scope) + '#1', 'window', 'nested'],
     ['visible', false, normalizeURL(scope) + '#2', 'window', 'nested'],
     undefined
-];
+  ];
+  assert_equals(message_event.data.length, 3);
+  assert_array_equals(message_event.data[0], expected[0]);
+  assert_array_equals(message_event.data[1], expected[1]);
+  assert_equals(message_event.data[2], expected[2]);
+}, 'Test Clients.get()');
+
+promise_test(async t => {
+  // Register service worker.
+  const scope = 'resources/simple.html';
+  const registration = await service_worker_unregister_and_register(
+    t, 'resources/clients-get-resultingClientId-worker.js', scope)
+  t.add_cleanup(() =>  registration.unregister());
+  await wait_for_state(t, registration.installing, 'activated');
+  const worker = registration.active;
+
+  // Load frame within the scope.
+  const frame = await with_iframe(scope);
+  t.add_cleanup(() => frame.remove());
+  frame.focus();
+
+  // Get resulting client id.
+  const resultingClientId = await new Promise(resolve => {
+    navigator.serviceWorker.onmessage = e => {
+      if (e.data.msg == 'getResultingClientId') {
+        resolve(e.data.resultingClientId);
+      }
+    };
+    worker.postMessage({msg: 'getResultingClientId'});
+  });
+
+  // Query service worker for clients.get(resultingClientId).
+  const isResultingClientUndefined = await new Promise(resolve => {
+    navigator.serviceWorker.onmessage = e => {
+      if (e.data.msg == 'getIsResultingClientUndefined') {
+        resolve(e.data.isResultingClientUndefined);
+      }
+    };
+    worker.postMessage({msg: 'getIsResultingClientUndefined',
+                        resultingClientId});
+  });
+
+  assert_false(
+    isResultingClientUndefined,
+    'Clients.get(FetchEvent.resultingClientId) resolved with a Client');
+}, 'Test successful Clients.get(FetchEvent.resultingClientId)');
+
+promise_test(async t => {
+  // Register service worker.
+  const scope = 'resources/simple.html?fail';
+  const registration = await service_worker_unregister_and_register(
+    t, 'resources/clients-get-resultingClientId-worker.js', scope);
+  t.add_cleanup(() =>  registration.unregister());
+  await wait_for_state(t, registration.installing, 'activated');
+
+  // Load frame, and destroy it while loading.
+  const worker = registration.active;
+  let frame = document.createElement('iframe');
+  frame.src = scope;
+  t.add_cleanup(() => {
+    if (frame) {
+      frame.remove();
+    }
+  });
+
+  await new Promise(resolve => {
+    navigator.serviceWorker.onmessage = e => {
+      // The service worker posts a message to remove the iframe during fetch
+      // event.
+      if (e.data.msg == 'destroyResultingClient') {
+        frame.remove();
+        frame = null;
+        worker.postMessage({msg: 'resultingClientDestroyed'});
+        resolve();
+      }
+    };
+    document.body.appendChild(frame);
+  });
+
+  resultingDestroyedClientId = await new Promise(resolve => {
+    navigator.serviceWorker.onmessage = e => {
+      // The worker sends a message back when it receives the message
+      // 'resultingClientDestroyed' with the resultingClientId.
+      if (e.data.msg == 'resultingClientDestroyedAck') {
+        assert_equals(frame, null, 'Frame should be destroyed at this point.');
+        resolve(e.data.resultingDestroyedClientId);
+      }
+    };
+  });
+
+  // Query service worker for clients.get(resultingDestroyedClientId).
+  const isResultingClientUndefined = await new Promise(resolve => {
+    navigator.serviceWorker.onmessage = e => {
+      if (e.data.msg == 'getIsResultingClientUndefined') {
+        resolve(e.data.isResultingClientUndefined);
+      }
+    };
+    worker.postMessage({msg: 'getIsResultingClientUndefined',
+                        resultingClientId: resultingDestroyedClientId });
+  });
+
+  assert_true(
+    isResultingClientUndefined,
+    'Clients.get(FetchEvent.resultingClientId) resolved with `undefined`');
+}, 'Test unsuccessful Clients.get(FetchEvent.resultingClientId)');
+
 </script>
index 930ec33..e42473e 100644 (file)
@@ -1,4 +1,4 @@
 
 
-FAIL Test Clients.matchAll() with exact controller assert_unreached: unexpected rejection: assert_array_equals: property 1, expected false but got true Reached unreachable code
+FAIL Test Clients.matchAll() with exact controller assert_array_equals: property 1, expected false but got true
 
index ee60c4a..a61c8af 100644 (file)
@@ -5,7 +5,6 @@
 <script src="resources/test-helpers.sub.js"></script>
 <script>
 const scope = 'resources/blank.html?clients-matchAll';
-const t = async_test('Test Clients.matchAll() with exact controller');
 let frames = [];
 
 function checkWorkerClients(worker, expected) {
@@ -33,10 +32,12 @@ let expected = [
     ['visible', false, new URL(scope + '#2', location).toString(), 'window', 'nested']
 ];
 
-t.step(_ => {
+promise_test(t => {
     let script = 'resources/clients-matchall-worker.js';
-    service_worker_unregister_and_register(t, script, scope)
+    return service_worker_unregister_and_register(t, script, scope)
       .then(registration => {
+          t.add_cleanup(() => service_worker_unregister(t, scope));
+
           return wait_for_state(t, registration.installing, 'activated');
         })
       .then(_ => with_iframe(scope + '#1') )
@@ -61,8 +62,6 @@ t.step(_ => {
         })
       .then(_ => {
           frames.forEach(f => f.remove() );
-          service_worker_unregister_and_done(t, scope);
-        })
-      .catch(unreached_rejection(t));
-  });
+        });
+}, 'Test Clients.matchAll() with exact controller');
 </script>
index 50bd817..9f34e57 100644 (file)
 <script src="/resources/testharnessreport.js"></script>
 <script src="resources/test-helpers.sub.js"></script>
 <script>
-var base_url = 'resources/blank.html'; // This is out-of-scope.
-var scope = base_url + '?clients-matchAll-includeUncontrolled';
-var frames = [];
-
-// Creates 3 iframes, 2 for in-scope and 1 for out-of-scope.
-// The frame opened for scope + '#2' is returned via a promise.
-function create_iframes(scope) {
-  return with_iframe(base_url)
-    .then(function(frame0) {
-        frames.push(frame0);
-        return with_iframe(scope + '#1');
-      })
-    .then(function(frame1) {
-        frames.push(frame1);
-        return with_iframe(scope + '#2');
-      })
-    .then(function(frame2) {
-        frames.push(frame2);
-        return frame2;
-      })
+function test_matchall(service_worker, expected, query_options) {
+  expected.sort((a, b) => a[2] > b[2] ? 1 : -1);
+  return new Promise((resolve, reject) => {
+    const channel = new MessageChannel();
+    channel.port1.onmessage = e => {
+      const data = e.data.filter(info => {
+        return info[2].indexOf('clients-matchall') > -1;
+      });
+      data.sort((a, b) => a[2] > b[2] ? 1 : -1);
+      assert_equals(data.length, expected.length);
+      for (let i = 0; i < data.length; i++)
+        assert_array_equals(data[i], expected[i]);
+      resolve();
+    };
+    service_worker.postMessage({port:channel.port2, options:query_options},
+                               [channel.port2]);
+  });
 }
 
-var expected_without_include_uncontrolled = [
+// Run clients.matchAll without and with includeUncontrolled=true.
+// (We want to run the two tests sequentially in the same promise_test
+// so that we can use the same set of iframes without intefering each other.
+promise_test(async t => {
+  // |base_url| is out-of-scope.
+  const base_url = 'resources/blank.html?clients-matchall';
+  const scope = base_url + '-includeUncontrolled';
+
+  const registration =
+      await service_worker_unregister_and_register(
+          t, 'resources/clients-matchall-worker.js', scope);
+  t.add_cleanup(() => service_worker_unregister(t, scope));
+  const service_worker = registration.installing;
+  await wait_for_state(t, service_worker, 'activated');
+
+  // Creates 3 iframes, 2 for in-scope and 1 for out-of-scope.
+  let frames = [];
+  frames.push(await with_iframe(base_url));
+  frames.push(await with_iframe(scope + '#1'));
+  frames.push(await with_iframe(scope + '#2'));
+
+  // Make sure we have focus for '#2' frame and its parent window.
+  frames[2].focus();
+  frames[2].contentWindow.focus();
+
+  const expected_without_include_uncontrolled = [
     // visibilityState, focused, url, type, frameType
     ['visible', false, new URL(scope + '#1', location).toString(), 'window', 'nested'],
     ['visible', true, new URL(scope + '#2', location).toString(), 'window', 'nested']
-];
-
-var expected_with_include_uncontrolled = [
+  ];
+  const expected_with_include_uncontrolled = [
     // visibilityState, focused, url, type, frameType
     ['visible', true, location.href, 'window', 'top-level'],
     ['visible', false, new URL(scope + '#1', location).toString(), 'window', 'nested'],
     ['visible', true, new URL(scope + '#2', location).toString(), 'window', 'nested'],
     ['visible', false, new URL(base_url, location).toString(), 'window', 'nested']
-];
+  ];
 
-function test_matchall(frame, expected, query_options) {
-  // Make sure we have focus for '#2' frame and its parent window.
-  frame.focus();
-  frame.contentWindow.focus();
-  expected.sort(function(a, b) { return a[2] > b[2] ? 1 : -1; });
-  return new Promise(function(resolve, reject) {
-    var channel = new MessageChannel();
-    channel.port1.onmessage = function(e) {
-      // Ignore hidden clients which may be coming from background tabs, or
-      // clients unrelated to this test.
-      var data = e.data.filter(function(info) {
-        return info[0] == 'visible' &&
-               info[2].indexOf('service-worker') > -1;
-      });
-      data.sort(function(a, b) { return a[2] > b[2] ? 1 : -1; });
-      assert_equals(data.length, expected.length);
-      for (var i = 0; i < data.length; i++)
-        assert_array_equals(data[i], expected[i]);
-      resolve(frame);
-    };
-    frame.contentWindow.navigator.serviceWorker.controller.postMessage(
-        {port:channel.port2, options:query_options},
-        [channel.port2]);
-  });
+  await test_matchall(service_worker, expected_without_include_uncontrolled);
+  await test_matchall(service_worker, expected_with_include_uncontrolled,
+                      { includeUncontrolled: true });
+}, 'Verify matchAll() with windows respect includeUncontrolled');
+
+// TODO: Add tests for clients.matchAll for dedicated workers.
+
+async function create_shared_worker(script_url) {
+  const shared_worker = new SharedWorker(script_url);
+  const msgEvent = await new Promise(r => shared_worker.port.onmessage = r);
+  assert_equals(msgEvent.data, 'started');
+  return shared_worker;
 }
 
-// Run clients.matchAll without and with includeUncontrolled=true.
-// (We want to run the two tests sequentially in the same async_test
-// so that we can use the same set of iframes without intefering each other.
-async_test(function(t) {
-    service_worker_unregister_and_register(
-        t, 'resources/clients-matchall-worker.js', scope)
-      .then(function(registration) {
-          return wait_for_state(t, registration.installing, 'activated');
-        })
-      .then(function() { return create_iframes(scope); })
-      .then(function(frame) {
-          return test_matchall(frame, expected_without_include_uncontrolled);
-        })
-      .then(function(frame) {
-          return test_matchall(frame, expected_with_include_uncontrolled,
-                               {includeUncontrolled:true});
-        })
-      .then(function() {
-          frames.forEach(function(f) { f.remove() });
-          service_worker_unregister_and_done(t, scope);
-        })
-      .catch(unreached_rejection(t));
-  }, 'Verify matchAll() respect includeUncontrolled');
+// Run clients.matchAll for shared workers without and with
+// includeUncontrolled=true.
+promise_test(async t => {
+  const script_url = 'resources/clients-matchall-client-types-shared-worker.js';
+  const uncontrolled_script_url =
+      new URL(script_url + '?uncontrolled', location).toString();
+  const controlled_script_url =
+      new URL(script_url + '?controlled', location).toString();
+
+  // Start a shared worker that is not controlled by a service worker.
+  const uncontrolled_shared_worker =
+      await create_shared_worker(uncontrolled_script_url);
+
+  // Register a service worker.
+  const registration =
+      await service_worker_unregister_and_register(
+          t, 'resources/clients-matchall-worker.js', script_url);
+  t.add_cleanup(() => service_worker_unregister(t, script_url));
+  const service_worker = registration.installing;
+  await wait_for_state(t, service_worker, 'activated');
+
+  // Start another shared worker controlled by the service worker.
+  await create_shared_worker(controlled_script_url);
+
+  const expected_without_include_uncontrolled = [
+    // visibilityState, focused, url, type, frameType
+    [undefined, undefined, controlled_script_url, 'sharedworker', 'none'],
+  ];
+  const expected_with_include_uncontrolled = [
+    // visibilityState, focused, url, type, frameType
+    [undefined, undefined, controlled_script_url, 'sharedworker', 'none'],
+    [undefined, undefined, uncontrolled_script_url, 'sharedworker', 'none'],
+  ];
 
+  await test_matchall(service_worker, expected_without_include_uncontrolled,
+                      { type: 'sharedworker' });
+  await test_matchall(service_worker, expected_with_include_uncontrolled,
+                      { includeUncontrolled: true, type: 'sharedworker' });
+}, 'Verify matchAll() with shared workers respect includeUncontrolled');
 </script>
index 2c1e956..0596050 100644 (file)
@@ -1,5 +1,6 @@
 <!DOCTYPE html>
 <title>Service Worker: Clients.matchAll ordering</title>
+<meta name=timeout content=long>
 <script src="/resources/testharness.js"></script>
 <script src="/resources/testharnessreport.js"></script>
 <script src="resources/test-helpers.sub.js"></script>
index 36269b4..ce44f19 100644 (file)
@@ -5,12 +5,15 @@
 <script src="resources/test-helpers.sub.js"></script>
 <script>
 var scope = 'resources/blank.html?clients-matchAll';
-var t = async_test('Test Clients.matchAll()');
 var frames = [];
-t.step(function() {
-    service_worker_unregister_and_register(
+promise_test(function(t) {
+    return service_worker_unregister_and_register(
         t, 'resources/clients-matchall-worker.js', scope)
       .then(function(registration) {
+          t.add_cleanup(function() {
+              return service_worker_unregister(t, scope);
+            });
+
           return wait_for_state(t, registration.installing, 'activated');
         })
       .then(function() { return with_iframe(scope + '#1'); })
@@ -22,12 +25,15 @@ t.step(function() {
       .then(function(frame2) {
           frames.push(frame2);
           var channel = new MessageChannel();
-          channel.port1.onmessage = t.step_func(onMessage);
-          frame2.contentWindow.navigator.serviceWorker.controller.postMessage(
-              {port:channel.port2}, [channel.port2]);
+
+          return new Promise(function(resolve) {
+              channel.port1.onmessage = resolve;
+              frame2.contentWindow.navigator.serviceWorker.controller.postMessage(
+                  {port:channel.port2}, [channel.port2]);
+            });
         })
-      .catch(unreached_rejection(t));
-  });
+      .then(onMessage);
+}, 'Test Clients.matchAll()');
 
 var expected = [
     // visibilityState, focused, url, type, frameType
@@ -40,6 +46,5 @@ function onMessage(e) {
   assert_array_equals(e.data[0], expected[0]);
   assert_array_equals(e.data[1], expected[1]);
   frames.forEach(function(f) { f.remove(); });
-  service_worker_unregister_and_done(t, scope);
 }
 </script>
index 920d190..f23dfe7 100644 (file)
@@ -5,22 +5,25 @@
 <script src="resources/test-helpers.sub.js"></script>
 <body>
 <script>
-var t = async_test('controller is cleared on disconnected window');
-t.step(function() {
+promise_test(function(t) {
     var url = 'resources/empty-worker.js';
     var scope = 'resources/blank.html';
     var registration;
     var controller;
     var frame;
-    service_worker_unregister_and_register(t, url, scope)
-      .then(t.step_func(function(swr) {
+    return service_worker_unregister_and_register(t, url, scope)
+      .then(function(swr) {
+          t.add_cleanup(function() {
+              return service_worker_unregister(t, scope);
+            });
+
           registration = swr;
           return wait_for_state(t, registration.installing, 'activated');
-        }))
-      .then(t.step_func(function() {
+        })
+      .then(function() {
           return with_iframe(scope)
-        }))
-      .then(t.step_func(function(f) {
+        })
+      .then(function(f) {
           frame = f;
           var w = frame.contentWindow;
           var swc = w.navigator.serviceWorker;
@@ -31,10 +34,7 @@ t.step(function() {
 
           assert_equals(swc.controller, null,
                         'disconnected frame should not be controlled');
-
-          service_worker_unregister_and_done(t, scope);
-        }))
-      .catch(unreached_rejection(t));
-  });
+        });
+}, 'controller is cleared on disconnected window');
 </script>
 </body>
index 49f9879..e4c5e5f 100644 (file)
@@ -5,22 +5,25 @@
 <script src="resources/test-helpers.sub.js"></script>
 <body>
 <script>
-var t = async_test('controller is set for a controlled document');
-t.step(function() {
+promise_test(function(t) {
     var url = 'resources/empty-worker.js';
     var scope = 'resources/blank.html';
     var registration;
     var controller;
     var frame;
-    service_worker_unregister_and_register(t, url, scope)
-      .then(t.step_func(function(swr) {
+    return service_worker_unregister_and_register(t, url, scope)
+      .then(function(swr) {
+          t.add_cleanup(function() {
+              return service_worker_unregister(t, scope);
+            });
+
           registration = swr;
           return wait_for_state(t, registration.installing, 'activated');
-        }))
-      .then(t.step_func(function() {
+        })
+      .then(function() {
           return with_iframe(scope);
-        }))
-      .then(t.step_func(function(f) {
+        })
+      .then(function(f) {
           frame = f;
           var w = frame.contentWindow;
           controller = w.navigator.serviceWorker.controller;
@@ -32,14 +35,12 @@ t.step(function() {
           assert_not_equals(controller, registration.active);
 
           return w.navigator.serviceWorker.getRegistration();
-        }))
-      .then(t.step_func(function(frameRegistration) {
+        })
+      .then(function(frameRegistration) {
           // SW objects from same window should be equal
           assert_equals(frameRegistration.active, controller);
           frame.remove();
-          service_worker_unregister_and_done(t, scope);
-        }))
-      .catch(unreached_rejection(t));
-  });
+        });
+}, 'controller is set for a controlled document');
 </script>
 </body>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/controller-with-no-fetch-event-handler.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/controller-with-no-fetch-event-handler.https-expected.txt
new file mode 100644 (file)
index 0000000..b455682
--- /dev/null
@@ -0,0 +1,9 @@
+CONSOLE MESSAGE: Origin https://localhost:9443 is not allowed by Access-Control-Allow-Origin.
+CONSOLE MESSAGE: Fetch API cannot load https://127.0.0.1:9443/service-workers/service-worker/resources/cors-denied.txt due to access control checks.
+
+PASS global setup 
+PASS cross-origin request, no-cors mode 
+PASS cross-origin request, cors denied 
+PASS cross-origin request, cors approved 
+PASS cleanup global state 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/controller-with-no-fetch-event-handler.https.html b/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/controller-with-no-fetch-event-handler.https.html
new file mode 100644 (file)
index 0000000..7147c33
--- /dev/null
@@ -0,0 +1,56 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>Service Worker: controller without a fetch event handler</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/get-host-info.sub.js"></script>
+<script src="resources/test-helpers.sub.js?pipe=sub"></script>
+<body>
+<script>
+let registration;
+let frame;
+const host_info = get_host_info();
+const remote_base_url =
+    new URL(`${host_info.HTTPS_REMOTE_ORIGIN}${base_path()}resources/`);
+
+promise_test(async t => {
+  const script = 'resources/empty.js'
+  const scope = 'resources/';
+
+  promise_test(async t => {
+    if (frame)
+      frame.remove();
+
+    if (registration)
+      await registration.unregister();
+  }, 'cleanup global state');
+
+  registration = await
+      service_worker_unregister_and_register(t, script, scope);
+  await wait_for_state(t, registration.installing, 'activated');
+  frame = await with_iframe(scope + 'blank.html');
+}, 'global setup');
+
+promise_test(async t => {
+    const url = new URL('cors-approved.txt', remote_base_url);
+    const response = await frame.contentWindow.fetch(url, {mode:'no-cors'});
+    const text = await response.text();
+    assert_equals(text, '');
+}, 'cross-origin request, no-cors mode');
+
+
+promise_test(async t => {
+    const url = new URL('cors-denied.txt', remote_base_url);
+    const response = frame.contentWindow.fetch(url);
+    await promise_rejects(t, new TypeError(), response);
+}, 'cross-origin request, cors denied');
+
+promise_test(async t => {
+    const url = new URL('cors-approved.txt', remote_base_url);
+    response = await frame.contentWindow.fetch(url);
+    let text = await response.text();
+    text = text.trim();
+    assert_equals(text, 'plaintext');
+}, 'cross-origin request, cors approved');
+</script>
+</body>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/dedicated-worker-service-worker-interception.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/dedicated-worker-service-worker-interception.https-expected.txt
new file mode 100644 (file)
index 0000000..ebac430
--- /dev/null
@@ -0,0 +1,8 @@
+CONSOLE MESSAGE: line 1: SyntaxError: Unexpected string literal './service-worker-interception-network-worker.js'. import call expects exactly one argument.
+
+Harness Error (FAIL), message = SyntaxError: Unexpected string literal './service-worker-interception-network-worker.js'. import call expects exactly one argument.
+
+FAIL Top-level module loading should be intercepted by a service worker. assert_equals: expected "LOADED_FROM_SERVICE_WORKER" but got "LOADED_FROM_NETWORK"
+TIMEOUT Static import should be intercepted by a service worker. Test timed out
+NOTRUN Dynamic import should be intercepted by a service worker. 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/dedicated-worker-service-worker-interception.https.html b/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/dedicated-worker-service-worker-interception.https.html
new file mode 100644 (file)
index 0000000..2144f48
--- /dev/null
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<title>DedicatedWorker: ServiceWorker interception</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="resources/test-helpers.sub.js"></script>
+<script>
+
+// Note that Chrome cannot pass these tests because of https://crbug.com/731599.
+
+function service_worker_interception_test(url, description) {
+  promise_test(async t => {
+    // Register a service worker whose scope includes |url|.
+    const kServiceWorkerScriptURL =
+        'resources/service-worker-interception-service-worker.js';
+    const registration = await service_worker_unregister_and_register(
+        t, kServiceWorkerScriptURL, url);
+    add_result_callback(() => registration.unregister());
+    await wait_for_state(t, registration.installing, 'activated');
+
+    // Start a dedicated worker for |url|. The top-level script request and any
+    // module imports should be intercepted by the service worker.
+    const worker = new Worker(url, { type: 'module' });
+    const msg_event = await new Promise(resolve => worker.onmessage = resolve);
+    assert_equals(msg_event.data, 'LOADED_FROM_SERVICE_WORKER');
+  }, description);
+}
+
+service_worker_interception_test(
+    'resources/service-worker-interception-network-worker.js',
+    'Top-level module loading should be intercepted by a service worker.');
+
+service_worker_interception_test(
+    'resources/service-worker-interception-static-import-worker.js',
+    'Static import should be intercepted by a service worker.');
+
+service_worker_interception_test(
+    'resources/service-worker-interception-dynamic-import-worker.js',
+    'Dynamic import should be intercepted by a service worker.');
+
+</script>
index d345982..5ae4de8 100644 (file)
@@ -16,6 +16,7 @@ promise_test(t => {
     const scope_for_main = 'resources/' + scope_for_iframe;
     const script = 'resources/empty-worker.js';
     let frame;
+    let resolvedCount = 0;
 
     return service_worker_unregister(t, scope_for_main)
       .then(() => {
@@ -41,9 +42,23 @@ promise_test(t => {
           assert_equals(r.active.state, 'activated');
           assert_equals(r.scope, normalizeURL(scope_for_main));
           r.onupdatefound = () => { /* empty */ };
-          return Promise.all([
-              promise_rejects(t, 'InvalidStateError', r.unregister()),
-              promise_rejects(t, 'InvalidStateError', r.update())]);
+
+          // We want to verify that unregister() and update() do not
+          // resolve on a detached registration.  We can't check for
+          // an explicit rejection, though, because not all browsers
+          // fire rejection callbacks on detached promises.  Instead
+          // we wait for a dummy scope to install, activate, and
+          // unregister before declaring that the promises did not
+          // resolve.
+          r.unregister().then(() => resolvedCount += 1,
+                              () => {});
+          r.update().then(() => resolvedCount += 1,
+                          () => {});
+          return wait_for_activation_on_dummy_scope(t, window);
+        })
+      .then(() => {
+          assert_equals(resolvedCount, 0,
+                        'methods called on a detached registration should not resolve');
         })
   }, 'accessing a ServiceWorkerRegistration from a removed iframe');
 
diff --git a/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/embed-and-object-are-not-intercepted.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/embed-and-object-are-not-intercepted.https-expected.txt
new file mode 100644 (file)
index 0000000..e14f691
--- /dev/null
@@ -0,0 +1,9 @@
+CONSOLE MESSAGE: FetchEvent.respondWith received an error: network error to show interception occurred
+CONSOLE MESSAGE: Cannot load https://localhost:9443/images/green.png.
+CONSOLE MESSAGE: FetchEvent.respondWith received an error: network error to show interception occurred
+CONSOLE MESSAGE: Cannot load https://localhost:9443/images/green.png.
+#PID UNRESPONSIVE - com.apple.WebKit.WebContent.Development (pid 56390)
+FAIL: Timed out waiting for notifyDone to be called
+
+#EOF
+#EOF
diff --git a/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/embed-and-object-are-not-intercepted.https.html b/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/embed-and-object-are-not-intercepted.https.html
new file mode 100644 (file)
index 0000000..34556a7
--- /dev/null
@@ -0,0 +1,78 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>embed and object are not intercepted</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/get-host-info.sub.js"></script>
+<script src="resources/test-helpers.sub.js?pipe=sub"></script>
+<body>
+<script>
+let registration;
+
+const kScript = 'resources/embed-and-object-are-not-intercepted-worker.js';
+const kScope = 'resources/';
+
+promise_test(t => {
+    return service_worker_unregister_and_register(t, kScript, kScope)
+      .then(registration => {
+          promise_test(() => {
+              return registration.unregister();
+            }, 'restore global state');
+
+          return wait_for_state(t, registration.installing, 'activated');
+        })
+  }, 'initialize global state');
+
+promise_test(t => {
+    let frame;
+    return with_iframe('resources/embed-is-not-intercepted-iframe.html')
+      .then(f => {
+          frame = f;
+          t.add_cleanup(() => { frame.remove(); });
+          return frame.contentWindow.test_promise;
+        })
+      .then(result => {
+          assert_equals(result, 'request for embedded content was not intercepted');
+        });
+  }, 'requests for EMBED elements of embedded HTML content should not be intercepted by service workers');
+
+promise_test(t => {
+    let frame;
+    return with_iframe('resources/object-is-not-intercepted-iframe.html')
+      .then(f => {
+          frame = f;
+          t.add_cleanup(() => { frame.remove(); });
+          return frame.contentWindow.test_promise;
+        })
+      .then(result => {
+          assert_equals(result, 'request for embedded content was not intercepted');
+        });
+  }, 'requests for OBJECT elements of embedded HTML content should not be intercepted by service workers');
+
+promise_test(t => {
+    let frame;
+    return with_iframe('resources/embed-image-is-not-intercepted-iframe.html')
+      .then(f => {
+          frame = f;
+          t.add_cleanup(() => { frame.remove(); });
+          return frame.contentWindow.test_promise;
+        })
+      .then(result => {
+          assert_equals(result, 'request was not intercepted');
+        });
+  }, 'requests for EMBED elements of an image should not be intercepted by service workers');
+
+promise_test(t => {
+    let frame;
+    return with_iframe('resources/object-image-is-not-intercepted-iframe.html')
+      .then(f => {
+          frame = f;
+          t.add_cleanup(() => { frame.remove(); });
+          return frame.contentWindow.test_promise;
+        })
+      .then(result => {
+          assert_equals(result, 'request was not intercepted');
+        });
+  }, 'requests for OBJECT elements of an image should not be intercepted by service workers');
+
+</script>
index 902a978..3110d3e 100644 (file)
@@ -1,13 +1,13 @@
 
 
 PASS Test calling waitUntil in a different task without an existing extension throws 
-FAIL Test calling waitUntil in a different microtask without an existing extension throws assert_unreached: unexpected rejection: assert_equals: expected "InvalidStateError" but got "OK" Reached unreachable code
+FAIL Test calling waitUntil in a different microtask without an existing extension throws assert_equals: expected "InvalidStateError" but got "OK"
 PASS Test calling waitUntil in a different task with an existing extension succeeds 
 PASS Test calling waitUntil with an existing extension promise handler succeeds 
-FAIL Test calling waitUntil at the end of the microtask turn throws assert_unreached: unexpected rejection: assert_equals: expected "InvalidStateError" but got "OK" Reached unreachable code
+FAIL Test calling waitUntil at the end of the microtask turn throws assert_equals: expected "InvalidStateError" but got "OK"
 PASS Test calling waitUntil after the current extension expired in a different task fails 
 PASS Test calling waitUntil on a script constructed ExtendableEvent throws exception 
 PASS Test calling waitUntil asynchronously with pending respondWith promise. 
 PASS Test calling waitUntil synchronously inside microtask of respondWith promise. 
-FAIL Test calling waitUntil asynchronously inside microtask of respondWith promise. assert_unreached: unexpected rejection: assert_equals: expected "InvalidStateError" but got "OK" Reached unreachable code
+FAIL Test calling waitUntil asynchronously inside microtask of respondWith promise. assert_equals: expected "InvalidStateError" but got "OK"
 
index be4efbb..cb4ed30 100644 (file)
@@ -22,15 +22,19 @@ function sync_message(worker, message, transfer) {
 function runTest(test, step, testBody) {
   var scope = './resources/' + step;
   var script = 'resources/extendable-event-async-waituntil.js?' + scope;
-  service_worker_unregister_and_register(test, script, scope)
+  return service_worker_unregister_and_register(test, script, scope)
     .then(function(registration) {
+        test.add_cleanup(function() {
+            return service_worker_unregister(test, scope);
+          });
+
         let worker = registration.installing;
         var channel = new MessageChannel();
         var saw_message = new Promise(function(resolve) {
           channel.port1.onmessage = function(e) { resolve(e.data); }
         });
 
-        wait_for_state(test, worker, 'activated')
+        return wait_for_state(test, worker, 'activated')
           .then(function() {
               return sync_message(worker, { step: 'init', port: channel.port2 },
                 [channel.port2]);
@@ -40,9 +44,7 @@ function runTest(test, step, testBody) {
           .then(function(output) {
               assert_equals(output.result, output.expected);
             })
-          .then(function() { return sync_message(worker, { step: 'done' }); })
-          .then(() => { service_worker_unregister_and_done(test, scope); })
-          .catch(unreached_rejection(test));
+          .then(function() { return sync_message(worker, { step: 'done' }); });
       });
 }
 
@@ -50,51 +52,51 @@ function msg_event_test(scope, test) {
   var testBody = function(worker) {
     return sync_message(worker, { step: scope });
   };
-  runTest(test, scope, testBody);
+  return runTest(test, scope, testBody);
 }
 
-async_test(msg_event_test.bind(this, 'no-current-extension-different-task'),
+promise_test(msg_event_test.bind(this, 'no-current-extension-different-task'),
   'Test calling waitUntil in a different task without an existing extension throws');
 
-async_test(msg_event_test.bind(this, 'no-current-extension-different-microtask'),
+promise_test(msg_event_test.bind(this, 'no-current-extension-different-microtask'),
   'Test calling waitUntil in a different microtask without an existing extension throws');
 
-async_test(msg_event_test.bind(this, 'current-extension-different-task'),
+promise_test(msg_event_test.bind(this, 'current-extension-different-task'),
   'Test calling waitUntil in a different task with an existing extension succeeds');
 
-async_test(msg_event_test.bind(this, 'current-extension-expired-same-microtask-turn'),
+promise_test(msg_event_test.bind(this, 'current-extension-expired-same-microtask-turn'),
   'Test calling waitUntil with an existing extension promise handler succeeds');
 
 // The promise handler will queue a new microtask after the check for new
 // extensions was performed.
-async_test(msg_event_test.bind(this, 'current-extension-expired-same-microtask-turn-extra'),
+promise_test(msg_event_test.bind(this, 'current-extension-expired-same-microtask-turn-extra'),
   'Test calling waitUntil at the end of the microtask turn throws');
 
-async_test(msg_event_test.bind(this, 'current-extension-expired-different-task'),
+promise_test(msg_event_test.bind(this, 'current-extension-expired-different-task'),
   'Test calling waitUntil after the current extension expired in a different task fails');
 
-async_test(msg_event_test.bind(this, 'script-extendable-event'),
+promise_test(msg_event_test.bind(this, 'script-extendable-event'),
   'Test calling waitUntil on a script constructed ExtendableEvent throws exception');
 
-async_test(function(t) {
+promise_test(function(t) {
     var testBody = function(worker) {
       return with_iframe('./resources/pending-respondwith-async-waituntil/dummy.html');
     }
-    runTest(t, 'pending-respondwith-async-waituntil', testBody);
+    return runTest(t, 'pending-respondwith-async-waituntil', testBody);
   }, 'Test calling waitUntil asynchronously with pending respondWith promise.');
 
-async_test(function(t) {
+promise_test(function(t) {
     var testBody = function(worker) {
       return with_iframe('./resources/respondwith-microtask-sync-waituntil/dummy.html');
     }
-    runTest(t, 'respondwith-microtask-sync-waituntil', testBody);
+    return runTest(t, 'respondwith-microtask-sync-waituntil', testBody);
   }, 'Test calling waitUntil synchronously inside microtask of respondWith promise.');
 
-async_test(function(t) {
+promise_test(function(t) {
     var testBody = function(worker) {
       return with_iframe('./resources/respondwith-microtask-async-waituntil/dummy.html');
     }
-    runTest(t, 'respondwith-microtask-async-waituntil', testBody);
+    return runTest(t, 'respondwith-microtask-async-waituntil', testBody);
   }, 'Test calling waitUntil asynchronously inside microtask of respondWith promise.');
 
 
index 8e790d0..33b4eac 100644 (file)
@@ -6,75 +6,85 @@
 <script>
 function runTest(test, scope, onRegister) {
   var script = 'resources/extendable-event-waituntil.js?' + scope;
-  service_worker_unregister_and_register(test, script, scope)
+  return service_worker_unregister_and_register(test, script, scope)
     .then(function(registration) {
-        onRegister(registration.installing);
+        test.add_cleanup(function() {
+            return service_worker_unregister(test, scope);
+          });
+
+        return onRegister(registration.installing);
       });
 }
 
 // Sends a SYN to the worker and asynchronously listens for an ACK; sets
 // |obj.synced| to true once ack'd.
-function syncWorker(test, worker, obj) {
+function syncWorker(worker, obj) {
   var channel = new MessageChannel();
   worker.postMessage({port: channel.port2}, [channel.port2]);
   return new Promise(function(resolve) {
-      channel.port1.onmessage = test.step_func(function(e) {
-          var message = e.data;
-          assert_equals(message, 'SYNC',
-                        'Should receive sync message from worker.');
-          obj.synced = true;
-          channel.port1.postMessage('ACK');
-          resolve();
-        });
+      channel.port1.onmessage = resolve;
+    }).then(function(e) {
+      var message = e.data;
+      assert_equals(message, 'SYNC',
+                    'Should receive sync message from worker.');
+      obj.synced = true;
+      channel.port1.postMessage('ACK');
     });
 }
 
-async_test(function(t) {
+promise_test(function(t) {
     // Passing scope as the test switch for worker script.
     var scope = 'resources/install-fulfilled';
     var onRegister = function(worker) {
         var obj = {};
-        wait_for_state(t, worker, 'installed')
-          .then(function() {
+
+        return Promise.all([
+            syncWorker(worker, obj),
+            wait_for_state(t, worker, 'installed')
+          ]).then(function() {
               assert_true(
                 obj.synced,
                 'state should be "installed" after the waitUntil promise ' +
                     'for "oninstall" is fulfilled.');
               service_worker_unregister_and_done(t, scope);
-            })
-          .catch(unreached_rejection(t));
-        syncWorker(t, worker, obj);
+            });
       };
-    runTest(t, scope, onRegister);
+    return runTest(t, scope, onRegister);
   }, 'Test install event waitUntil fulfilled');
 
-async_test(function(t) {
+promise_test(function(t) {
     var scope = 'resources/install-multiple-fulfilled';
     var onRegister = function(worker) {
         var obj1 = {};
         var obj2 = {};
-        wait_for_state(t, worker, 'installed')
-          .then(function() {
+
+        return Promise.all([
+            syncWorker(worker, obj1),
+            syncWorker(worker, obj2),
+            wait_for_state(t, worker, 'installed')
+          ]).then(function() {
               assert_true(
                 obj1.synced && obj2.synced,
                 'state should be "installed" after all waitUntil promises ' +
                     'for "oninstall" are fulfilled.');
-              service_worker_unregister_and_done(t, scope);
-            })
-          .catch(unreached_rejection(t));
-        syncWorker(t, worker, obj1);
-        syncWorker(t, worker, obj2);
+            });
       };
-    runTest(t, scope, onRegister);
+    return runTest(t, scope, onRegister);
   }, 'Test ExtendableEvent multiple waitUntil fulfilled.');
 
-async_test(function(t) {
+promise_test(function(t) {
     var scope = 'resources/install-reject-precedence';
     var onRegister = function(worker) {
         var obj1 = {};
         var obj2 = {};
-        wait_for_state(t, worker, 'redundant')
-          .then(function() {
+
+        return Promise.all([
+            syncWorker(worker, obj1)
+              .then(function() {
+                  syncWorker(worker, obj2);
+                }),
+            wait_for_state(t, worker, 'redundant')
+          ]).then(function() {
               assert_true(
                 obj1.synced,
                 'The "redundant" state was entered after the first "extend ' +
@@ -85,61 +95,46 @@ async_test(function(t) {
                 'The "redundant" state was entered after the third "extend ' +
                   'lifetime promise" resolved.'
               );
-              service_worker_unregister_and_done(t, scope);
-            })
-          .catch(unreached_rejection(t));
-
-        syncWorker(t, worker, obj1)
-          .then(function() {
-              syncWorker(t, worker, obj2);
             });
       };
-    runTest(t, scope, onRegister);
+    return runTest(t, scope, onRegister);
   }, 'Test ExtendableEvent waitUntil reject precedence.');
 
-async_test(function(t) {
+promise_test(function(t) {
     var scope = 'resources/activate-fulfilled';
     var onRegister = function(worker) {
         var obj = {};
-        wait_for_state(t, worker, 'activating')
+        return wait_for_state(t, worker, 'activating')
           .then(function() {
-              syncWorker(t, worker, obj);
-              return wait_for_state(t, worker, 'activated');
+              return Promise.all([
+                syncWorker(worker, obj),
+                wait_for_state(t, worker, 'activated')
+              ]);
             })
           .then(function() {
               assert_true(
                 obj.synced,
                 'state should be "activated" after the waitUntil promise ' +
                     'for "onactivate" is fulfilled.');
-              service_worker_unregister_and_done(t, scope);
-            })
-          .catch(unreached_rejection(t));
+            });
       };
-    runTest(t, scope, onRegister);
+    return runTest(t, scope, onRegister);
   }, 'Test activate event waitUntil fulfilled');
 
-async_test(function(t) {
+promise_test(function(t) {
     var scope = 'resources/install-rejected';
     var onRegister = function(worker) {
-        wait_for_state(t, worker, 'redundant')
-          .then(function() {
-              service_worker_unregister_and_done(t, scope);
-            })
-          .catch(unreached_rejection(t));
+        return wait_for_state(t, worker, 'redundant');
       };
-    runTest(t, scope, onRegister);
+    return runTest(t, scope, onRegister);
   }, 'Test install event waitUntil rejected');
 
-async_test(function(t) {
+promise_test(function(t) {
     var scope = 'resources/activate-rejected';
     var onRegister = function(worker) {
-        wait_for_state(t, worker, 'activated')
-          .then(function() {
-              service_worker_unregister_and_done(t, scope);
-            })
-          .catch(unreached_rejection(t));
+        return wait_for_state(t, worker, 'activated');
       };
-    runTest(t, scope, onRegister);
+    return runTest(t, scope, onRegister);
   }, 'Test activate event waitUntil rejected.');
 
 </script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-audio-tainting.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-audio-tainting.https-expected.txt
new file mode 100644 (file)
index 0000000..498f413
--- /dev/null
@@ -0,0 +1,4 @@
+
+
+FAIL Verify CORS XHR of fetch() in a Service Worker promise_test: Unhandled rejection with value: object "TypeError: undefined is not a constructor (evaluating 'new win.AudioContext()')"
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-audio-tainting.https.html b/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-audio-tainting.https.html
new file mode 100644 (file)
index 0000000..9821759
--- /dev/null
@@ -0,0 +1,47 @@
+<!doctype html>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/get-host-info.sub.js"></script>
+<script src="resources/test-helpers.sub.js?pipe=sub"></script>
+<script>
+promise_test(async (t) => {
+    const SCOPE = 'resources/empty.html';
+    const SCRIPT = 'resources/fetch-rewrite-worker.js';
+    const host_info = get_host_info();
+    const REMOTE_ORIGIN = host_info.HTTPS_REMOTE_ORIGIN;
+
+    const reg = await service_worker_unregister_and_register(t, SCRIPT, SCOPE);
+    await wait_for_state(t, reg.installing, 'activated');
+    const frame = await with_iframe(SCOPE);
+
+    const doc = frame.contentDocument;
+    const win = frame.contentWindow;
+
+    const context = new win.AudioContext();
+    try {
+      context.suspend();
+      const audio = doc.createElement('audio');
+      audio.autoplay = true;
+      const source = context.createMediaElementSource(audio);
+      const spn = context.createScriptProcessor(16384, 1, 1);
+      source.connect(spn).connect(context.destination);
+      const url = `${REMOTE_ORIGIN}/webaudio/resources/sin_440Hz_-6dBFS_1s.wav`;
+      audio.src = '/test?url=' + encodeURIComponent(url);
+      doc.body.appendChild(audio);
+
+      await new Promise((resolve) => {
+        audio.addEventListener('playing', resolve);
+      });
+      await context.resume();
+      const event = await new Promise((resolve) => {
+        spn.addEventListener('audioprocess', resolve);
+      });
+      const data = event.inputBuffer.getChannelData(0);
+      for (const e of data) {
+        assert_equals(e, 0);
+      }
+    } finally {
+      context.close();
+    }
+  }, 'Verify CORS XHR of fetch() in a Service Worker');
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-canvas-tainting-cache.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-canvas-tainting-cache.https-expected.txt
deleted file mode 100644 (file)
index 03c0b43..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-
-PASS Verify canvas tainting of fetched image in a Service Worker 
-PASS https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&reject&cache - default 
-PASS https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&reject&cache - anonymous 
-PASS https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&reject&cache - use-credentials 
-PASS https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&ignore&cache - default 
-PASS https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&ignore&cache - default 
-PASS https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&ignore&cache - anonymous 
-PASS https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&ACAOrigin=https://localhost:9443&ignore&cache - anonymous 
-PASS https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&ignore&cache - use-credentials 
-PASS https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&ACAOrigin=https://localhost:9443&ignore&cache - use-credentials 
-PASS https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&ACAOrigin=https://localhost:9443&ACACredentials=true&ignore&cache - use-credentials 
-PASS https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&Auth&ignore&cache - default 
-PASS https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&Auth&ignore&cache - default 
-PASS https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&Auth&ignore&cache - anonymous 
-PASS https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&Auth&ignore&cache - use-credentials 
-PASS https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&Auth&ACAOrigin=https://localhost:9443&ignore&cache - use-credentials 
-PASS https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&Auth&ACAOrigin=https://localhost:9443&ACACredentials=true&ignore&cache - use-credentials 
-PASS https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&mode=same-origin&url=https%3A%2F%2Flocalhost%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE&cache - default 
-PASS https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&mode=same-origin&url=https%3A%2F%2Flocalhost%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE&cache - anonymous 
-PASS https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&mode=same-origin&url=https%3A%2F%2Flocalhost%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE&cache - use-credentials 
-PASS https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&mode=same-origin&url=https%3A%2F%2Flocalhost%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE&cache - default 
-PASS https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&mode=same-origin&url=https%3A%2F%2Flocalhost%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE&cache - anonymous 
-PASS https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&mode=same-origin&url=https%3A%2F%2Flocalhost%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE&cache - use-credentials 
-PASS https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&mode=no-cors&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE&cache - default 
-PASS https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&mode=no-cors&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE&cache - anonymous 
-PASS https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&mode=no-cors&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE&cache - use-credentials 
-PASS https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&mode=no-cors&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE&cache - default 
-PASS https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&mode=no-cors&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE&cache - anonymous 
-PASS https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&mode=no-cors&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE&cache - use-credentials 
-PASS https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&mode=cors&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE%26ACAOrigin%3Dhttps%3A%2F%2Flocalhost%3A9443&cache - default 
-PASS https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&mode=cors&credentials=same-origin&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE%26ACAOrigin%3Dhttps%3A%2F%2Flocalhost%3A9443&cache - default 
-PASS https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&mode=cors&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE%26ACAOrigin%3Dhttps%3A%2F%2Flocalhost%3A9443&cache - anonymous 
-PASS https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&mode=cors&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE%26ACAOrigin%3Dhttps%3A%2F%2Flocalhost%3A9443&cache - use-credentials 
-PASS https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&mode=cors&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE%26ACACredentials%3Dtrue%26ACAOrigin%3Dhttps%3A%2F%2Flocalhost%3A9443&cache - use-credentials 
-PASS https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&mode=cors&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE%26ACAOrigin%3Dhttps%3A%2F%2Flocalhost%3A9443&cache - default 
-PASS https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&mode=cors&credentials=same-origin&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE%26ACAOrigin%3Dhttps%3A%2F%2Flocalhost%3A9443&cache - default 
-PASS https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&mode=cors&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE%26ACAOrigin%3Dhttps%3A%2F%2Flocalhost%3A9443&cache - anonymous 
-PASS https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&mode=cors&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE%26ACAOrigin%3Dhttps%3A%2F%2Flocalhost%3A9443&cache - use-credentials 
-PASS https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&mode=cors&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE%26ACACredentials%3Dtrue%26ACAOrigin%3Dhttps%3A%2F%2Flocalhost%3A9443&cache - use-credentials 
-
diff --git a/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-canvas-tainting-cache.https.html b/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-canvas-tainting-cache.https.html
deleted file mode 100644 (file)
index e91f97e..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-<!DOCTYPE html>
-<title>Service Worker: canvas tainting of the fetched image using cached responses</title>
-<script src="/resources/testharness.js"></script>
-<script src="/resources/testharnessreport.js"></script>
-<script src="/common/get-host-info.sub.js"></script>
-<script src="resources/test-helpers.sub.js?pipe=sub"></script>
-<body>
-<script>
-async_test(function(t) {
-    var SCOPE = 'resources/fetch-canvas-tainting-iframe.html?cache';
-    var SCRIPT = 'resources/fetch-rewrite-worker.js';
-    var host_info = get_host_info();
-
-    login_https(t)
-      .then(function() {
-          return service_worker_unregister_and_register(t, SCRIPT, SCOPE);
-        })
-      .then(function(registration) {
-          return wait_for_state(t, registration.installing, 'activated');
-        })
-      .then(function() { return with_iframe(SCOPE); })
-      .then(function(frame) {
-          return new Promise(function(resolve, reject) {
-              var channel = new MessageChannel();
-              channel.port1.onmessage = t.step_func(function(e) {
-                  for (var result of e.data.results) {
-                      test(() => {
-                        assert_equals(result.result, "PASS");
-                      }, result.name);
-                  }
-                  frame.remove();
-                  service_worker_unregister_and_done(t, SCOPE);
-                });
-              frame.contentWindow.postMessage({},
-                                              host_info['HTTPS_ORIGIN'],
-                                              [channel.port2]);
-            });
-        })
-      .catch(unreached_rejection(t));
-  }, 'Verify canvas tainting of fetched image in a Service Worker');
-</script>
-</body>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-canvas-tainting-double-write.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-canvas-tainting-double-write.https-expected.txt
new file mode 100644 (file)
index 0000000..914e1df
--- /dev/null
@@ -0,0 +1,3 @@
+
+PASS canvas is tainted after writing both a non-opaque image and an opaque image from the same URL 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-canvas-tainting-double-write.https.html b/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-canvas-tainting-double-write.https.html
new file mode 100644 (file)
index 0000000..4e23305
--- /dev/null
@@ -0,0 +1,57 @@
+<!DOCTYPE html>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/get-host-info.sub.js"></script>
+<script src="resources/test-helpers.sub.js"></script>
+<meta charset="utf-8">
+<title>canvas tainting when written twice</title>
+<script>
+function loadImage(doc, url) {
+  return new Promise((resolve, reject) => {
+    const image = doc.createElement('img');
+    image.onload = () => { resolve(image); }
+    image.onerror = () => { reject('failed to load: ' + url); };
+    image.src = url;
+  });
+}
+
+// Tests that a canvas is tainted after it's written to with both a clear image
+// and opaque image from the same URL. A bad implementation might cache the
+// info of the clear image and assume the opaque image is also clear because
+// it's from the same URL. See https://crbug.com/907047 for details.
+promise_test(async (t) => {
+  // Set up a service worker and a controlled iframe.
+  const script = 'resources/fetch-canvas-tainting-double-write-worker.js';
+  const scope = 'resources/fetch-canvas-tainting-double-write-iframe.html';
+  const registration = await service_worker_unregister_and_register(
+      t, script, scope);
+  t.add_cleanup(() => registration.unregister());
+  await wait_for_state(t, registration.installing, 'activated');
+  const iframe = await with_iframe(scope);
+  t.add_cleanup(() => iframe.remove());
+
+  // Load the same cross-origin image URL through the controlled iframe and
+  // this uncontrolled frame. The service worker responds with a same-origin
+  // image for the controlled iframe, so it is cleartext.
+  const imagePath = base_path() + 'resources/fetch-access-control.py?PNGIMAGE';
+  const imageUrl = get_host_info()['HTTPS_REMOTE_ORIGIN'] + imagePath;
+  const clearImage = await loadImage(iframe.contentDocument, imageUrl);
+  const opaqueImage = await loadImage(document, imageUrl);
+
+  // Set up a canvas for testing tainting.
+  const canvas = document.createElement('canvas');
+  const context = canvas.getContext('2d');
+  canvas.width = clearImage.width;
+  canvas.height = clearImage.height;
+
+  // The clear image and the opaque image have the same src URL. But...
+
+  // ... the clear image doesn't taint the canvas.
+  context.drawImage(clearImage, 0, 0);
+  assert_true(canvas.toDataURL().length > 0);
+
+  // ... the opaque image taints the canvas.
+  context.drawImage(opaqueImage, 0, 0);
+  assert_throws('SecurityError', () => { canvas.toDataURL(); });
+}, 'canvas is tainted after writing both a non-opaque image and an opaque image from the same URL');
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-canvas-tainting-image-cache.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-canvas-tainting-image-cache.https-expected.txt
new file mode 100644 (file)
index 0000000..3e5ec79
--- /dev/null
@@ -0,0 +1,72 @@
+CONSOLE MESSAGE: FetchEvent.respondWith received an error: undefined
+CONSOLE MESSAGE: Cannot load https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&cache=true&reject.
+CONSOLE MESSAGE: FetchEvent.respondWith received an error: undefined
+CONSOLE MESSAGE: Cannot load https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&cache=true&reject.
+CONSOLE MESSAGE: FetchEvent.respondWith received an error: undefined
+CONSOLE MESSAGE: Cannot load https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&cache=true&reject.
+CONSOLE MESSAGE: line 26: Unable to get image data from canvas because the canvas has been tainted by cross-origin data.
+CONSOLE MESSAGE: Origin https://localhost:9443 is not allowed by Access-Control-Allow-Origin.
+CONSOLE MESSAGE: Cannot load image https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&cache=true&ignore due to access control checks.
+CONSOLE MESSAGE: Origin https://localhost:9443 is not allowed by Access-Control-Allow-Origin.
+CONSOLE MESSAGE: Cannot load image https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&cache=true&ignore due to access control checks.
+CONSOLE MESSAGE: Credentials flag is true, but Access-Control-Allow-Credentials is not "true".
+CONSOLE MESSAGE: Cannot load image https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&cache=true&ACAOrigin=https://localhost:9443&ignore due to access control checks.
+CONSOLE MESSAGE: line 26: Unable to get image data from canvas because the canvas has been tainted by cross-origin data.
+CONSOLE MESSAGE: Blocked https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&cache=true&Auth&ignore from asking for credentials because it is a cross-origin request.
+CONSOLE MESSAGE: Origin https://localhost:9443 is not allowed by Access-Control-Allow-Origin.
+CONSOLE MESSAGE: Cannot load image https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&cache=true&Auth&ignore due to access control checks.
+CONSOLE MESSAGE: Origin https://localhost:9443 is not allowed by Access-Control-Allow-Origin.
+CONSOLE MESSAGE: Cannot load image https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&cache=true&Auth&ignore due to access control checks.
+CONSOLE MESSAGE: Credentials flag is true, but Access-Control-Allow-Credentials is not "true".
+CONSOLE MESSAGE: Cannot load image https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&cache=true&Auth&ACAOrigin=https://localhost:9443&ignore due to access control checks.
+CONSOLE MESSAGE: line 26: Unable to get image data from canvas because the canvas has been tainted by cross-origin data.
+CONSOLE MESSAGE: Response served by service worker is opaque
+CONSOLE MESSAGE: Cannot load image https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&cache=true&mode=no-cors&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE%26cache%3Dtrue due to access control checks.
+CONSOLE MESSAGE: Response served by service worker is opaque
+CONSOLE MESSAGE: Cannot load image https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&cache=true&mode=no-cors&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE%26cache%3Dtrue due to access control checks.
+CONSOLE MESSAGE: line 26: Unable to get image data from canvas because the canvas has been tainted by cross-origin data.
+
+Harness Error (TIMEOUT), message = null
+
+PASS initialize global state 
+PASS url "https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&cache=true&reject" with crossOrigin "" should be LOAD_ERROR 
+PASS url "https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&cache=true&reject" with crossOrigin "anonymous" should be LOAD_ERROR 
+PASS url "https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&cache=true&reject" with crossOrigin "use-credentials" should be LOAD_ERROR 
+PASS url "https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&cache=true&ignore" with crossOrigin "" should be NOT_TAINTED 
+PASS url "https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&cache=true&ignore" with crossOrigin "" should be TAINTED 
+PASS url "https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&cache=true&ignore" with crossOrigin "anonymous" should be LOAD_ERROR 
+PASS url "https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&cache=true&ACAOrigin=https://localhost:9443&ignore" with crossOrigin "anonymous" should be NOT_TAINTED 
+PASS url "https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&cache=true&ignore" with crossOrigin "use-credentials" should be LOAD_ERROR 
+PASS url "https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&cache=true&ACAOrigin=https://localhost:9443&ignore" with crossOrigin "use-credentials" should be LOAD_ERROR 
+PASS url "https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&cache=true&ACAOrigin=https://localhost:9443&ACACredentials=true&ignore" with crossOrigin "use-credentials" should be NOT_TAINTED 
+PASS url "https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&cache=true&Auth&ignore" with crossOrigin "" should be NOT_TAINTED 
+PASS url "https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&cache=true&Auth&ignore" with crossOrigin "" should be TAINTED 
+PASS url "https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&cache=true&Auth&ignore" with crossOrigin "anonymous" should be LOAD_ERROR 
+PASS url "https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&cache=true&Auth&ignore" with crossOrigin "use-credentials" should be LOAD_ERROR 
+PASS url "https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&cache=true&Auth&ACAOrigin=https://localhost:9443&ignore" with crossOrigin "use-credentials" should be LOAD_ERROR 
+PASS url "https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&cache=true&Auth&ACAOrigin=https://localhost:9443&ACACredentials=true&ignore" with crossOrigin "use-credentials" should be NOT_TAINTED 
+PASS url "https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&cache=true&mode=same-origin&url=https%3A%2F%2Flocalhost%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE%26cache%3Dtrue" with crossOrigin "" should be NOT_TAINTED 
+PASS url "https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&cache=true&mode=same-origin&url=https%3A%2F%2Flocalhost%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE%26cache%3Dtrue" with crossOrigin "anonymous" should be NOT_TAINTED 
+PASS url "https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&cache=true&mode=same-origin&url=https%3A%2F%2Flocalhost%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE%26cache%3Dtrue" with crossOrigin "use-credentials" should be NOT_TAINTED 
+PASS url "https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&cache=true&mode=same-origin&url=https%3A%2F%2Flocalhost%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE%26cache%3Dtrue" with crossOrigin "" should be NOT_TAINTED 
+PASS url "https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&cache=true&mode=same-origin&url=https%3A%2F%2Flocalhost%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE%26cache%3Dtrue" with crossOrigin "anonymous" should be NOT_TAINTED 
+PASS url "https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&cache=true&mode=same-origin&url=https%3A%2F%2Flocalhost%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE%26cache%3Dtrue" with crossOrigin "use-credentials" should be NOT_TAINTED 
+PASS url "https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&cache=true&mode=no-cors&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE%26cache%3Dtrue" with crossOrigin "" should be TAINTED 
+PASS url "https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&cache=true&mode=no-cors&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE%26cache%3Dtrue" with crossOrigin "anonymous" should be LOAD_ERROR 
+PASS url "https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&cache=true&mode=no-cors&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE%26cache%3Dtrue" with crossOrigin "use-credentials" should be LOAD_ERROR 
+PASS url "https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&cache=true&mode=no-cors&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE%26cache%3Dtrue" with crossOrigin "" should be TAINTED 
+TIMEOUT url "https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&cache=true&mode=no-cors&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE%26cache%3Dtrue" with crossOrigin "anonymous" should be LOAD_ERROR Test timed out
+NOTRUN url "https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&cache=true&mode=no-cors&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE%26cache%3Dtrue" with crossOrigin "use-credentials" should be LOAD_ERROR 
+NOTRUN url "https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&cache=true&mode=cors&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE%26cache%3Dtrue%26ACAOrigin%3Dhttps%3A%2F%2Flocalhost%3A9443" with crossOrigin "" should be LOAD_ERROR 
+NOTRUN url "https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&cache=true&mode=cors&credentials=same-origin&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE%26cache%3Dtrue%26ACAOrigin%3Dhttps%3A%2F%2Flocalhost%3A9443" with crossOrigin "" should be NOT_TAINTED 
+NOTRUN url "https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&cache=true&mode=cors&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE%26cache%3Dtrue%26ACAOrigin%3Dhttps%3A%2F%2Flocalhost%3A9443" with crossOrigin "anonymous" should be NOT_TAINTED 
+NOTRUN url "https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&cache=true&mode=cors&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE%26cache%3Dtrue%26ACAOrigin%3Dhttps%3A%2F%2Flocalhost%3A9443" with crossOrigin "use-credentials" should be LOAD_ERROR 
+NOTRUN url "https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&cache=true&mode=cors&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE%26cache%3Dtrue%26ACACredentials%3Dtrue%26ACAOrigin%3Dhttps%3A%2F%2Flocalhost%3A9443" with crossOrigin "use-credentials" should be NOT_TAINTED 
+NOTRUN url "https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&cache=true&mode=cors&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE%26cache%3Dtrue%26ACAOrigin%3Dhttps%3A%2F%2Flocalhost%3A9443" with crossOrigin "" should be LOAD_ERROR 
+NOTRUN url "https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&cache=true&mode=cors&credentials=same-origin&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE%26cache%3Dtrue%26ACAOrigin%3Dhttps%3A%2F%2Flocalhost%3A9443" with crossOrigin "" should be NOT_TAINTED 
+NOTRUN url "https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&cache=true&mode=cors&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE%26cache%3Dtrue%26ACAOrigin%3Dhttps%3A%2F%2Flocalhost%3A9443" with crossOrigin "anonymous" should be NOT_TAINTED 
+NOTRUN url "https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&cache=true&mode=cors&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE%26cache%3Dtrue%26ACAOrigin%3Dhttps%3A%2F%2Flocalhost%3A9443" with crossOrigin "use-credentials" should be LOAD_ERROR 
+NOTRUN url "https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&cache=true&mode=cors&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE%26cache%3Dtrue%26ACACredentials%3Dtrue%26ACAOrigin%3Dhttps%3A%2F%2Flocalhost%3A9443" with crossOrigin "use-credentials" should be NOT_TAINTED 
+NOTRUN restore global state 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-canvas-tainting-image-cache.https.html b/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-canvas-tainting-image-cache.https.html
new file mode 100644 (file)
index 0000000..2132381
--- /dev/null
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>Service Worker: canvas tainting of the fetched image using cached responses</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/get-host-info.sub.js"></script>
+<script src="resources/test-helpers.sub.js?pipe=sub"></script>
+<script src="resources/fetch-canvas-tainting-tests.js"></script>
+<body>
+<script>
+do_canvas_tainting_tests({
+  resource_path: base_path() + 'resources/fetch-access-control.py?PNGIMAGE',
+  cache: true
+});
+</script>
+</body>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-canvas-tainting-image.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-canvas-tainting-image.https-expected.txt
new file mode 100644 (file)
index 0000000..ce3e0f9
--- /dev/null
@@ -0,0 +1,81 @@
+CONSOLE MESSAGE: FetchEvent.respondWith received an error: undefined
+CONSOLE MESSAGE: Cannot load https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&reject.
+CONSOLE MESSAGE: FetchEvent.respondWith received an error: undefined
+CONSOLE MESSAGE: Cannot load https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&reject.
+CONSOLE MESSAGE: FetchEvent.respondWith received an error: undefined
+CONSOLE MESSAGE: Cannot load https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&reject.
+CONSOLE MESSAGE: line 26: Unable to get image data from canvas because the canvas has been tainted by cross-origin data.
+CONSOLE MESSAGE: Origin https://localhost:9443 is not allowed by Access-Control-Allow-Origin.
+CONSOLE MESSAGE: Cannot load image https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&ignore due to access control checks.
+CONSOLE MESSAGE: Origin https://localhost:9443 is not allowed by Access-Control-Allow-Origin.
+CONSOLE MESSAGE: Cannot load image https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&ignore due to access control checks.
+CONSOLE MESSAGE: Credentials flag is true, but Access-Control-Allow-Credentials is not "true".
+CONSOLE MESSAGE: Cannot load image https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&ACAOrigin=https://localhost:9443&ignore due to access control checks.
+CONSOLE MESSAGE: line 26: Unable to get image data from canvas because the canvas has been tainted by cross-origin data.
+CONSOLE MESSAGE: Blocked https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&Auth&ignore from asking for credentials because it is a cross-origin request.
+CONSOLE MESSAGE: Origin https://localhost:9443 is not allowed by Access-Control-Allow-Origin.
+CONSOLE MESSAGE: Cannot load image https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&Auth&ignore due to access control checks.
+CONSOLE MESSAGE: Origin https://localhost:9443 is not allowed by Access-Control-Allow-Origin.
+CONSOLE MESSAGE: Cannot load image https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&Auth&ignore due to access control checks.
+CONSOLE MESSAGE: Credentials flag is true, but Access-Control-Allow-Credentials is not "true".
+CONSOLE MESSAGE: Cannot load image https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&Auth&ACAOrigin=https://localhost:9443&ignore due to access control checks.
+CONSOLE MESSAGE: line 26: Unable to get image data from canvas because the canvas has been tainted by cross-origin data.
+CONSOLE MESSAGE: Response served by service worker is opaque
+CONSOLE MESSAGE: Cannot load image https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&mode=no-cors&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE due to access control checks.
+CONSOLE MESSAGE: Response served by service worker is opaque
+CONSOLE MESSAGE: Cannot load image https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&mode=no-cors&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE due to access control checks.
+CONSOLE MESSAGE: line 26: Unable to get image data from canvas because the canvas has been tainted by cross-origin data.
+CONSOLE MESSAGE: Response served by service worker is opaque
+CONSOLE MESSAGE: Cannot load image https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&mode=no-cors&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE due to access control checks.
+CONSOLE MESSAGE: Response served by service worker is opaque
+CONSOLE MESSAGE: Cannot load image https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&mode=no-cors&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE due to access control checks.
+CONSOLE MESSAGE: FetchEvent.respondWith received an error: TypeError: Credentials flag is true, but Access-Control-Allow-Credentials is not "true".
+CONSOLE MESSAGE: Cannot load https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&mode=cors&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE%26ACAOrigin%3Dhttps%3A%2F%2Flocalhost%3A9443.
+CONSOLE MESSAGE: FetchEvent.respondWith received an error: TypeError: Credentials flag is true, but Access-Control-Allow-Credentials is not "true".
+CONSOLE MESSAGE: Cannot load https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&mode=cors&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE%26ACAOrigin%3Dhttps%3A%2F%2Flocalhost%3A9443.
+CONSOLE MESSAGE: FetchEvent.respondWith received an error: TypeError: Credentials flag is true, but Access-Control-Allow-Credentials is not "true".
+CONSOLE MESSAGE: Cannot load https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&mode=cors&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE%26ACAOrigin%3Dhttps%3A%2F%2Flocalhost%3A9443.
+CONSOLE MESSAGE: FetchEvent.respondWith received an error: TypeError: Credentials flag is true, but Access-Control-Allow-Credentials is not "true".
+CONSOLE MESSAGE: Cannot load https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&mode=cors&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE%26ACAOrigin%3Dhttps%3A%2F%2Flocalhost%3A9443.
+
+PASS initialize global state 
+PASS url "https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&reject" with crossOrigin "" should be LOAD_ERROR 
+PASS url "https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&reject" with crossOrigin "anonymous" should be LOAD_ERROR 
+PASS url "https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&reject" with crossOrigin "use-credentials" should be LOAD_ERROR 
+PASS url "https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&ignore" with crossOrigin "" should be NOT_TAINTED 
+PASS url "https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&ignore" with crossOrigin "" should be TAINTED 
+PASS url "https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&ignore" with crossOrigin "anonymous" should be LOAD_ERROR 
+PASS url "https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&ACAOrigin=https://localhost:9443&ignore" with crossOrigin "anonymous" should be NOT_TAINTED 
+PASS url "https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&ignore" with crossOrigin "use-credentials" should be LOAD_ERROR 
+PASS url "https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&ACAOrigin=https://localhost:9443&ignore" with crossOrigin "use-credentials" should be LOAD_ERROR 
+PASS url "https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&ACAOrigin=https://localhost:9443&ACACredentials=true&ignore" with crossOrigin "use-credentials" should be NOT_TAINTED 
+PASS url "https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&Auth&ignore" with crossOrigin "" should be NOT_TAINTED 
+PASS url "https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&Auth&ignore" with crossOrigin "" should be TAINTED 
+PASS url "https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&Auth&ignore" with crossOrigin "anonymous" should be LOAD_ERROR 
+PASS url "https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&Auth&ignore" with crossOrigin "use-credentials" should be LOAD_ERROR 
+PASS url "https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&Auth&ACAOrigin=https://localhost:9443&ignore" with crossOrigin "use-credentials" should be LOAD_ERROR 
+PASS url "https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&Auth&ACAOrigin=https://localhost:9443&ACACredentials=true&ignore" with crossOrigin "use-credentials" should be NOT_TAINTED 
+PASS url "https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&mode=same-origin&url=https%3A%2F%2Flocalhost%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE" with crossOrigin "" should be NOT_TAINTED 
+PASS url "https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&mode=same-origin&url=https%3A%2F%2Flocalhost%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE" with crossOrigin "anonymous" should be NOT_TAINTED 
+PASS url "https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&mode=same-origin&url=https%3A%2F%2Flocalhost%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE" with crossOrigin "use-credentials" should be NOT_TAINTED 
+PASS url "https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&mode=same-origin&url=https%3A%2F%2Flocalhost%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE" with crossOrigin "" should be NOT_TAINTED 
+PASS url "https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&mode=same-origin&url=https%3A%2F%2Flocalhost%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE" with crossOrigin "anonymous" should be NOT_TAINTED 
+PASS url "https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&mode=same-origin&url=https%3A%2F%2Flocalhost%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE" with crossOrigin "use-credentials" should be NOT_TAINTED 
+PASS url "https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&mode=no-cors&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE" with crossOrigin "" should be TAINTED 
+PASS url "https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&mode=no-cors&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE" with crossOrigin "anonymous" should be LOAD_ERROR 
+PASS url "https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&mode=no-cors&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE" with crossOrigin "use-credentials" should be LOAD_ERROR 
+PASS url "https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&mode=no-cors&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE" with crossOrigin "" should be TAINTED 
+PASS url "https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&mode=no-cors&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE" with crossOrigin "anonymous" should be LOAD_ERROR 
+PASS url "https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&mode=no-cors&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE" with crossOrigin "use-credentials" should be LOAD_ERROR 
+PASS url "https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&mode=cors&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE%26ACAOrigin%3Dhttps%3A%2F%2Flocalhost%3A9443" with crossOrigin "" should be LOAD_ERROR 
+PASS url "https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&mode=cors&credentials=same-origin&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE%26ACAOrigin%3Dhttps%3A%2F%2Flocalhost%3A9443" with crossOrigin "" should be NOT_TAINTED 
+PASS url "https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&mode=cors&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE%26ACAOrigin%3Dhttps%3A%2F%2Flocalhost%3A9443" with crossOrigin "anonymous" should be NOT_TAINTED 
+PASS url "https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&mode=cors&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE%26ACAOrigin%3Dhttps%3A%2F%2Flocalhost%3A9443" with crossOrigin "use-credentials" should be LOAD_ERROR 
+PASS url "https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&mode=cors&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE%26ACACredentials%3Dtrue%26ACAOrigin%3Dhttps%3A%2F%2Flocalhost%3A9443" with crossOrigin "use-credentials" should be NOT_TAINTED 
+PASS url "https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&mode=cors&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE%26ACAOrigin%3Dhttps%3A%2F%2Flocalhost%3A9443" with crossOrigin "" should be LOAD_ERROR 
+PASS url "https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&mode=cors&credentials=same-origin&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE%26ACAOrigin%3Dhttps%3A%2F%2Flocalhost%3A9443" with crossOrigin "" should be NOT_TAINTED 
+PASS url "https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&mode=cors&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE%26ACAOrigin%3Dhttps%3A%2F%2Flocalhost%3A9443" with crossOrigin "anonymous" should be NOT_TAINTED 
+PASS url "https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&mode=cors&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE%26ACAOrigin%3Dhttps%3A%2F%2Flocalhost%3A9443" with crossOrigin "use-credentials" should be LOAD_ERROR 
+PASS url "https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&mode=cors&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE%26ACACredentials%3Dtrue%26ACAOrigin%3Dhttps%3A%2F%2Flocalhost%3A9443" with crossOrigin "use-credentials" should be NOT_TAINTED 
+PASS restore global state 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-canvas-tainting-image.https.html b/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-canvas-tainting-image.https.html
new file mode 100644 (file)
index 0000000..57dc7d9
--- /dev/null
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>Service Worker: canvas tainting of the fetched image</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/get-host-info.sub.js"></script>
+<script src="resources/test-helpers.sub.js?pipe=sub"></script>
+<script src="resources/fetch-canvas-tainting-tests.js"></script>
+<body>
+<script>
+do_canvas_tainting_tests({
+  resource_path: base_path() + 'resources/fetch-access-control.py?PNGIMAGE',
+  cache: false
+});
+</script>
+</body>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-canvas-tainting-video-cache.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-canvas-tainting-video-cache.https-expected.txt
new file mode 100644 (file)
index 0000000..aabde6f
--- /dev/null
@@ -0,0 +1,60 @@
+CONSOLE MESSAGE: FetchEvent.respondWith received an error: undefined
+CONSOLE MESSAGE: Cannot load https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?VIDEO&cache=true&reject.
+CONSOLE MESSAGE: FetchEvent.respondWith received an error: undefined
+CONSOLE MESSAGE: Cannot load https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?VIDEO&cache=true&reject.
+CONSOLE MESSAGE: FetchEvent.respondWith received an error: undefined
+CONSOLE MESSAGE: Cannot load https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?VIDEO&cache=true&reject.
+CONSOLE MESSAGE: Origin https://localhost:9443 is not allowed by Access-Control-Allow-Origin.
+CONSOLE MESSAGE: Origin https://localhost:9443 is not allowed by Access-Control-Allow-Origin.
+CONSOLE MESSAGE: Credentials flag is true, but Access-Control-Allow-Credentials is not "true".
+CONSOLE MESSAGE: Blocked https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?VIDEO&cache=true&Auth&ignore from asking for credentials because it is a cross-origin request.
+CONSOLE MESSAGE: Origin https://localhost:9443 is not allowed by Access-Control-Allow-Origin.
+CONSOLE MESSAGE: Origin https://localhost:9443 is not allowed by Access-Control-Allow-Origin.
+CONSOLE MESSAGE: Credentials flag is true, but Access-Control-Allow-Credentials is not "true".
+CONSOLE MESSAGE: Response served by service worker is opaque
+CONSOLE MESSAGE: Response served by service worker is opaque
+
+Harness Error (TIMEOUT), message = null
+
+PASS initialize global state 
+PASS url "https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?VIDEO&cache=true&reject" with crossOrigin "" should be LOAD_ERROR 
+PASS url "https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?VIDEO&cache=true&reject" with crossOrigin "anonymous" should be LOAD_ERROR 
+PASS url "https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?VIDEO&cache=true&reject" with crossOrigin "use-credentials" should be LOAD_ERROR 
+FAIL url "https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?VIDEO&cache=true&ignore" with crossOrigin "" should be NOT_TAINTED assert_equals: expected "NOT_TAINTED" but got "LOAD_ERROR"
+FAIL url "https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?VIDEO&cache=true&ignore" with crossOrigin "" should be TAINTED assert_equals: expected "TAINTED" but got "LOAD_ERROR"
+PASS url "https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?VIDEO&cache=true&ignore" with crossOrigin "anonymous" should be LOAD_ERROR 
+FAIL url "https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?VIDEO&cache=true&ACAOrigin=https://localhost:9443&ignore" with crossOrigin "anonymous" should be NOT_TAINTED assert_equals: expected "NOT_TAINTED" but got "LOAD_ERROR"
+PASS url "https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?VIDEO&cache=true&ignore" with crossOrigin "use-credentials" should be LOAD_ERROR 
+PASS url "https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?VIDEO&cache=true&ACAOrigin=https://localhost:9443&ignore" with crossOrigin "use-credentials" should be LOAD_ERROR 
+FAIL url "https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?VIDEO&cache=true&ACAOrigin=https://localhost:9443&ACACredentials=true&ignore" with crossOrigin "use-credentials" should be NOT_TAINTED assert_equals: expected "NOT_TAINTED" but got "LOAD_ERROR"
+FAIL url "https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?VIDEO&cache=true&Auth&ignore" with crossOrigin "" should be NOT_TAINTED assert_equals: expected "NOT_TAINTED" but got "LOAD_ERROR"
+FAIL url "https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?VIDEO&cache=true&Auth&ignore" with crossOrigin "" should be TAINTED assert_equals: expected "TAINTED" but got "LOAD_ERROR"
+PASS url "https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?VIDEO&cache=true&Auth&ignore" with crossOrigin "anonymous" should be LOAD_ERROR 
+PASS url "https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?VIDEO&cache=true&Auth&ignore" with crossOrigin "use-credentials" should be LOAD_ERROR 
+PASS url "https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?VIDEO&cache=true&Auth&ACAOrigin=https://localhost:9443&ignore" with crossOrigin "use-credentials" should be LOAD_ERROR 
+FAIL url "https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?VIDEO&cache=true&Auth&ACAOrigin=https://localhost:9443&ACACredentials=true&ignore" with crossOrigin "use-credentials" should be NOT_TAINTED assert_equals: expected "NOT_TAINTED" but got "LOAD_ERROR"
+FAIL url "https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?VIDEO&cache=true&mode=same-origin&url=https%3A%2F%2Flocalhost%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FVIDEO%26cache%3Dtrue" with crossOrigin "" should be NOT_TAINTED assert_equals: expected "NOT_TAINTED" but got "LOAD_ERROR"
+FAIL url "https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?VIDEO&cache=true&mode=same-origin&url=https%3A%2F%2Flocalhost%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FVIDEO%26cache%3Dtrue" with crossOrigin "anonymous" should be NOT_TAINTED assert_equals: expected "NOT_TAINTED" but got "LOAD_ERROR"
+FAIL url "https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?VIDEO&cache=true&mode=same-origin&url=https%3A%2F%2Flocalhost%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FVIDEO%26cache%3Dtrue" with crossOrigin "use-credentials" should be NOT_TAINTED assert_equals: expected "NOT_TAINTED" but got "LOAD_ERROR"
+FAIL url "https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?VIDEO&cache=true&mode=same-origin&url=https%3A%2F%2Flocalhost%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FVIDEO%26cache%3Dtrue" with crossOrigin "" should be NOT_TAINTED assert_equals: expected "NOT_TAINTED" but got "LOAD_ERROR"
+FAIL url "https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?VIDEO&cache=true&mode=same-origin&url=https%3A%2F%2Flocalhost%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FVIDEO%26cache%3Dtrue" with crossOrigin "anonymous" should be NOT_TAINTED assert_equals: expected "NOT_TAINTED" but got "LOAD_ERROR"
+FAIL url "https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?VIDEO&cache=true&mode=same-origin&url=https%3A%2F%2Flocalhost%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FVIDEO%26cache%3Dtrue" with crossOrigin "use-credentials" should be NOT_TAINTED assert_equals: expected "NOT_TAINTED" but got "LOAD_ERROR"
+FAIL url "https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?VIDEO&cache=true&mode=no-cors&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FVIDEO%26cache%3Dtrue" with crossOrigin "" should be TAINTED assert_equals: expected "TAINTED" but got "LOAD_ERROR"
+PASS url "https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?VIDEO&cache=true&mode=no-cors&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FVIDEO%26cache%3Dtrue" with crossOrigin "anonymous" should be LOAD_ERROR 
+PASS url "https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?VIDEO&cache=true&mode=no-cors&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FVIDEO%26cache%3Dtrue" with crossOrigin "use-credentials" should be LOAD_ERROR 
+FAIL url "https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?VIDEO&cache=true&mode=no-cors&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FVIDEO%26cache%3Dtrue" with crossOrigin "" should be TAINTED assert_equals: expected "TAINTED" but got "LOAD_ERROR"
+TIMEOUT url "https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?VIDEO&cache=true&mode=no-cors&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FVIDEO%26cache%3Dtrue" with crossOrigin "anonymous" should be LOAD_ERROR Test timed out
+NOTRUN url "https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?VIDEO&cache=true&mode=no-cors&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FVIDEO%26cache%3Dtrue" with crossOrigin "use-credentials" should be LOAD_ERROR 
+NOTRUN url "https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?VIDEO&cache=true&mode=cors&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FVIDEO%26cache%3Dtrue%26ACAOrigin%3Dhttps%3A%2F%2Flocalhost%3A9443" with crossOrigin "" should be LOAD_ERROR 
+NOTRUN url "https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?VIDEO&cache=true&mode=cors&credentials=same-origin&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FVIDEO%26cache%3Dtrue%26ACAOrigin%3Dhttps%3A%2F%2Flocalhost%3A9443" with crossOrigin "" should be NOT_TAINTED 
+NOTRUN url "https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?VIDEO&cache=true&mode=cors&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FVIDEO%26cache%3Dtrue%26ACAOrigin%3Dhttps%3A%2F%2Flocalhost%3A9443" with crossOrigin "anonymous" should be NOT_TAINTED 
+NOTRUN url "https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?VIDEO&cache=true&mode=cors&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FVIDEO%26cache%3Dtrue%26ACAOrigin%3Dhttps%3A%2F%2Flocalhost%3A9443" with crossOrigin "use-credentials" should be LOAD_ERROR 
+NOTRUN url "https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?VIDEO&cache=true&mode=cors&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FVIDEO%26cache%3Dtrue%26ACACredentials%3Dtrue%26ACAOrigin%3Dhttps%3A%2F%2Flocalhost%3A9443" with crossOrigin "use-credentials" should be NOT_TAINTED 
+NOTRUN url "https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?VIDEO&cache=true&mode=cors&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FVIDEO%26cache%3Dtrue%26ACAOrigin%3Dhttps%3A%2F%2Flocalhost%3A9443" with crossOrigin "" should be LOAD_ERROR 
+NOTRUN url "https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?VIDEO&cache=true&mode=cors&credentials=same-origin&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FVIDEO%26cache%3Dtrue%26ACAOrigin%3Dhttps%3A%2F%2Flocalhost%3A9443" with crossOrigin "" should be NOT_TAINTED 
+NOTRUN url "https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?VIDEO&cache=true&mode=cors&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FVIDEO%26cache%3Dtrue%26ACAOrigin%3Dhttps%3A%2F%2Flocalhost%3A9443" with crossOrigin "anonymous" should be NOT_TAINTED 
+NOTRUN url "https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?VIDEO&cache=true&mode=cors&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FVIDEO%26cache%3Dtrue%26ACAOrigin%3Dhttps%3A%2F%2Flocalhost%3A9443" with crossOrigin "use-credentials" should be LOAD_ERROR 
+NOTRUN url "https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?VIDEO&cache=true&mode=cors&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FVIDEO%26cache%3Dtrue%26ACACredentials%3Dtrue%26ACAOrigin%3Dhttps%3A%2F%2Flocalhost%3A9443" with crossOrigin "use-credentials" should be NOT_TAINTED 
+NOTRUN restore global state 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-canvas-tainting-video-cache.https.html b/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-canvas-tainting-video-cache.https.html
new file mode 100644 (file)
index 0000000..ef3d12b
--- /dev/null
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>Service Worker: canvas tainting of the fetched video using cache responses</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/get-host-info.sub.js"></script>
+<script src="resources/test-helpers.sub.js?pipe=sub"></script>
+<script src="resources/fetch-canvas-tainting-tests.js"></script>
+<body>
+<script>
+do_canvas_tainting_tests({
+  resource_path: base_path() + 'resources/fetch-access-control.py?VIDEO',
+  cache: true
+});
+</script>
+</body>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-canvas-tainting-video-with-range-request.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-canvas-tainting-video-with-range-request.https-expected.txt
new file mode 100644 (file)
index 0000000..af2dcf9
--- /dev/null
@@ -0,0 +1,5 @@
+#PID UNRESPONSIVE - com.apple.WebKit.WebContent.Development (pid 56600)
+FAIL: Timed out waiting for notifyDone to be called
+
+#EOF
+#EOF
diff --git a/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-canvas-tainting-video-with-range-request.https.html b/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-canvas-tainting-video-with-range-request.https.html
new file mode 100644 (file)
index 0000000..f1ff7ae
--- /dev/null
@@ -0,0 +1,93 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>Canvas tainting due to video whose responses are fetched via a service worker including range requests</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="resources/test-helpers.sub.js?pipe=sub"></script>
+<script src="/common/get-host-info.sub.js"></script>
+<body>
+<script>
+// These tests try to test canvas tainting due to a <video> element. The video
+// src URL is same-origin as the page, but the response is fetched via a service
+// worker that does tricky things like returning opaque responses from another
+// origin. Furthermore, this tests range requests so there are multiple
+// responses.
+//
+// We test range requests by having the server return 206 Partial Content to the
+// first request (which doesn't necessarily have a "Range" header or one with a
+// byte range). Then the <video> element automatically makes ranged requests
+// (the "Range" HTTP request header specifies a byte range). The server responds
+// to these with 206 Partial Content for the given range.
+function range_request_test(script, expected, description) {
+  promise_test(t => {
+      let frame;
+      let registration;
+      add_result_callback(() => {
+          if (frame) frame.remove();
+          if (registration) registration.unregister();
+        });
+
+      const scope = 'resources/fetch-canvas-tainting-iframe.html';
+      return service_worker_unregister_and_register(t, script, scope)
+        .then(r => {
+            registration = r;
+            return wait_for_state(t, registration.installing, 'activated');
+          })
+        .then(() => {
+            return with_iframe(scope);
+          })
+        .then(f => {
+            frame = f;
+            // Add "?VIDEO&PartialContent" to get a video resource from the
+            // server using range requests.
+            const video_url = 'fetch-access-control.py?VIDEO&PartialContent';
+            return frame.contentWindow.create_test_case_promise(video_url);
+          })
+        .then(result => {
+            assert_equals(result, expected);
+          });
+    }, description);
+}
+
+// We want to consider a number of scenarios:
+// (1) Range responses come from a single origin, the same-origin as the page.
+//     The canvas should not be tainted.
+range_request_test(
+  'resources/fetch-event-network-fallback-worker.js',
+  'NOT_TAINTED',
+  'range responses from single origin (same-origin)');
+
+// (2) Range responses come from a single origin, cross-origin from the page
+//     (and without CORS sharing). This is not possible to test, since service
+//     worker can't make a request with a "Range" HTTP header in no-cors mode.
+
+// (3) Range responses come from multiple origins. The first response comes from
+//     cross-origin (and without CORS sharing, so is opaque). Subsequent
+//     responses come from same-origin. The canvas should be tainted (but in
+//     Chrome this is a LOAD_ERROR since it disallows range responses from
+//     multiple origins, period).
+range_request_test(
+  'resources/range-request-to-different-origins-worker.js',
+  'TAINTED',
+  'range responses from multiple origins (cross-origin first)');
+
+// (4) Range responses come from multiple origins. The first response comes from
+//     same-origin. Subsequent responses come from cross-origin (and without
+//     CORS sharing). Like (2) this is not possible since the service worker
+//     cannot make range requests cross-origin.
+
+// (5) Range responses come from a single origin, with a mix of opaque and
+//     non-opaque responses. The first request uses 'no-cors' mode to
+//     receive an opaque response, and subsequent range requests use 'cors'
+//     to receive non-opaque responses. The canvas should be tainted.
+range_request_test(
+  'resources/range-request-with-different-cors-modes-worker.js',
+  'TAINTED',
+  'range responses from single origin with both opaque and non-opaque responses');
+
+// (6) Range responses come from a single origin, with a mix of opaque and
+//     non-opaque responses. The first request uses 'cors' mode to
+//     receive an non-opaque response, and subsequent range requests use
+//     'no-cors' to receive non-opaque responses. Like (2) this is not possible.
+</script>
+</body>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-canvas-tainting-video.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-canvas-tainting-video.https-expected.txt
new file mode 100644 (file)
index 0000000..1180a5f
--- /dev/null
@@ -0,0 +1,30 @@
+CONSOLE MESSAGE: FetchEvent.respondWith received an error: undefined
+CONSOLE MESSAGE: Cannot load https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?VIDEO&reject.
+CONSOLE MESSAGE: FetchEvent.respondWith received an error: undefined
+CONSOLE MESSAGE: Cannot load https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?VIDEO&reject.
+CONSOLE MESSAGE: FetchEvent.respondWith received an error: undefined
+CONSOLE MESSAGE: Cannot load https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?VIDEO&reject.
+CONSOLE MESSAGE: Origin https://localhost:9443 is not allowed by Access-Control-Allow-Origin.
+CONSOLE MESSAGE: Origin https://localhost:9443 is not allowed by Access-Control-Allow-Origin.
+CONSOLE MESSAGE: Credentials flag is true, but Access-Control-Allow-Credentials is not "true".
+CONSOLE MESSAGE: Blocked https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?VIDEO&Auth&ignore from asking for credentials because it is a cross-origin request.
+CONSOLE MESSAGE: Origin https://localhost:9443 is not allowed by Access-Control-Allow-Origin.
+CONSOLE MESSAGE: Origin https://localhost:9443 is not allowed by Access-Control-Allow-Origin.
+CONSOLE MESSAGE: Credentials flag is true, but Access-Control-Allow-Credentials is not "true".
+CONSOLE MESSAGE: Response served by service worker is opaque
+CONSOLE MESSAGE: Response served by service worker is opaque
+CONSOLE MESSAGE: Response served by service worker is opaque
+CONSOLE MESSAGE: Response served by service worker is opaque
+CONSOLE MESSAGE: FetchEvent.respondWith received an error: TypeError: Credentials flag is true, but Access-Control-Allow-Credentials is not "true".
+CONSOLE MESSAGE: Cannot load https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?VIDEO&mode=cors&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FVIDEO%26ACAOrigin%3Dhttps%3A%2F%2Flocalhost%3A9443.
+CONSOLE MESSAGE: FetchEvent.respondWith received an error: TypeError: Credentials flag is true, but Access-Control-Allow-Credentials is not "true".
+CONSOLE MESSAGE: Cannot load https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?VIDEO&mode=cors&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FVIDEO%26ACAOrigin%3Dhttps%3A%2F%2Flocalhost%3A9443.
+CONSOLE MESSAGE: FetchEvent.respondWith received an error: TypeError: Credentials flag is true, but Access-Control-Allow-Credentials is not "true".
+CONSOLE MESSAGE: Cannot load https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?VIDEO&mode=cors&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FVIDEO%26ACAOrigin%3Dhttps%3A%2F%2Flocalhost%3A9443.
+CONSOLE MESSAGE: FetchEvent.respondWith received an error: TypeError: Credentials flag is true, but Access-Control-Allow-Credentials is not "true".
+CONSOLE MESSAGE: Cannot load https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?VIDEO&mode=cors&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FVIDEO%26ACAOrigin%3Dhttps%3A%2F%2Flocalhost%3A9443.
+#PID UNRESPONSIVE - com.apple.WebKit.WebContent.Development (pid 56823)
+FAIL: Timed out waiting for notifyDone to be called
+
+#EOF
+#EOF
diff --git a/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-canvas-tainting-video.https.html b/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-canvas-tainting-video.https.html
new file mode 100644 (file)
index 0000000..5776508
--- /dev/null
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>Service Worker: canvas tainting of the fetched video</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/get-host-info.sub.js"></script>
+<script src="resources/test-helpers.sub.js?pipe=sub"></script>
+<script src="resources/fetch-canvas-tainting-tests.js"></script>
+<body>
+<script>
+do_canvas_tainting_tests({
+  resource_path: base_path() + 'resources/fetch-access-control.py?VIDEO',
+  cache: false
+});
+</script>
+</body>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-canvas-tainting.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-canvas-tainting.https-expected.txt
deleted file mode 100644 (file)
index c44be04..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-
-PASS Verify canvas tainting of fetched image in a Service Worker 
-PASS https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&reject - default 
-PASS https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&reject - anonymous 
-PASS https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&reject - use-credentials 
-PASS https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&ignore - default 
-PASS https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&ignore - default 
-PASS https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&ignore - anonymous 
-PASS https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&ACAOrigin=https://localhost:9443&ignore - anonymous 
-PASS https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&ignore - use-credentials 
-PASS https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&ACAOrigin=https://localhost:9443&ignore - use-credentials 
-PASS https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&ACAOrigin=https://localhost:9443&ACACredentials=true&ignore - use-credentials 
-PASS https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&Auth&ignore - default 
-PASS https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&Auth&ignore - default 
-PASS https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&Auth&ignore - anonymous 
-PASS https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&Auth&ignore - use-credentials 
-PASS https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&Auth&ACAOrigin=https://localhost:9443&ignore - use-credentials 
-PASS https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&Auth&ACAOrigin=https://localhost:9443&ACACredentials=true&ignore - use-credentials 
-PASS https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&mode=same-origin&url=https%3A%2F%2Flocalhost%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE - default 
-PASS https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&mode=same-origin&url=https%3A%2F%2Flocalhost%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE - anonymous 
-PASS https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&mode=same-origin&url=https%3A%2F%2Flocalhost%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE - use-credentials 
-PASS https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&mode=same-origin&url=https%3A%2F%2Flocalhost%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE - default 
-PASS https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&mode=same-origin&url=https%3A%2F%2Flocalhost%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE - anonymous 
-PASS https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&mode=same-origin&url=https%3A%2F%2Flocalhost%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE - use-credentials 
-PASS https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&mode=no-cors&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE - default 
-PASS https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&mode=no-cors&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE - anonymous 
-PASS https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&mode=no-cors&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE - use-credentials 
-PASS https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&mode=no-cors&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE - default 
-PASS https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&mode=no-cors&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE - anonymous 
-PASS https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&mode=no-cors&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE - use-credentials 
-PASS https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&mode=cors&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE%26ACAOrigin%3Dhttps%3A%2F%2Flocalhost%3A9443 - default 
-PASS https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&mode=cors&credentials=same-origin&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE%26ACAOrigin%3Dhttps%3A%2F%2Flocalhost%3A9443 - default 
-PASS https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&mode=cors&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE%26ACAOrigin%3Dhttps%3A%2F%2Flocalhost%3A9443 - anonymous 
-PASS https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&mode=cors&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE%26ACAOrigin%3Dhttps%3A%2F%2Flocalhost%3A9443 - use-credentials 
-PASS https://localhost:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&mode=cors&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE%26ACACredentials%3Dtrue%26ACAOrigin%3Dhttps%3A%2F%2Flocalhost%3A9443 - use-credentials 
-PASS https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&mode=cors&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE%26ACAOrigin%3Dhttps%3A%2F%2Flocalhost%3A9443 - default 
-PASS https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&mode=cors&credentials=same-origin&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE%26ACAOrigin%3Dhttps%3A%2F%2Flocalhost%3A9443 - default 
-PASS https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&mode=cors&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE%26ACAOrigin%3Dhttps%3A%2F%2Flocalhost%3A9443 - anonymous 
-PASS https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&mode=cors&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE%26ACAOrigin%3Dhttps%3A%2F%2Flocalhost%3A9443 - use-credentials 
-PASS https://127.0.0.1:9443/service-workers/service-worker/resources/fetch-access-control.py?PNGIMAGE&mode=cors&url=https%3A%2F%2F127.0.0.1%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Ffetch-access-control.py%3FPNGIMAGE%26ACACredentials%3Dtrue%26ACAOrigin%3Dhttps%3A%2F%2Flocalhost%3A9443 - use-credentials 
-
diff --git a/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-canvas-tainting.https.html b/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-canvas-tainting.https.html
deleted file mode 100644 (file)
index 393fe27..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-<!DOCTYPE html>
-<title>Service Worker: canvas tainting of the fetched image</title>
-<script src="/resources/testharness.js"></script>
-<script src="/resources/testharnessreport.js"></script>
-<script src="/common/get-host-info.sub.js"></script>
-<script src="resources/test-helpers.sub.js?pipe=sub"></script>
-<body>
-<script>
-async_test(function(t) {
-    var SCOPE = 'resources/fetch-canvas-tainting-iframe.html';
-    var SCRIPT = 'resources/fetch-rewrite-worker.js';
-    var host_info = get_host_info();
-
-    login_https(t)
-      .then(function() {
-          return service_worker_unregister_and_register(t, SCRIPT, SCOPE);
-        })
-      .then(function(registration) {
-          return wait_for_state(t, registration.installing, 'activated');
-        })
-      .then(function() { return with_iframe(SCOPE); })
-      .then(function(frame) {
-          return new Promise(function(resolve, reject) {
-              var channel = new MessageChannel();
-              channel.port1.onmessage = t.step_func(function(e) {
-                  for (var result of e.data.results) {
-                      test(() => {
-                        assert_equals(result.result, "PASS");
-                      }, result.name);
-                  }
-                  frame.remove();
-                  service_worker_unregister_and_done(t, SCOPE);
-                });
-              frame.contentWindow.postMessage({},
-                                              host_info['HTTPS_ORIGIN'],
-                                              [channel.port2]);
-            });
-        })
-      .catch(unreached_rejection(t));
-  }, 'Verify canvas tainting of fetched image in a Service Worker');
-</script>
-</body>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-cors-exposed-header-names.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-cors-exposed-header-names.https-expected.txt
new file mode 100644 (file)
index 0000000..e3f07ec
--- /dev/null
@@ -0,0 +1,4 @@
+
+
+FAIL CORS-exposed header names for a response from sw assert_equals: expected (string) "bar" but got (object) null
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-cors-exposed-header-names.https.html b/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-cors-exposed-header-names.https.html
new file mode 100644 (file)
index 0000000..317b021
--- /dev/null
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<title>Service Worker: CORS-exposed header names should be transferred correctly</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/get-host-info.sub.js"></script>
+<script src="resources/test-helpers.sub.js"></script>
+<script>
+promise_test(async function(t) {
+    const SCOPE = 'resources/simple.html';
+    const SCRIPT = 'resources/fetch-cors-exposed-header-names-worker.js';
+    const host_info = get_host_info();
+
+    const URL = get_host_info().HTTPS_REMOTE_ORIGIN +
+      '/service-workers/service-worker/resources/simple.txt?pipe=' +
+      'header(access-control-allow-origin,*)|' +
+      'header(access-control-expose-headers,*)|' +
+      'header(foo,bar)|' +
+      'header(set-cookie,X)';
+
+    const reg = await service_worker_unregister_and_register(t, SCRIPT, SCOPE);
+    await wait_for_state(t, reg.installing, 'activated');
+    const frame = await with_iframe(SCOPE);
+
+    const response = await frame.contentWindow.fetch(URL);
+    const headers = response.headers;
+    assert_equals(headers.get('foo'), 'bar');
+    assert_equals(headers.get('set-cookie'), null);
+    assert_equals(headers.get('access-control-expose-headers'), '*');
+  }, 'CORS-exposed header names for a response from sw');
+</script>
index 521c01c..397cb81 100644 (file)
@@ -6,33 +6,39 @@
 <script src="resources/test-helpers.sub.js?pipe=sub"></script>
 <body>
 <script>
-async_test(function(t) {
+promise_test(function(t) {
     var SCOPE = 'resources/fetch-cors-xhr-iframe.html';
     var SCRIPT = 'resources/fetch-rewrite-worker.js';
     var host_info = get_host_info();
 
-    login_https(t)
+    return login_https(t)
       .then(function() {
           return service_worker_unregister_and_register(t, SCRIPT, SCOPE);
         })
       .then(function(registration) {
+          t.add_cleanup(function() {
+              return service_worker_unregister(t, SCOPE);
+            });
+
           return wait_for_state(t, registration.installing, 'activated');
         })
       .then(function() { return with_iframe(SCOPE); })
       .then(function(frame) {
+          t.add_cleanup(function() {
+              frame.remove();
+            });
+
           return new Promise(function(resolve, reject) {
               var channel = new MessageChannel();
-              channel.port1.onmessage = t.step_func(function(e) {
-                  assert_equals(e.data.results, 'finish');
-                  frame.remove();
-                  service_worker_unregister_and_done(t, SCOPE);
-                });
+              channel.port1.onmessage = resolve;
               frame.contentWindow.postMessage({},
                                               host_info['HTTPS_ORIGIN'],
                                               [channel.port2]);
             });
         })
-      .catch(unreached_rejection(t));
+      .then(function(e) {
+          assert_equals(e.data.results, 'finish');
+        });
   }, 'Verify CORS XHR of fetch() in a Service Worker');
 </script>
 </body>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-is-history-backward-navigation-manual.https.html b/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-is-history-backward-navigation-manual.https.html
new file mode 100644 (file)
index 0000000..3cf5922
--- /dev/null
@@ -0,0 +1,8 @@
+<!DOCTYPE html>
+<body>
+<p>Click <a href="resources/install-worker.html?isHistoryNavigation&amp;script=fetch-event-test-worker.js">this link</a>.
+   Once you see &quot;method = GET,...&quot; in the page, go to another page, and then go back to the page using the Backward button.
+   You should see &quot;method = GET, isHistoryNavigation = true&quot;.
+</p>
+</body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-is-history-forward-navigation-manual.https.html b/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-is-history-forward-navigation-manual.https.html
new file mode 100644 (file)
index 0000000..401939b
--- /dev/null
@@ -0,0 +1,8 @@
+<!DOCTYPE html>
+<body>
+<p>Click <a href="resources/install-worker.html?isHistoryNavigation&amp;script=fetch-event-test-worker.js">this link</a>.
+   Once you see &quot;method = GET,...&quot; in the page, go back to this page using the Backward button, and then go to the second page using the Forward button.
+   You should see &quot;method = GET, isHistoryNavigation = true&quot;.
+</p>
+</body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-is-reload-iframe-navigation-manual.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-is-reload-iframe-navigation-manual.https-expected.txt
new file mode 100644 (file)
index 0000000..656dfb7
--- /dev/null
@@ -0,0 +1,4 @@
+
+
+FAIL FetchEvent#request.isReloadNavigation is true for manual reload. assert_equals: expected "method = GET, isReloadNavigation = false" but got "method = GET, isReloadNavigation = undefined"
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-is-reload-iframe-navigation-manual.https.html b/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-is-reload-iframe-navigation-manual.https.html
new file mode 100644 (file)
index 0000000..cf1fecc
--- /dev/null
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/get-host-info.sub.js"></script>
+<script src="resources/test-helpers.sub.js"></script>
+<body>
+<script>
+const worker = 'resources/fetch-event-test-worker.js';
+
+promise_test(async (t) => {
+  const scope = 'resources/simple.html?isReloadNavigation';
+
+  const reg = await service_worker_unregister_and_register(t, worker, scope);
+  await wait_for_state(t, reg.installing, 'activated');
+  const frame = await with_iframe(scope);
+  assert_equals(frame.contentDocument.body.textContent,
+                'method = GET, isReloadNavigation = false');
+  await new Promise((resolve) => {
+    frame.addEventListener('load', resolve);
+    frame.contentDocument.body.innerText =
+      'Reload this frame manually!';
+  });
+  assert_equals(frame.contentDocument.body.textContent,
+      'method = GET, isReloadNavigation = true');
+  frame.remove();
+  await reg.unregister();
+}, 'FetchEvent#request.isReloadNavigation is true for manual reload.');
+
+</script>
+</body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-is-reload-navigation-manual.https.html b/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-is-reload-navigation-manual.https.html
new file mode 100644 (file)
index 0000000..a349f07
--- /dev/null
@@ -0,0 +1,8 @@
+<!DOCTYPE html>
+<body>
+<p>Click <a href="resources/install-worker.html?isReloadNavigation&script=fetch-event-test-worker.js">this link</a>.
+   Once you see &quot;method = GET,...&quot; in the page, reload the page.
+   You will see &quot;method = GET, isReloadNavigation = true&quot;.
+</p>
+</body>
+</html>
index 1dbc085..cb7c7cd 100644 (file)
@@ -1,6 +1,21 @@
-CONSOLE MESSAGE: line 51: No-Cors mode requires follow redirect mode
-CONSOLE MESSAGE: line 51: Not allowed to request resource
-CONSOLE MESSAGE: line 51: Fetch API cannot load https://localhost:9443/nonav-manual-nocors-redirects-to-sameorigin-nocreds?url=redirect.py%3FRedirect%3Dhttps%253A%252F%252Flocalhost%253A9443%252Fservice-workers%252Fservice-worker%252Fresources%252Fsuccess.py&expected_type=opaqueredirect due to access control checks.
+CONSOLE MESSAGE: line 55: No-Cors mode requires follow redirect mode
+CONSOLE MESSAGE: line 55: Not allowed to request resource
+CONSOLE MESSAGE: line 55: Fetch API cannot load https://localhost:9443/nonav-manual-nocors-redirects-to-sameorigin-nocreds?url=redirect.py%3FRedirect%3Dhttps%253A%252F%252Flocalhost%253A9443%252Fservice-workers%252Fservice-worker%252Fresources%252Fsuccess.py&expected_type=opaqueredirect due to access control checks.
+CONSOLE MESSAGE: line 55: No-Cors mode requires follow redirect mode
+CONSOLE MESSAGE: line 55: Not allowed to request resource
+CONSOLE MESSAGE: line 55: Fetch API cannot load https://localhost:9443/nonav-manual-nocors-redirects-to-nocors-nocreds?url=redirect.py%3FRedirect%3Dhttps%253A%252F%252F127.0.0.1%253A9443%252Fservice-workers%252Fservice-worker%252Fresources%252Fsuccess.py&expected_type=opaqueredirect due to access control checks.
+CONSOLE MESSAGE: line 55: No-Cors mode requires follow redirect mode
+CONSOLE MESSAGE: line 55: Not allowed to request resource
+CONSOLE MESSAGE: line 55: Fetch API cannot load https://localhost:9443/nonav-manual-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&expected_type=opaqueredirect due to access control checks.
+CONSOLE MESSAGE: line 55: No-Cors mode requires follow redirect mode
+CONSOLE MESSAGE: line 55: Not allowed to request resource
+CONSOLE MESSAGE: line 55: Fetch API cannot load https://localhost:9443/nonav-manual-nocors-redirects-to-sameorigin-creds?url=redirect.py%3FRedirect%3Dhttps%253A%252F%252Ffoo%253Abar%2540localhost%253A9443%252Fservice-workers%252Fservice-worker%252Fresources%252Fsuccess.py&expected_type=opaqueredirect due to access control checks.
+CONSOLE MESSAGE: line 55: No-Cors mode requires follow redirect mode
+CONSOLE MESSAGE: line 55: Not allowed to request resource
+CONSOLE MESSAGE: line 55: Fetch API cannot load https://localhost:9443/nonav-manual-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&expected_type=opaqueredirect due to access control checks.
+CONSOLE MESSAGE: line 55: No-Cors mode requires follow redirect mode
+CONSOLE MESSAGE: line 55: Not allowed to request resource
+CONSOLE MESSAGE: line 55: Fetch API cannot load https://localhost:9443/nonav-manual-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&expected_type=opaqueredirect due to access control checks.
 CONSOLE MESSAGE: FetchEvent.respondWith received an error: TypeError: Origin https://localhost:9443 is not allowed by Access-Control-Allow-Origin.
 CONSOLE MESSAGE: Fetch API cannot load https://localhost:9443/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.
 CONSOLE MESSAGE: 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.
@@ -32,6 +47,12 @@ CONSOLE MESSAGE: Fetch API cannot load https://localhost:9443/nonav-error-sameor
 CONSOLE MESSAGE: line 51: No-Cors mode requires follow redirect mode
 CONSOLE MESSAGE: line 51: Not allowed to request resource
 CONSOLE MESSAGE: line 51: Fetch API cannot load https://localhost:9443/nonav-error-nocors-redirects-to-sameorigin-nocreds?url=redirect.py%3FRedirect%3Dhttps%253A%252F%252Flocalhost%253A9443%252Fservice-workers%252Fservice-worker%252Fresources%252Fsuccess.py due to access control checks.
+CONSOLE MESSAGE: line 51: No-Cors mode requires follow redirect mode
+CONSOLE MESSAGE: line 51: Not allowed to request resource
+CONSOLE MESSAGE: line 51: Fetch API cannot load https://localhost:9443/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 due to access control checks.
+CONSOLE MESSAGE: line 51: No-Cors mode requires follow redirect mode
+CONSOLE MESSAGE: line 51: Not allowed to request resource
+CONSOLE MESSAGE: line 51: Fetch API cannot load https://localhost:9443/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 due to access control checks.
 CONSOLE MESSAGE: 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
 CONSOLE MESSAGE: Fetch API cannot load https://localhost:9443/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.
 CONSOLE MESSAGE: 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
@@ -44,6 +65,15 @@ CONSOLE MESSAGE: FetchEvent.respondWith received an error: TypeError: Not allowe
 CONSOLE MESSAGE: Fetch API cannot load https://localhost:9443/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.
 CONSOLE MESSAGE: 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
 CONSOLE MESSAGE: Fetch API cannot load https://localhost:9443/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.
+CONSOLE MESSAGE: line 51: No-Cors mode requires follow redirect mode
+CONSOLE MESSAGE: line 51: Not allowed to request resource
+CONSOLE MESSAGE: line 51: Fetch API cannot load https://localhost:9443/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 due to access control checks.
+CONSOLE MESSAGE: line 51: No-Cors mode requires follow redirect mode
+CONSOLE MESSAGE: line 51: Not allowed to request resource
+CONSOLE MESSAGE: line 51: Fetch API cannot load https://localhost:9443/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 due to access control checks.
+CONSOLE MESSAGE: line 51: No-Cors mode requires follow redirect mode
+CONSOLE MESSAGE: line 51: Not allowed to request resource
+CONSOLE MESSAGE: line 51: Fetch API cannot load https://localhost:9443/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 due to access control checks.
 
 PASS initialize global state 
 PASS Non-navigation, manual redirect, cors mode Request redirected to same-origin without credentials should succeed opaqueredirect interception and response should not be redirected 
@@ -52,13 +82,18 @@ PASS Non-navigation, manual redirect, cors mode Request redirected to cors witho
 PASS Non-navigation, manual redirect, same-origin mode Request redirected to same-origin without credentials should succeed opaqueredirect interception and response should not be redirected 
 PASS Non-navigation, manual redirect, same-origin mode Request redirected to no-cors without credentials should succeed opaqueredirect interception and response should not be redirected 
 PASS Non-navigation, manual redirect, same-origin mode Request redirected to cors without credentials should succeed opaqueredirect interception and response should not be redirected 
-PASS Non-navigation, manual redirect, no-cors mode Request should fail 
+FAIL Non-navigation, manual redirect, no-cors mode Request redirected to same-origin without credentials should succeed opaqueredirect interception and response should not be redirected promise_test: Unhandled rejection with value: object "TypeError: Not allowed to request resource"
+FAIL Non-navigation, manual redirect, no-cors mode Request redirected to no-cors without credentials should succeed opaqueredirect interception and response should not be redirected promise_test: Unhandled rejection with value: object "TypeError: Not allowed to request resource"
+FAIL Non-navigation, manual redirect, no-cors mode Request redirected to cors without credentials should succeed opaqueredirect interception and response should not be redirected promise_test: Unhandled rejection with value: object "TypeError: Not allowed to request resource"
 PASS Non-navigation, manual redirect, cors mode Request redirected to same-origin with credentials should succeed opaqueredirect interception and response should not be redirected 
 PASS Non-navigation, manual redirect, cors mode Request redirected to no-cors with credentials should succeed opaqueredirect interception and response should not be redirected 
 PASS Non-navigation, manual redirect, cors mode Request redirected to cors with credentials should succeed opaqueredirect interception and response should not be redirected 
 PASS Non-navigation, manual redirect, same-origin mode Request redirected to same-origin with credentials should succeed opaqueredirect interception and response should not be redirected 
 PASS Non-navigation, manual redirect, same-origin mode Request redirected to no-cors with credentials should succeed opaqueredirect interception and response should not be redirected 
 PASS Non-navigation, manual redirect, same-origin mode Request redirected to cors with credentials should succeed opaqueredirect interception and response should not be redirected 
+FAIL Non-navigation, manual redirect, no-cors mode Request redirected to same-origin with credentials should succeed opaqueredirect interception and response should not be redirected promise_test: Unhandled rejection with value: object "TypeError: Not allowed to request resource"
+FAIL Non-navigation, manual redirect, no-cors mode Request redirected to no-cors with credentials should succeed opaqueredirect interception and response should not be redirected promise_test: Unhandled rejection with value: object "TypeError: Not allowed to request resource"
+FAIL Non-navigation, manual redirect, no-cors mode Request redirected to cors with credentials should succeed opaqueredirect interception and response should not be redirected promise_test: Unhandled rejection with value: object "TypeError: Not allowed to request resource"
 PASS Non-navigation, follow redirect, cors mode Request redirected to same-origin without credentials should succeed interception and response should be redirected 
 PASS Non-navigation, follow redirect, cors mode Request redirected to no-cors without credentials should fail interception and response should not be redirected 
 PASS Non-navigation, follow redirect, cors mode Request redirected to cors without credentials should succeed interception and response should be redirected 
@@ -83,12 +118,17 @@ PASS Non-navigation, error redirect, cors mode Request redirected to cors withou
 PASS Non-navigation, error redirect, same-origin mode Request redirected to same-origin without credentials should fail interception and response should not be redirected 
 PASS Non-navigation, error redirect, same-origin mode Request redirected to no-cors without credentials should fail interception and response should not be redirected 
 PASS Non-navigation, error redirect, same-origin mode Request redirected to cors without credentials should fail interception and response should not be redirected 
-PASS Non-navigation, error redirect, no-cors mode Request should fail 
+PASS Non-navigation, error redirect, no-cors mode Request redirected to same-origin without credentials should fail interception and response should not be redirected 
+PASS Non-navigation, error redirect, no-cors mode Request redirected to no-cors without credentials should fail interception and response should not be redirected 
+PASS Non-navigation, error redirect, no-cors mode Request redirected to cors without credentials should fail interception and response should not be redirected 
 PASS Non-navigation, error redirect, cors mode Request redirected to same-origin with credentials should fail interception and response should not be redirected 
 PASS Non-navigation, error redirect, cors mode Request redirected to no-cors with credentials should fail interception and response should not be redirected 
 PASS Non-navigation, error redirect, cors mode Request redirected to cors with credentials should fail interception and response should not be redirected 
 PASS Non-navigation, error redirect, same-origin mode Request redirected to same-origin with credentials should fail interception and response should not be redirected 
 PASS Non-navigation, error redirect, same-origin mode Request redirected to no-cors with credentials should fail interception and response should not be redirected 
 PASS Non-navigation, error redirect, same-origin mode Request redirected to cors with credentials should fail interception and response should not be redirected 
+PASS Non-navigation, error redirect, no-cors mode Request redirected to same-origin with credentials should fail interception and response should not be redirected 
+PASS Non-navigation, error redirect, no-cors mode Request redirected to no-cors with credentials should fail interception and response should not be redirected 
+PASS Non-navigation, error redirect, no-cors mode Request redirected to cors with credentials should fail interception and response should not be redirected 
 PASS restore global state 
 
index f348ca0..c42d7f7 100644 (file)
@@ -212,9 +212,53 @@ promise_test(function(t) {
       redirect: 'manual',
       mode: 'no-cors'
     },
-    should_reject: true
+    should_reject: false
+  });
+}, 'Non-navigation, manual redirect, no-cors mode Request redirected to ' +
+   'same-origin without credentials should succeed opaqueredirect interception ' +
+   'and response should not be redirected');
+
+promise_test(function(t) {
+  return redirect_fetch_test(t, {
+    name: 'nonav-manual-nocors-redirects-to-nocors-nocreds',
+    redirect_dest: 'no-cors',
+    url_credentials: false,
+    expected_type: 'opaqueredirect',
+    expected_redirected: false,
+    request_init: {
+      redirect: 'manual',
+      mode: 'no-cors'
+    },
+    // This should succeed because its redirecting from same-origin to
+    // cross-origin.  Since the same-origin URL provides the location
+    // header the manual redirect mode should result in an opaqueredirect
+    // response.
+    should_reject: false
   });
-}, 'Non-navigation, manual redirect, no-cors mode Request should fail');
+}, 'Non-navigation, manual redirect, no-cors mode Request redirected to ' +
+   'no-cors without credentials should succeed opaqueredirect interception ' +
+   'and response should not be redirected');
+
+promise_test(function(t) {
+  return redirect_fetch_test(t, {
+    name: 'nonav-manual-nocors-redirects-to-cors-nocreds',
+    redirect_dest: 'cors',
+    url_credentials: false,
+    expected_type: 'opaqueredirect',
+    expected_redirected: false,
+    request_init: {
+      redirect: 'manual',
+      mode: 'no-cors'
+    },
+    // This should succeed because its redirecting from same-origin to
+    // cross-origin.  Since the same-origin URL provides the location
+    // header the manual redirect mode should result in an opaqueredirect
+    // response.
+    should_reject: false
+  });
+}, 'Non-navigation, manual redirect, no-cors mode Request redirected to ' +
+   'cors without credentials should succeed opaqueredirect interception ' +
+   'and response should not be redirected');
 
 promise_test(function(t) {
   return redirect_fetch_test(t, {
@@ -320,6 +364,65 @@ promise_test(function(t) {
 
 promise_test(function(t) {
   return redirect_fetch_test(t, {
+    name: 'nonav-manual-nocors-redirects-to-sameorigin-creds',
+    redirect_dest: 'same-origin',
+    url_credentials: true,
+    expected_type: 'opaqueredirect',
+    expected_redirected: false,
+    request_init: {
+      redirect: 'manual',
+      mode: 'no-cors'
+    },
+    should_reject: false
+  });
+}, 'Non-navigation, manual redirect, no-cors mode Request redirected to ' +
+   'same-origin with credentials should succeed opaqueredirect interception ' +
+   'and response should not be redirected');
+
+promise_test(function(t) {
+  return redirect_fetch_test(t, {
+    name: 'nonav-manual-nocors-redirects-to-nocors-creds',
+    redirect_dest: 'no-cors',
+    url_credentials: true,
+    expected_type: 'opaqueredirect',
+    expected_redirected: false,
+    request_init: {
+      redirect: 'manual',
+      mode: 'no-cors'
+    },
+    // This should succeed because its redirecting from same-origin to
+    // cross-origin.  Since the same-origin URL provides the location
+    // header the manual redirect mode should result in an opaqueredirect
+    // response.
+    should_reject: false
+  });
+}, 'Non-navigation, manual redirect, no-cors mode Request redirected to ' +
+   'no-cors with credentials should succeed opaqueredirect interception ' +
+   'and response should not be redirected');
+
+promise_test(function(t) {
+  return redirect_fetch_test(t, {
+    name: 'nonav-manual-nocors-redirects-to-cors-creds',
+    redirect_dest: 'cors',
+    url_credentials: true,
+    expected_type: 'opaqueredirect',
+    expected_redirected: false,
+    request_init: {
+      redirect: 'manual',
+      mode: 'no-cors'
+    },
+    // This should succeed because its redirecting from same-origin to
+    // cross-origin.  Since the same-origin URL provides the location
+    // header the manual redirect mode should result in an opaqueredirect
+    // response.
+    should_reject: false
+  });
+}, 'Non-navigation, manual redirect, no-cors mode Request redirected to ' +
+   'cors with credentials should succeed opaqueredirect interception ' +
+   'and response should not be redirected');
+
+promise_test(function(t) {
+  return redirect_fetch_test(t, {
     name: 'nonav-follow-cors-redirects-to-sameorigin-nocreds',
     redirect_dest: 'same-origin',
     url_credentials: false,
@@