From 26a029d407be480d791972afb5975cf62c9360a6 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 02:47:55 +0200 Subject: Adding upstream version 124.0.1. Signed-off-by: Daniel Baumann --- .../prefetch/anonymous-client.https.html | 21 + .../prefetch/cross-origin-cookies.https.html | 41 ++ .../prefetch/different-initiators-2.https.html | 52 +++ .../prefetch/different-initiators.sub.https.html | 83 ++++ .../prefetch/document-rules.https.html | 318 +++++++++++++++ .../prefetch/duplicate-urls.https.html | 20 + .../speculation-rules/prefetch/fragment.https.html | 35 ++ .../prefetch/implicit-source.https.html | 34 ++ .../prefetch/initiators-a-element.sub.https.html | 80 ++++ .../initiators-iframe-location-href.sub.https.html | 56 +++ .../prefetch/initiators-window-open.sub.https.html | 69 ++++ .../prefetch/invalid-rules.https.html | 19 + .../prefetch/multiple-url.https.html | 22 + .../navigation-timing-delivery-type.https.html | 57 +++ ...on-timing-requestStart-responseStart.https.html | 52 +++ .../prefetch/navigation-timing-sizes.https.html | 60 +++ .../prefetch/no-vary-search/README.txt | 1 + .../prefetch-single-with-hint.https.html | 357 ++++++++++++++++ .../no-vary-search/prefetch-single.https.html | 315 ++++++++++++++ .../prefetch/out-of-document-rule-set.https.html | 154 +++++++ .../prefetch/prefetch-single.https.html | 31 ++ .../prefetch/prefetch-status.https.html | 31 ++ .../prefetch/prefetch-traverse-reload.sub.html | 71 ++++ .../prefetch/prefetch-uses-cache.sub.https.html | 69 ++++ .../prefetch/redirect-url.sub.https.html | 54 +++ .../prefetch/referrer-policy-from-rules.https.html | 130 ++++++ .../referrer-policy-not-accepted.https.html | 50 +++ .../prefetch/referrer-policy.https.html | 81 ++++ .../prefetch/resources/authenticate.py | 36 ++ .../prefetch/resources/cacheable-executor.sub.html | 13 + .../resources/cacheable-executor.sub.html.headers | 1 + .../prefetch/resources/cookies.py | 41 ++ .../prefetch/resources/executor.sub.html | 13 + .../prefetch/resources/executor.sub.html.headers | 1 + .../prefetch/resources/prefetch.py | 17 + .../prefetch/resources/prefetch_nvs_hint.py | 49 +++ .../prefetch/resources/ruleset.py | 49 +++ .../speculation-rules/prefetch/resources/sw.js | 1 + .../prefetch/resources/utils.sub.js | 195 +++++++++ .../prefetch/same-origin-cookies.https.html | 74 ++++ .../prefetch/user-pass.https.html | 46 +++ .../prerender/about-blank-iframes.html | 31 ++ .../prerender/accept-client-hint-cache.https.html | 40 ++ .../prerender/activation-start.html | 72 ++++ .../prerender/blob_object_url.html | 34 ++ .../prerender/cache-storage.https.html | 35 ++ .../prerender/clients-matchall.https.html | 52 +++ .../speculation-rules/prerender/cookies.https.html | 37 ++ .../credentialed-prerender-not-opt-in.html | 27 ++ .../prerender/credentialed-prerender-opt-in.html | 24 ++ .../prerender/cross-origin-iframe.html | 64 +++ .../prerender/cross-origin-isolated.https.html | 29 ++ ...p-script-src-elem-inline-speculation-rules.html | 30 ++ .../csp-script-src-inline-speculation-rules.html | 30 ++ .../prerender/csp-script-src-self.html | 30 ++ .../prerender/csp-script-src-strict-dynamic.html | 30 ++ .../prerender/csp-script-src-unsafe-inline.html | 30 ++ .../speculation-rules/prerender/fetch-blob.html | 38 ++ .../fetch-intercepted-by-service-worker.https.html | 44 ++ .../prerender/iframe-added-post-activation.html | 32 ++ .../speculation-rules/prerender/indexeddb.html | 42 ++ .../speculation-rules/prerender/local-storage.html | 54 +++ .../prerender/main-frame-navigation.https.html | 39 ++ .../prerender/media-autoplay.html | 47 +++ .../prerender/navigation-api-location-replace.html | 61 +++ .../prerender/navigation-api-multiple-entries.html | 54 +++ .../prerender/navigation-api.html | 60 +++ ...gation-intercepted-by-service-worker.https.html | 43 ++ .../prerender/navigator-plugins.html | 46 +++ .../prerender/prefetch.https.html | 22 + .../prerender/prerender-while-prerender.html | 46 +++ .../prerender/referrer-policy-from-rules.html | 44 ++ .../prerender/referrer-policy-mismatch.html | 92 +++++ .../prerender/referrer-policy-no-referrer.html | 22 + .../prerender/referrer-policy-origin.html | 26 ++ .../prerender/referrer-policy-strict-origin.html | 23 ++ .../speculation-rules/prerender/referrer.html | 21 + .../prerender/register-service-worker.https.html | 52 +++ .../prerender/remove-script-element.html | 25 ++ .../prerender/resources/about-blank-iframes.html | 115 ++++++ .../prerender/resources/accept-ch.html | 4 + .../prerender/resources/accept-ch.html.headers | 2 + .../prerender/resources/audio-setSinkId.https.html | 27 ++ .../resources/background-fetch.https.html | 29 ++ .../prerender/resources/background-sync.https.html | 29 ++ .../prerender/resources/battery-status.https.html | 21 + .../prerender/resources/bear-av1-opus.mp4 | Bin 0 -> 50253 bytes .../resources/bluetooth-access.https.html | 25 ++ .../prerender/resources/broadcast-channel.html | 35 ++ .../prerender/resources/cache.txt | 1 + .../resources/clients-matchall-service-worker.js | 11 + .../resources/cross-origin-iframe-src.html | 7 + .../prerender/resources/cross-origin-iframe.html | 57 +++ .../cross-origin-isolated-iframe.https.html | 10 + ...cross-origin-isolated-iframe.https.html.headers | 2 + .../resources/cross-origin-isolated.https.html | 21 + .../cross-origin-isolated.https.html.headers | 2 + ...p-script-src-elem-inline-speculation-rules.html | 14 + .../csp-script-src-inline-speculation-rules.html | 14 + .../prerender/resources/csp-script-src-self.html | 15 + .../resources/csp-script-src-strict-dynamic.html | 15 + .../resources/csp-script-src-unsafe-inline.html | 10 + .../prerender/resources/csp-script-src.js | 60 +++ .../resources/dedicated-worker.https.html | 31 ++ .../prerender/resources/dedicated-worker.js | 1 + .../prerender/resources/deferred-promise-utils.js | 74 ++++ .../resources/deprecated-broadcast-channel.py | 28 ++ .../prerender/resources/do-nothing-worker.js | 1 + .../resources/echo-client-hints-received.py | 88 ++++ .../echo-prerender-page-client-hints-received.py | 96 +++++ .../prerender/resources/echo-referrer.py | 27 ++ .../echo-subresource-client-hints-received.py | 15 + .../prerender/resources/empty.html | 0 .../prerender/resources/encrypted-media.https.html | 39 ++ .../prerender/resources/exec.html | 18 + .../speculation-rules/prerender/resources/exec.py | 26 ++ .../prerender/resources/fetch-intercept-worker.js | 9 + .../fetch-intercepted-by-service-worker.html | 22 + .../prerender/resources/file-picker.html | 27 ++ .../prerender/resources/generic-sensor.https.html | 35 ++ .../prerender/resources/idle-detection.https.html | 27 ++ .../resources/iframe-added-post-activation.html | 57 +++ .../prerender/resources/indexedb-utils.js | 61 +++ .../prerender/resources/key-value-store.py | 27 ++ .../prerender/resources/main-frame-navigation.html | 84 ++++ .../resources/media-autoplay-attribute.html | 41 ++ .../resources/media-device-info.https.html | 26 ++ .../resources/media-devices-access.https.html | 27 ++ .../prerender/resources/media-play.html | 42 ++ .../prerender/resources/message-boxes.html | 50 +++ .../prerender/resources/midi.https.html | 37 ++ .../prerender/resources/navigator-plugins.html | 20 + .../resources/notification-before-activation.html | 40 ++ .../resources/notification-on-activation.html | 44 ++ ...ssage-prerendering-completion-notification.html | 7 + .../resources/postmessage-to-client-worker.js | 3 + .../resources/postmessage-to-service-worker.html | 34 ++ .../resources/prerender-response-code.html | 22 + .../prerender/resources/prerender-state.html | 85 ++++ .../prerender-while-prerender-initiator.html | 18 + .../resources/prerender-while-prerender-inner.html | 19 + .../resources/prerender-while-prerender-outer.html | 23 ++ .../prerender/resources/prerendered-iframe.html | 17 + .../prerender/resources/prerendered-page.html | 17 + .../prerender/resources/presentation-request.html | 26 ++ .../prompt-by-before-unload-inner-frame.html | 12 + .../resources/prompt-by-before-unload.html | 53 +++ .../prerender/resources/push.https.html | 31 ++ .../prerender/resources/referrer-test.js | 15 + .../resources/register-service-worker.html | 41 ++ .../resources/request-picture-in-picture.html | 34 ++ .../prerender/resources/sandbox-iframe.html | 50 +++ .../prerender/resources/screen-capture.https.html | 24 ++ .../resources/screen-orientation-lock.https.html | 23 ++ .../resources/service-worker-unregister.html | 34 ++ .../prerender/resources/service-worker-update.html | 33 ++ .../prerender/resources/service-worker.js | 11 + .../prerender/resources/session-history-harness.js | 75 ++++ .../resources/session-history-initiator.https.html | 61 +++ .../resources/session-history-prerender.https.html | 149 +++++++ .../resources/session-history-test-util.js | 40 ++ .../prerender/resources/shared-worker.py | 11 + .../resources/speech-synthesis.https.html | 65 +++ .../prerender/resources/storage-persist.https.html | 23 ++ .../speculation-rules/prerender/resources/utils.js | 451 +++++++++++++++++++++ .../prerender/resources/wake-lock.https.html | 40 ++ .../prerender/resources/web-hid.https.html | 23 ++ .../prerender/resources/web-locks.html | 32 ++ .../prerender/resources/web-nfc.https.html | 36 ++ .../prerender/resources/web-serial.https.html | 27 ++ .../prerender/resources/web-share.https.html | 24 ++ .../prerender/resources/web-usb.https.html | 22 + .../web-xr-immersive-vr-session.https.html | 24 ++ .../resources/web-xr-inline-session.https.html | 24 ++ .../prerender/resources/window-move.html | 62 +++ .../resources/window-open-during-prerendering.html | 41 ++ .../window-open-in-prerenderingchange.html | 65 +++ .../prerender/resources/window-resize.html | 64 +++ .../resources/windowclient-navigate-on-iframe.html | 97 +++++ .../resources/windowclient-navigate-worker.js | 38 ++ .../prerender/resources/worker-post-timeOrigin.js | 1 + .../resources/workers-in-cross-origin-iframe.html | 15 + .../prerender/response-code-non-successful.html | 29 ++ .../prerender/response-code-successful.html | 28 ++ ...SinkId-with-invalid-sinkId.https.tentative.html | 62 +++ ...estriction-audio-setSinkId.https.tentative.html | 60 +++ .../restriction-background-fetch.https.html | 67 +++ ...estriction-background-sync.tentative.https.html | 67 +++ .../restriction-battery-status.https.html | 48 +++ .../restriction-bluetooth.tentative.https.html | 58 +++ .../prerender/restriction-broadcast-channel.html | 60 +++ .../restriction-dedicated-worker.https.html | 55 +++ ...n-encrypted-media-unsupported-config.https.html | 57 +++ .../restriction-encrypted-media.https.html | 55 +++ .../prerender/restriction-focus.html | 39 ++ .../restriction-idle-detection.https.html | 34 ++ ...restriction-local-file-system-access.https.html | 32 ++ .../restriction-media-auto-play-attribute.html | 71 ++++ .../prerender/restriction-media-camera.https.html | 59 +++ .../restriction-media-device-info.https.html | 57 +++ .../restriction-media-microphone.https.html | 59 +++ .../prerender/restriction-media-play.html | 73 ++++ .../prerender/restriction-message-boxes.html | 52 +++ .../prerender/restriction-midi-sysex.https.html | 64 +++ .../prerender/restriction-midi.https.html | 64 +++ .../prerender/restriction-notification.https.html | 105 +++++ .../restriction-presentation-request.https.html | 32 ++ .../restriction-prompt-by-before-unload.html | 36 ++ .../prerender/restriction-push.https.html | 66 +++ .../restriction-request-picture-in-picture.html | 37 ++ .../restriction-screen-capture.https.html | 38 ++ .../restriction-screen-orientation-lock.https.html | 47 +++ .../restriction-sensor-accelerometer.https.html | 65 +++ ...triction-sensor-ambient-light-sensor.https.html | 65 +++ .../restriction-sensor-gyroscope.https.html | 65 +++ .../restriction-sensor-magnetometer.https.html | 65 +++ ...striction-service-worker-postmessage.https.html | 58 +++ ...estriction-service-worker-unregister.https.html | 55 +++ .../restriction-service-worker-update.https.html | 55 +++ .../prerender/restriction-speech-synthesis.html | 61 +++ .../restriction-storage-persist.https.html | 54 +++ .../prerender/restriction-wake-lock.https.html | 71 ++++ .../prerender/restriction-web-hid.https.html | 46 +++ .../prerender/restriction-web-locks.https.html | 50 +++ .../prerender/restriction-web-nfc.https.html | 48 +++ .../restriction-web-serial.tentative.https.html | 49 +++ .../prerender/restriction-web-share.https.html | 34 ++ .../prerender/restriction-web-usb.https.html | 46 +++ ...triction-web-xr-immersive-vr-session.https.html | 58 +++ .../restriction-web-xr-inline-session.https.html | 58 +++ .../prerender/restriction-window-move.html | 48 +++ .../prerender/restriction-window-open.html | 40 ++ .../prerender/restriction-window-resize.html | 49 +++ .../speculation-rules/prerender/restrictions.html | 33 ++ .../prerender/sandbox-iframe.html | 56 +++ .../script-supports-speculationrules.html | 21 + .../prerender/service-workers.https.html | 116 ++++++ .../session-history-activation.https.html | 29 ++ .../prerender/session-history-location.https.html | 37 ++ .../session-history-navigation.https.html | 25 ++ .../prerender/session-history-pushstate.https.html | 30 ++ .../session-history-subframe-navigation.https.html | 23 ++ .../session-history-subframe-reload.https.html | 23 ++ .../prerender/state-and-event.html | 47 +++ .../prerender/visibility-state.html | 27 ++ ...vigate-to-cross-origin-url-on-iframe.https.html | 83 ++++ ...avigate-to-same-origin-url-on-iframe.https.html | 57 +++ .../prerender/windowclient-navigate.https.html | 72 ++++ .../prerender/workers-in-cross-origin-iframe.html | 49 +++ .../tests/speculation-rules/prerender/workers.html | 95 +++++ .../tests/speculation-rules/resources/utils.js | 8 + 251 files changed, 11797 insertions(+) create mode 100644 testing/web-platform/tests/speculation-rules/prefetch/anonymous-client.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prefetch/cross-origin-cookies.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prefetch/different-initiators-2.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prefetch/different-initiators.sub.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prefetch/document-rules.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prefetch/duplicate-urls.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prefetch/fragment.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prefetch/implicit-source.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prefetch/initiators-a-element.sub.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prefetch/initiators-iframe-location-href.sub.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prefetch/initiators-window-open.sub.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prefetch/invalid-rules.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prefetch/multiple-url.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prefetch/navigation-timing-delivery-type.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prefetch/navigation-timing-requestStart-responseStart.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prefetch/navigation-timing-sizes.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prefetch/no-vary-search/README.txt create mode 100644 testing/web-platform/tests/speculation-rules/prefetch/no-vary-search/prefetch-single-with-hint.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prefetch/no-vary-search/prefetch-single.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prefetch/out-of-document-rule-set.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prefetch/prefetch-single.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prefetch/prefetch-status.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prefetch/prefetch-traverse-reload.sub.html create mode 100644 testing/web-platform/tests/speculation-rules/prefetch/prefetch-uses-cache.sub.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prefetch/redirect-url.sub.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prefetch/referrer-policy-from-rules.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prefetch/referrer-policy-not-accepted.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prefetch/referrer-policy.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prefetch/resources/authenticate.py create mode 100644 testing/web-platform/tests/speculation-rules/prefetch/resources/cacheable-executor.sub.html create mode 100644 testing/web-platform/tests/speculation-rules/prefetch/resources/cacheable-executor.sub.html.headers create mode 100644 testing/web-platform/tests/speculation-rules/prefetch/resources/cookies.py create mode 100644 testing/web-platform/tests/speculation-rules/prefetch/resources/executor.sub.html create mode 100644 testing/web-platform/tests/speculation-rules/prefetch/resources/executor.sub.html.headers create mode 100644 testing/web-platform/tests/speculation-rules/prefetch/resources/prefetch.py create mode 100644 testing/web-platform/tests/speculation-rules/prefetch/resources/prefetch_nvs_hint.py create mode 100644 testing/web-platform/tests/speculation-rules/prefetch/resources/ruleset.py create mode 100644 testing/web-platform/tests/speculation-rules/prefetch/resources/sw.js create mode 100644 testing/web-platform/tests/speculation-rules/prefetch/resources/utils.sub.js create mode 100644 testing/web-platform/tests/speculation-rules/prefetch/same-origin-cookies.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prefetch/user-pass.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/about-blank-iframes.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/accept-client-hint-cache.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/activation-start.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/blob_object_url.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/cache-storage.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/clients-matchall.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/cookies.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/credentialed-prerender-not-opt-in.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/credentialed-prerender-opt-in.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/cross-origin-iframe.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/cross-origin-isolated.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/csp-script-src-elem-inline-speculation-rules.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/csp-script-src-inline-speculation-rules.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/csp-script-src-self.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/csp-script-src-strict-dynamic.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/csp-script-src-unsafe-inline.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/fetch-blob.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/fetch-intercepted-by-service-worker.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/iframe-added-post-activation.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/indexeddb.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/local-storage.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/main-frame-navigation.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/media-autoplay.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/navigation-api-location-replace.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/navigation-api-multiple-entries.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/navigation-api.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/navigation-intercepted-by-service-worker.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/navigator-plugins.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/prefetch.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/prerender-while-prerender.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/referrer-policy-from-rules.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/referrer-policy-mismatch.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/referrer-policy-no-referrer.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/referrer-policy-origin.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/referrer-policy-strict-origin.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/referrer.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/register-service-worker.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/remove-script-element.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/about-blank-iframes.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/accept-ch.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/accept-ch.html.headers create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/audio-setSinkId.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/background-fetch.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/background-sync.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/battery-status.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/bear-av1-opus.mp4 create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/bluetooth-access.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/broadcast-channel.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/cache.txt create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/clients-matchall-service-worker.js create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/cross-origin-iframe-src.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/cross-origin-iframe.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/cross-origin-isolated-iframe.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/cross-origin-isolated-iframe.https.html.headers create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/cross-origin-isolated.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/cross-origin-isolated.https.html.headers create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/csp-script-src-elem-inline-speculation-rules.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/csp-script-src-inline-speculation-rules.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/csp-script-src-self.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/csp-script-src-strict-dynamic.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/csp-script-src-unsafe-inline.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/csp-script-src.js create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/dedicated-worker.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/dedicated-worker.js create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/deferred-promise-utils.js create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/deprecated-broadcast-channel.py create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/do-nothing-worker.js create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/echo-client-hints-received.py create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/echo-prerender-page-client-hints-received.py create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/echo-referrer.py create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/echo-subresource-client-hints-received.py create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/empty.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/encrypted-media.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/exec.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/exec.py create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/fetch-intercept-worker.js create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/fetch-intercepted-by-service-worker.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/file-picker.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/generic-sensor.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/idle-detection.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/iframe-added-post-activation.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/indexedb-utils.js create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/key-value-store.py create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/main-frame-navigation.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/media-autoplay-attribute.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/media-device-info.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/media-devices-access.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/media-play.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/message-boxes.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/midi.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/navigator-plugins.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/notification-before-activation.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/notification-on-activation.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/post-message-prerendering-completion-notification.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/postmessage-to-client-worker.js create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/postmessage-to-service-worker.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/prerender-response-code.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/prerender-state.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/prerender-while-prerender-initiator.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/prerender-while-prerender-inner.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/prerender-while-prerender-outer.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/prerendered-iframe.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/prerendered-page.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/presentation-request.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/prompt-by-before-unload-inner-frame.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/prompt-by-before-unload.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/push.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/referrer-test.js create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/register-service-worker.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/request-picture-in-picture.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/sandbox-iframe.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/screen-capture.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/screen-orientation-lock.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/service-worker-unregister.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/service-worker-update.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/service-worker.js create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/session-history-harness.js create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/session-history-initiator.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/session-history-prerender.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/session-history-test-util.js create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/shared-worker.py create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/speech-synthesis.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/storage-persist.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/utils.js create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/wake-lock.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/web-hid.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/web-locks.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/web-nfc.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/web-serial.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/web-share.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/web-usb.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/web-xr-immersive-vr-session.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/web-xr-inline-session.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/window-move.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/window-open-during-prerendering.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/window-open-in-prerenderingchange.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/window-resize.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/windowclient-navigate-on-iframe.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/windowclient-navigate-worker.js create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/worker-post-timeOrigin.js create mode 100644 testing/web-platform/tests/speculation-rules/prerender/resources/workers-in-cross-origin-iframe.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/response-code-non-successful.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/response-code-successful.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/restriction-audio-setSinkId-with-invalid-sinkId.https.tentative.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/restriction-audio-setSinkId.https.tentative.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/restriction-background-fetch.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/restriction-background-sync.tentative.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/restriction-battery-status.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/restriction-bluetooth.tentative.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/restriction-broadcast-channel.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/restriction-dedicated-worker.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/restriction-encrypted-media-unsupported-config.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/restriction-encrypted-media.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/restriction-focus.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/restriction-idle-detection.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/restriction-local-file-system-access.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/restriction-media-auto-play-attribute.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/restriction-media-camera.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/restriction-media-device-info.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/restriction-media-microphone.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/restriction-media-play.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/restriction-message-boxes.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/restriction-midi-sysex.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/restriction-midi.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/restriction-notification.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/restriction-presentation-request.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/restriction-prompt-by-before-unload.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/restriction-push.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/restriction-request-picture-in-picture.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/restriction-screen-capture.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/restriction-screen-orientation-lock.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/restriction-sensor-accelerometer.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/restriction-sensor-ambient-light-sensor.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/restriction-sensor-gyroscope.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/restriction-sensor-magnetometer.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/restriction-service-worker-postmessage.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/restriction-service-worker-unregister.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/restriction-service-worker-update.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/restriction-speech-synthesis.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/restriction-storage-persist.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/restriction-wake-lock.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/restriction-web-hid.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/restriction-web-locks.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/restriction-web-nfc.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/restriction-web-serial.tentative.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/restriction-web-share.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/restriction-web-usb.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/restriction-web-xr-immersive-vr-session.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/restriction-web-xr-inline-session.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/restriction-window-move.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/restriction-window-open.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/restriction-window-resize.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/restrictions.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/sandbox-iframe.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/script-supports-speculationrules.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/service-workers.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/session-history-activation.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/session-history-location.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/session-history-navigation.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/session-history-pushstate.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/session-history-subframe-navigation.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/session-history-subframe-reload.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/state-and-event.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/visibility-state.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/windowclient-navigate-to-cross-origin-url-on-iframe.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/windowclient-navigate-to-same-origin-url-on-iframe.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/windowclient-navigate.https.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/workers-in-cross-origin-iframe.html create mode 100644 testing/web-platform/tests/speculation-rules/prerender/workers.html create mode 100644 testing/web-platform/tests/speculation-rules/resources/utils.js (limited to 'testing/web-platform/tests/speculation-rules') diff --git a/testing/web-platform/tests/speculation-rules/prefetch/anonymous-client.https.html b/testing/web-platform/tests/speculation-rules/prefetch/anonymous-client.https.html new file mode 100644 index 0000000000..bf5896b2dd --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prefetch/anonymous-client.https.html @@ -0,0 +1,21 @@ + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prefetch/cross-origin-cookies.https.html b/testing/web-platform/tests/speculation-rules/prefetch/cross-origin-cookies.https.html new file mode 100644 index 0000000000..a16872fcef --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prefetch/cross-origin-cookies.https.html @@ -0,0 +1,41 @@ + + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prefetch/different-initiators-2.https.html b/testing/web-platform/tests/speculation-rules/prefetch/different-initiators-2.https.html new file mode 100644 index 0000000000..dc314d22c5 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prefetch/different-initiators-2.https.html @@ -0,0 +1,52 @@ + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prefetch/different-initiators.sub.https.html b/testing/web-platform/tests/speculation-rules/prefetch/different-initiators.sub.https.html new file mode 100644 index 0000000000..691dfd855e --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prefetch/different-initiators.sub.https.html @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prefetch/document-rules.https.html b/testing/web-platform/tests/speculation-rules/prefetch/document-rules.https.html new file mode 100644 index 0000000000..805f1cfbc3 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prefetch/document-rules.https.html @@ -0,0 +1,318 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prefetch/duplicate-urls.https.html b/testing/web-platform/tests/speculation-rules/prefetch/duplicate-urls.https.html new file mode 100644 index 0000000000..f9e46a6a38 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prefetch/duplicate-urls.https.html @@ -0,0 +1,20 @@ + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prefetch/fragment.https.html b/testing/web-platform/tests/speculation-rules/prefetch/fragment.https.html new file mode 100644 index 0000000000..7b35500303 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prefetch/fragment.https.html @@ -0,0 +1,35 @@ + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prefetch/implicit-source.https.html b/testing/web-platform/tests/speculation-rules/prefetch/implicit-source.https.html new file mode 100644 index 0000000000..b0b1667984 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prefetch/implicit-source.https.html @@ -0,0 +1,34 @@ + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prefetch/initiators-a-element.sub.https.html b/testing/web-platform/tests/speculation-rules/prefetch/initiators-a-element.sub.https.html new file mode 100644 index 0000000000..9cfedb20ef --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prefetch/initiators-a-element.sub.https.html @@ -0,0 +1,80 @@ + + + + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prefetch/initiators-iframe-location-href.sub.https.html b/testing/web-platform/tests/speculation-rules/prefetch/initiators-iframe-location-href.sub.https.html new file mode 100644 index 0000000000..0c195ee454 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prefetch/initiators-iframe-location-href.sub.https.html @@ -0,0 +1,56 @@ + + + + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prefetch/initiators-window-open.sub.https.html b/testing/web-platform/tests/speculation-rules/prefetch/initiators-window-open.sub.https.html new file mode 100644 index 0000000000..6923d44dfb --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prefetch/initiators-window-open.sub.https.html @@ -0,0 +1,69 @@ + + + + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prefetch/invalid-rules.https.html b/testing/web-platform/tests/speculation-rules/prefetch/invalid-rules.https.html new file mode 100644 index 0000000000..0fdfacde64 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prefetch/invalid-rules.https.html @@ -0,0 +1,19 @@ + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prefetch/multiple-url.https.html b/testing/web-platform/tests/speculation-rules/prefetch/multiple-url.https.html new file mode 100644 index 0000000000..34a8817a98 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prefetch/multiple-url.https.html @@ -0,0 +1,22 @@ + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prefetch/navigation-timing-delivery-type.https.html b/testing/web-platform/tests/speculation-rules/prefetch/navigation-timing-delivery-type.https.html new file mode 100644 index 0000000000..abbc8652ec --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prefetch/navigation-timing-delivery-type.https.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prefetch/navigation-timing-requestStart-responseStart.https.html b/testing/web-platform/tests/speculation-rules/prefetch/navigation-timing-requestStart-responseStart.https.html new file mode 100644 index 0000000000..9c9371c4c3 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prefetch/navigation-timing-requestStart-responseStart.https.html @@ -0,0 +1,52 @@ + + + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prefetch/navigation-timing-sizes.https.html b/testing/web-platform/tests/speculation-rules/prefetch/navigation-timing-sizes.https.html new file mode 100644 index 0000000000..b3cca1c22d --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prefetch/navigation-timing-sizes.https.html @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prefetch/no-vary-search/README.txt b/testing/web-platform/tests/speculation-rules/prefetch/no-vary-search/README.txt new file mode 100644 index 0000000000..60ac226f8c --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prefetch/no-vary-search/README.txt @@ -0,0 +1 @@ +Web Platform Tests for No-Vary-Search support in prefetch cache. diff --git a/testing/web-platform/tests/speculation-rules/prefetch/no-vary-search/prefetch-single-with-hint.https.html b/testing/web-platform/tests/speculation-rules/prefetch/no-vary-search/prefetch-single-with-hint.https.html new file mode 100644 index 0000000000..1cbd7e8e71 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prefetch/no-vary-search/prefetch-single-with-hint.https.html @@ -0,0 +1,357 @@ + +Use for navigation the requested prefetched response annotated with No-Vary-Search hint, if +No-Vary-Search headers also match during navigation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prefetch/no-vary-search/prefetch-single.https.html b/testing/web-platform/tests/speculation-rules/prefetch/no-vary-search/prefetch-single.https.html new file mode 100644 index 0000000000..61f9e420fd --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prefetch/no-vary-search/prefetch-single.https.html @@ -0,0 +1,315 @@ + +Prefetched response including No-Vary-Search headers is used during navigation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prefetch/out-of-document-rule-set.https.html b/testing/web-platform/tests/speculation-rules/prefetch/out-of-document-rule-set.https.html new file mode 100644 index 0000000000..24502ee513 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prefetch/out-of-document-rule-set.https.html @@ -0,0 +1,154 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prefetch/prefetch-single.https.html b/testing/web-platform/tests/speculation-rules/prefetch/prefetch-single.https.html new file mode 100644 index 0000000000..15a4466880 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prefetch/prefetch-single.https.html @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prefetch/prefetch-status.https.html b/testing/web-platform/tests/speculation-rules/prefetch/prefetch-status.https.html new file mode 100644 index 0000000000..94d6a4020e --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prefetch/prefetch-status.https.html @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prefetch/prefetch-traverse-reload.sub.html b/testing/web-platform/tests/speculation-rules/prefetch/prefetch-traverse-reload.sub.html new file mode 100644 index 0000000000..2b66db2f8a --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prefetch/prefetch-traverse-reload.sub.html @@ -0,0 +1,71 @@ + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prefetch/prefetch-uses-cache.sub.https.html b/testing/web-platform/tests/speculation-rules/prefetch/prefetch-uses-cache.sub.https.html new file mode 100644 index 0000000000..c0e9e73c75 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prefetch/prefetch-uses-cache.sub.https.html @@ -0,0 +1,69 @@ + + + + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prefetch/redirect-url.sub.https.html b/testing/web-platform/tests/speculation-rules/prefetch/redirect-url.sub.https.html new file mode 100644 index 0000000000..02bb35349f --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prefetch/redirect-url.sub.https.html @@ -0,0 +1,54 @@ + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prefetch/referrer-policy-from-rules.https.html b/testing/web-platform/tests/speculation-rules/prefetch/referrer-policy-from-rules.https.html new file mode 100644 index 0000000000..d4828fca51 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prefetch/referrer-policy-from-rules.https.html @@ -0,0 +1,130 @@ + +Prefetch with the referrer policy specified in speculation rules + + + + + + + + + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prefetch/referrer-policy-not-accepted.https.html b/testing/web-platform/tests/speculation-rules/prefetch/referrer-policy-not-accepted.https.html new file mode 100644 index 0000000000..d8c2bea87a --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prefetch/referrer-policy-not-accepted.https.html @@ -0,0 +1,50 @@ + +Prefetch attempts with an unacceptable referrer policy + + + + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prefetch/referrer-policy.https.html b/testing/web-platform/tests/speculation-rules/prefetch/referrer-policy.https.html new file mode 100644 index 0000000000..8eb24c4581 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prefetch/referrer-policy.https.html @@ -0,0 +1,81 @@ + +Prefetch is done with the referring page's referrer policy + + + + + + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prefetch/resources/authenticate.py b/testing/web-platform/tests/speculation-rules/prefetch/resources/authenticate.py new file mode 100644 index 0000000000..8820781709 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prefetch/resources/authenticate.py @@ -0,0 +1,36 @@ + +def main(request, response): + def fmt(x): + return f'"{x.decode("utf-8")}"' if x is not None else "undefined" + + purpose = request.headers.get("Purpose", b"").decode("utf-8") + sec_purpose = request.headers.get("Sec-Purpose", b"").decode("utf-8") + + headers = [ + (b"Content-Type", b"text/html"), + (b'WWW-Authenticate', b'Basic'), + (b'Cache-Control', b'no-store') + ] + status = 200 if request.auth.username is not None or sec_purpose.startswith( + "prefetch") else 401 + + content = f''' + + + + + ''' + return status, headers, content diff --git a/testing/web-platform/tests/speculation-rules/prefetch/resources/cacheable-executor.sub.html b/testing/web-platform/tests/speculation-rules/prefetch/resources/cacheable-executor.sub.html new file mode 100644 index 0000000000..ba1b3acb0c --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prefetch/resources/cacheable-executor.sub.html @@ -0,0 +1,13 @@ + + + + diff --git a/testing/web-platform/tests/speculation-rules/prefetch/resources/cacheable-executor.sub.html.headers b/testing/web-platform/tests/speculation-rules/prefetch/resources/cacheable-executor.sub.html.headers new file mode 100644 index 0000000000..0ee6ec2ab1 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prefetch/resources/cacheable-executor.sub.html.headers @@ -0,0 +1 @@ +Cache-Control: private, max-age=604800 diff --git a/testing/web-platform/tests/speculation-rules/prefetch/resources/cookies.py b/testing/web-platform/tests/speculation-rules/prefetch/resources/cookies.py new file mode 100644 index 0000000000..3ba9cd9270 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prefetch/resources/cookies.py @@ -0,0 +1,41 @@ + +def main(request, response): + def get_cookie(key): + key = key.encode("utf-8") + if key in request.cookies: + return f'"{request.cookies[key].value.decode("utf-8")}"' + else: + return "undefined" + + purpose = request.headers.get("Purpose", b"").decode("utf-8") + sec_purpose = request.headers.get("Sec-Purpose", b"").decode("utf-8") + + cookie_count = int( + request.cookies[b"count"].value) if b"count" in request.cookies else 0 + response.set_cookie("count", f"{cookie_count+1}", + secure=True, samesite="None") + response.set_cookie( + "type", "prefetch" if sec_purpose.startswith("prefetch") else "navigate") + + headers = [(b"Content-Type", b"text/html"), (b"Cache-Control", b"no-store")] + + content = f''' + + + + + ''' + return headers, content diff --git a/testing/web-platform/tests/speculation-rules/prefetch/resources/executor.sub.html b/testing/web-platform/tests/speculation-rules/prefetch/resources/executor.sub.html new file mode 100644 index 0000000000..ba1b3acb0c --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prefetch/resources/executor.sub.html @@ -0,0 +1,13 @@ + + + + diff --git a/testing/web-platform/tests/speculation-rules/prefetch/resources/executor.sub.html.headers b/testing/web-platform/tests/speculation-rules/prefetch/resources/executor.sub.html.headers new file mode 100644 index 0000000000..4030ea1d3d --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prefetch/resources/executor.sub.html.headers @@ -0,0 +1 @@ +Cache-Control: no-store diff --git a/testing/web-platform/tests/speculation-rules/prefetch/resources/prefetch.py b/testing/web-platform/tests/speculation-rules/prefetch/resources/prefetch.py new file mode 100644 index 0000000000..14ac4d1699 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prefetch/resources/prefetch.py @@ -0,0 +1,17 @@ +from wptserve.handlers import json_handler + +@json_handler +def main(request, response): + uuid = request.GET[b"uuid"] + prefetch = request.headers.get( + "Sec-Purpose", b"").decode("utf-8").startswith("prefetch") + response.headers.set("Cache-Control", "no-store") + + n = request.server.stash.take(uuid) + if n is None: + n = 0 + if prefetch: + n += 1 + request.server.stash.put(uuid, n) + + return n diff --git a/testing/web-platform/tests/speculation-rules/prefetch/resources/prefetch_nvs_hint.py b/testing/web-platform/tests/speculation-rules/prefetch/resources/prefetch_nvs_hint.py new file mode 100644 index 0000000000..d912eff90a --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prefetch/resources/prefetch_nvs_hint.py @@ -0,0 +1,49 @@ +import time + +def main(request, response): + response.headers.set("Cache-Control", "no-store") + uuid = request.GET[b"uuid"] + wait_for_prefetch_start_uuid = None + if b"wait_for_prefetch_uuid" in request.GET: + wait_for_prefetch_start_uuid = request.GET[b"wait_for_prefetch_uuid"] + prefetch = request.headers.get( + "Sec-Purpose", b"").decode("utf-8").startswith("prefetch") + if b"unblock" in request.GET: + request.server.stash.put(uuid, 0) + return '' + + if b"wait_for_prefetch" in request.GET: + if wait_for_prefetch_start_uuid is None: + return '' + wait_for_prefetch = None + while wait_for_prefetch is None: + time.sleep(0.1) + wait_for_prefetch = request.server.stash.take(wait_for_prefetch_start_uuid) + return '' + + if b"nvs_header" in request.GET: + nvs_header = request.GET[b"nvs_header"] + response.headers.set("No-Vary-Search", nvs_header) + + if prefetch: + if wait_for_prefetch_start_uuid is not None: + request.server.stash.put(wait_for_prefetch_start_uuid, 0) + nvswait = None + while nvswait is None: + time.sleep(0.1) + nvswait = request.server.stash.take(uuid) + + content = (f'\n' + f'\n' + f'\n' + f'\n') + + return content diff --git a/testing/web-platform/tests/speculation-rules/prefetch/resources/ruleset.py b/testing/web-platform/tests/speculation-rules/prefetch/resources/ruleset.py new file mode 100644 index 0000000000..97de1cc1a0 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prefetch/resources/ruleset.py @@ -0,0 +1,49 @@ +def main(request, response): + url = request.GET[b"url"].decode("utf-8") + uuid = request.GET[b"uuid"].decode("utf-8") + page = request.GET[b"page"].decode("utf-8") + valid_json = request.GET[b"valid_json"].decode("utf-8") + empty_json = request.GET[b"empty_json"].decode("utf-8") + fail_cors = request.GET[b"fail_cors"].decode("utf-8") + valid_encoding = request.GET[b"valid_encoding"].decode("utf-8") + redirect = request.GET[b"redirect"].decode("utf-8") + sec_fetch_dest = request.headers[b"Sec-Fetch-Dest"].decode( + "utf-8").lower() if b"Sec-Fetch-Dest" in request.headers else None + content_type = b"application/speculationrules+json" if request.GET[ + b"valid_mime"].decode("utf-8") == "true" else b"application/json" + status = int(request.GET[b"status"]) + + if redirect == "true": + new_url = request.url.replace("redirect=true", + "redirect=false").encode("utf-8") + return 301, [(b"Location", new_url), + (b'Access-Control-Allow-Origin', b'*')], b"" + + encoding = "utf-8" if valid_encoding == "true" else "windows-1250" + content_type += f'; charset={encoding}'.encode('utf-8') + strparam = b'\xc3\xb7'.decode('utf-8') + + content = f''' + {{ + "prefetch": [ + {{ + "source":"list", + "urls":["{url}?uuid={uuid}&page={page}&str={strparam}"], + "requires":["anonymous-client-ip-when-cross-origin"] + }} + ] + }} + ''' + if empty_json == "true": + content = "" + elif valid_json != "true": + content = "invalid json" + elif sec_fetch_dest is None or sec_fetch_dest != "script": + content = "normal document" + + headers = [(b"Content-Type", content_type)] + if fail_cors != "true": + origin = request.headers[ + b"Origin"] if b"Origin" in request.headers else b'*' + headers.append((b'Access-Control-Allow-Origin', origin)) + return status, headers, content.encode(encoding) diff --git a/testing/web-platform/tests/speculation-rules/prefetch/resources/sw.js b/testing/web-platform/tests/speculation-rules/prefetch/resources/sw.js new file mode 100644 index 0000000000..dd8a9631b4 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prefetch/resources/sw.js @@ -0,0 +1 @@ +self.addEventListener('fetch', event => event.respondWith(fetch(event.request))); diff --git a/testing/web-platform/tests/speculation-rules/prefetch/resources/utils.sub.js b/testing/web-platform/tests/speculation-rules/prefetch/resources/utils.sub.js new file mode 100644 index 0000000000..73624c0c25 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prefetch/resources/utils.sub.js @@ -0,0 +1,195 @@ +/** + * Utilities for initiating prefetch via speculation rules. + */ + +// Resolved URL to find this script. +const SR_PREFETCH_UTILS_URL = new URL(document.currentScript.src, document.baseURI); +// Hostname for cross origin urls. +const PREFETCH_PROXY_BYPASS_HOST = "{{hosts[alt][]}}"; + +class PrefetchAgent extends RemoteContext { + constructor(uuid, t) { + super(uuid); + this.t = t; + } + + getExecutorURL(options = {}) { + let {hostname, username, password, protocol, executor, ...extra} = options; + let params = new URLSearchParams({uuid: this.context_id, ...extra}); + if(executor === undefined) { + executor = "executor.sub.html"; + } + let url = new URL(`${executor}?${params}`, SR_PREFETCH_UTILS_URL); + if(hostname !== undefined) { + url.hostname = hostname; + } + if(username !== undefined) { + url.username = username; + } + if(password !== undefined) { + url.password = password; + } + if(protocol !== undefined) { + url.protocol = protocol; + url.port = protocol === "https" ? "{{ports[https][0]}}" : "{{ports[http][0]}}"; + } + return url; + } + + // Requests prefetch via speculation rules. + // + // In the future, this should also use browser hooks to force the prefetch to + // occur despite heuristic matching, etc., and await the completion of the + // prefetch. + async forceSinglePrefetch(url, extra = {}, wait_for_completion = true) { + await this.execute_script((url, extra) => { + insertSpeculationRules({ prefetch: [{source: 'list', urls: [url], ...extra}] }); + }, [url, extra]); + if (!wait_for_completion) { + return Promise.resolve(); + } + return new Promise(resolve => this.t.step_timeout(resolve, 2000)); + } + + // `url` is the URL to navigate. + // + // `expectedDestinationUrl` is the expected URL after navigation. + // When omitted, `url` is used. + async navigate(url, {expectedDestinationUrl} = {}) { + await this.execute_script((url) => { + window.executor.suspend(() => { + location.href = url; + }); + }, [url]); + if (!expectedDestinationUrl) { + expectedDestinationUrl = url; + } + expectedDestinationUrl.username = ''; + expectedDestinationUrl.password = ''; + assert_equals( + await this.execute_script(() => location.href), + expectedDestinationUrl.toString(), + "expected navigation to reach destination URL"); + await this.execute_script(() => {}); + } + + async getRequestHeaders() { + return this.execute_script(() => requestHeaders); + } + + async getResponseCookies() { + return this.execute_script(() => { + let cookie = {}; + document.cookie.split(/\s*;\s*/).forEach((kv)=>{ + let [key, value] = kv.split(/\s*=\s*/); + cookie[key] = value; + }); + return cookie; + }); + } + + async getRequestCookies() { + return this.execute_script(() => window.requestCookies); + } + + async getRequestCredentials() { + return this.execute_script(() => window.requestCredentials); + } + + async setReferrerPolicy(referrerPolicy) { + return this.execute_script(referrerPolicy => { + const meta = document.createElement("meta"); + meta.name = "referrer"; + meta.content = referrerPolicy; + document.head.append(meta); + }, [referrerPolicy]); + } + + async getDeliveryType(){ + return this.execute_script(() => { + return performance.getEntriesByType("navigation")[0].deliveryType; + }); + } +} + +// Produces a URL with a UUID which will record when it's prefetched. +// |extra_params| can be specified to add extra search params to the generated +// URL. +function getPrefetchUrl(extra_params={}) { + let params = new URLSearchParams({ uuid: token(), ...extra_params }); + return new URL(`prefetch.py?${params}`, SR_PREFETCH_UTILS_URL); +} + +// Produces n URLs with unique UUIDs which will record when they are prefetched. +function getPrefetchUrlList(n) { + return Array.from({ length: n }, () => getPrefetchUrl()); +} + +async function isUrlPrefetched(url) { + let response = await fetch(url, {redirect: 'follow'}); + assert_true(response.ok); + return response.json(); +} + +// Must also include /common/utils.js and /common/dispatcher/dispatcher.js to use this. +async function spawnWindowWithReference(t, options = {}, uuid = token()) { + let agent = new PrefetchAgent(uuid, t); + let w = window.open(agent.getExecutorURL(options), '_blank', options); + t.add_cleanup(() => w.close()); + return {"agent":agent, "window":w}; +} + +// Must also include /common/utils.js and /common/dispatcher/dispatcher.js to use this. +async function spawnWindow(t, options = {}, uuid = token()) { + let agent_window_pair = await spawnWindowWithReference(t, options, uuid); + return agent_window_pair.agent; +} + +function insertSpeculationRules(body) { + let script = document.createElement('script'); + script.type = 'speculationrules'; + script.textContent = JSON.stringify(body); + document.head.appendChild(script); +} + +// Creates and appends to |insertion point|. If +// |insertion_point| is not specified, document.body is used. +function addLink(href, insertion_point=document.body) { + const a = document.createElement('a'); + a.href = href; + insertion_point.appendChild(a); + return a; +} + +// Inserts a prefetch document rule with |predicate|. |predicate| can be +// undefined, in which case the default predicate will be used (i.e. all links +// in document will match). +function insertDocumentRule(predicate, extra_options={}) { + insertSpeculationRules({ + prefetch: [{ + source: 'document', + eagerness: 'eager', + where: predicate, + ...extra_options + }] + }); +} + +function assert_prefetched (requestHeaders, description) { + assert_in_array(requestHeaders.purpose, ["", "prefetch"], "The vendor-specific header Purpose, if present, must be 'prefetch'."); + assert_in_array(requestHeaders.sec_purpose, + ["prefetch", "prefetch;anonymous-client-ip"], description); +} + +function assert_not_prefetched (requestHeaders, description){ + assert_equals(requestHeaders.purpose, "", description); + assert_equals(requestHeaders.sec_purpose, "", description); +} + +// Use nvs_header query parameter to ask the wpt server +// to populate No-Vary-Search response header. +function addNoVarySearchHeaderUsingQueryParam(url, value){ + if(value){ + url.searchParams.append("nvs_header", value); + } +} diff --git a/testing/web-platform/tests/speculation-rules/prefetch/same-origin-cookies.https.html b/testing/web-platform/tests/speculation-rules/prefetch/same-origin-cookies.https.html new file mode 100644 index 0000000000..2f93c1ebb4 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prefetch/same-origin-cookies.https.html @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prefetch/user-pass.https.html b/testing/web-platform/tests/speculation-rules/prefetch/user-pass.https.html new file mode 100644 index 0000000000..011e6137e6 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prefetch/user-pass.https.html @@ -0,0 +1,46 @@ + + + + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/about-blank-iframes.html b/testing/web-platform/tests/speculation-rules/prerender/about-blank-iframes.html new file mode 100644 index 0000000000..af289197c6 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/about-blank-iframes.html @@ -0,0 +1,31 @@ + +Test about:blank iframes prerendering state + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/accept-client-hint-cache.https.html b/testing/web-platform/tests/speculation-rules/prerender/accept-client-hint-cache.https.html new file mode 100644 index 0000000000..a07f47cfd4 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/accept-client-hint-cache.https.html @@ -0,0 +1,40 @@ + +Test Prerender pages maintain their own Client Hint Caches + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/activation-start.html b/testing/web-platform/tests/speculation-rules/prerender/activation-start.html new file mode 100644 index 0000000000..7aee20c346 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/activation-start.html @@ -0,0 +1,72 @@ + +PerformanceNavigationTiming's activationStart in prerendered page + + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/blob_object_url.html b/testing/web-platform/tests/speculation-rules/prerender/blob_object_url.html new file mode 100644 index 0000000000..49fb7c9e2c --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/blob_object_url.html @@ -0,0 +1,34 @@ + +Same-origin prerendering page can create a url for the given +objects + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/cache-storage.https.html b/testing/web-platform/tests/speculation-rules/prerender/cache-storage.https.html new file mode 100644 index 0000000000..76add1edd8 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/cache-storage.https.html @@ -0,0 +1,35 @@ + +Same-origin prerendering can access cache storage + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/clients-matchall.https.html b/testing/web-platform/tests/speculation-rules/prerender/clients-matchall.https.html new file mode 100644 index 0000000000..31fcc90391 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/clients-matchall.https.html @@ -0,0 +1,52 @@ + +Service Worker: Clients.matchAll with a prerender page + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/cookies.https.html b/testing/web-platform/tests/speculation-rules/prerender/cookies.https.html new file mode 100644 index 0000000000..2f02197fb5 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/cookies.https.html @@ -0,0 +1,37 @@ + +Same-origin prerendering can access cookies + + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/credentialed-prerender-not-opt-in.html b/testing/web-platform/tests/speculation-rules/prerender/credentialed-prerender-not-opt-in.html new file mode 100644 index 0000000000..697382a6dc --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/credentialed-prerender-not-opt-in.html @@ -0,0 +1,27 @@ + +same-site cross-origin prerendering not opt in + + + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/credentialed-prerender-opt-in.html b/testing/web-platform/tests/speculation-rules/prerender/credentialed-prerender-opt-in.html new file mode 100644 index 0000000000..91626bafce --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/credentialed-prerender-opt-in.html @@ -0,0 +1,24 @@ + +same-site cross-origin prerendering opt in + + + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/cross-origin-iframe.html b/testing/web-platform/tests/speculation-rules/prerender/cross-origin-iframe.html new file mode 100644 index 0000000000..0fc92fcce1 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/cross-origin-iframe.html @@ -0,0 +1,64 @@ + + +Load a cross-origin document in a prerendered iframe + + + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/cross-origin-isolated.https.html b/testing/web-platform/tests/speculation-rules/prerender/cross-origin-isolated.https.html new file mode 100644 index 0000000000..9d5d8b3693 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/cross-origin-isolated.https.html @@ -0,0 +1,29 @@ + +Allow crossOriginIsolated in prerendered page + + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/csp-script-src-elem-inline-speculation-rules.html b/testing/web-platform/tests/speculation-rules/prerender/csp-script-src-elem-inline-speculation-rules.html new file mode 100644 index 0000000000..7f33c32793 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/csp-script-src-elem-inline-speculation-rules.html @@ -0,0 +1,30 @@ + + + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/csp-script-src-inline-speculation-rules.html b/testing/web-platform/tests/speculation-rules/prerender/csp-script-src-inline-speculation-rules.html new file mode 100644 index 0000000000..1d5b35c30f --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/csp-script-src-inline-speculation-rules.html @@ -0,0 +1,30 @@ + + + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/csp-script-src-self.html b/testing/web-platform/tests/speculation-rules/prerender/csp-script-src-self.html new file mode 100644 index 0000000000..86cf9def4a --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/csp-script-src-self.html @@ -0,0 +1,30 @@ + + + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/csp-script-src-strict-dynamic.html b/testing/web-platform/tests/speculation-rules/prerender/csp-script-src-strict-dynamic.html new file mode 100644 index 0000000000..d5d8079401 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/csp-script-src-strict-dynamic.html @@ -0,0 +1,30 @@ + + + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/csp-script-src-unsafe-inline.html b/testing/web-platform/tests/speculation-rules/prerender/csp-script-src-unsafe-inline.html new file mode 100644 index 0000000000..b9b3092a12 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/csp-script-src-unsafe-inline.html @@ -0,0 +1,30 @@ + + + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/fetch-blob.html b/testing/web-platform/tests/speculation-rules/prerender/fetch-blob.html new file mode 100644 index 0000000000..3158b0f1a0 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/fetch-blob.html @@ -0,0 +1,38 @@ + +Same-origin prerendering can access blobs + + + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/fetch-intercepted-by-service-worker.https.html b/testing/web-platform/tests/speculation-rules/prerender/fetch-intercepted-by-service-worker.https.html new file mode 100644 index 0000000000..68db1b537f --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/fetch-intercepted-by-service-worker.https.html @@ -0,0 +1,44 @@ + +Service worker intercepts a fetch request coming from a prerendered page + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/iframe-added-post-activation.html b/testing/web-platform/tests/speculation-rules/prerender/iframe-added-post-activation.html new file mode 100644 index 0000000000..d22b511e10 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/iframe-added-post-activation.html @@ -0,0 +1,32 @@ + + +iframe added after activation + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/indexeddb.html b/testing/web-platform/tests/speculation-rules/prerender/indexeddb.html new file mode 100644 index 0000000000..f8240014de --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/indexeddb.html @@ -0,0 +1,42 @@ + +Same-origin prerendering can access Indexed Database + + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/local-storage.html b/testing/web-platform/tests/speculation-rules/prerender/local-storage.html new file mode 100644 index 0000000000..73f760cfb0 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/local-storage.html @@ -0,0 +1,54 @@ + +Same-origin prerendering can access localStorage + + + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/main-frame-navigation.https.html b/testing/web-platform/tests/speculation-rules/prerender/main-frame-navigation.https.html new file mode 100644 index 0000000000..2391f72197 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/main-frame-navigation.https.html @@ -0,0 +1,39 @@ + +Test about: main frame navigation in a prerendered page + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/media-autoplay.html b/testing/web-platform/tests/speculation-rules/prerender/media-autoplay.html new file mode 100644 index 0000000000..f5d3291ffd --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/media-autoplay.html @@ -0,0 +1,47 @@ + +Same-origin prerendering can trigger autoplay + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/navigation-api-location-replace.html b/testing/web-platform/tests/speculation-rules/prerender/navigation-api-location-replace.html new file mode 100644 index 0000000000..e3ecf1b72b --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/navigation-api-location-replace.html @@ -0,0 +1,61 @@ + + + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/navigation-api-multiple-entries.html b/testing/web-platform/tests/speculation-rules/prerender/navigation-api-multiple-entries.html new file mode 100644 index 0000000000..e8e0f87459 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/navigation-api-multiple-entries.html @@ -0,0 +1,54 @@ + + + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/navigation-api.html b/testing/web-platform/tests/speculation-rules/prerender/navigation-api.html new file mode 100644 index 0000000000..fd25e94b5b --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/navigation-api.html @@ -0,0 +1,60 @@ + + + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/navigation-intercepted-by-service-worker.https.html b/testing/web-platform/tests/speculation-rules/prerender/navigation-intercepted-by-service-worker.https.html new file mode 100644 index 0000000000..2c40aba0e9 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/navigation-intercepted-by-service-worker.https.html @@ -0,0 +1,43 @@ + +Service worker intercepts a navigation and starts prerendering + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/navigator-plugins.html b/testing/web-platform/tests/speculation-rules/prerender/navigator-plugins.html new file mode 100644 index 0000000000..4d7fa4902a --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/navigator-plugins.html @@ -0,0 +1,46 @@ + +Same-origin prerendering can access navigator.plugins + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/prefetch.https.html b/testing/web-platform/tests/speculation-rules/prerender/prefetch.https.html new file mode 100644 index 0000000000..42e4fa4786 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/prefetch.https.html @@ -0,0 +1,22 @@ + + + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/prerender-while-prerender.html b/testing/web-platform/tests/speculation-rules/prerender/prerender-while-prerender.html new file mode 100644 index 0000000000..8aa80baf52 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/prerender-while-prerender.html @@ -0,0 +1,46 @@ + + + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/referrer-policy-from-rules.html b/testing/web-platform/tests/speculation-rules/prerender/referrer-policy-from-rules.html new file mode 100644 index 0000000000..7e3b65fe61 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/referrer-policy-from-rules.html @@ -0,0 +1,44 @@ + + +Prerender with the referrer policy specified in speculation rules + + + + + + + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/referrer-policy-mismatch.html b/testing/web-platform/tests/speculation-rules/prerender/referrer-policy-mismatch.html new file mode 100644 index 0000000000..fa2d424660 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/referrer-policy-mismatch.html @@ -0,0 +1,92 @@ + +Referrer policy mismatches must be allowed between prerendering and activation + + + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/referrer-policy-no-referrer.html b/testing/web-platform/tests/speculation-rules/prerender/referrer-policy-no-referrer.html new file mode 100644 index 0000000000..a0d1763f95 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/referrer-policy-no-referrer.html @@ -0,0 +1,22 @@ + + + +Test noreferrer + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/referrer-policy-origin.html b/testing/web-platform/tests/speculation-rules/prerender/referrer-policy-origin.html new file mode 100644 index 0000000000..95eb8ba72f --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/referrer-policy-origin.html @@ -0,0 +1,26 @@ + + + +Test origin referrer + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/referrer-policy-strict-origin.html b/testing/web-platform/tests/speculation-rules/prerender/referrer-policy-strict-origin.html new file mode 100644 index 0000000000..0861012fa4 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/referrer-policy-strict-origin.html @@ -0,0 +1,23 @@ + + + +Test strict-origin referrer + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/referrer.html b/testing/web-platform/tests/speculation-rules/prerender/referrer.html new file mode 100644 index 0000000000..c0ecc845b5 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/referrer.html @@ -0,0 +1,21 @@ + +Test default referrer + + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/register-service-worker.https.html b/testing/web-platform/tests/speculation-rules/prerender/register-service-worker.https.html new file mode 100644 index 0000000000..58245c24d3 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/register-service-worker.https.html @@ -0,0 +1,52 @@ + +Registration of a new service worker in a prerendered page + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/remove-script-element.html b/testing/web-platform/tests/speculation-rules/prerender/remove-script-element.html new file mode 100644 index 0000000000..31f5f4bb4b --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/remove-script-element.html @@ -0,0 +1,25 @@ + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/about-blank-iframes.html b/testing/web-platform/tests/speculation-rules/prerender/resources/about-blank-iframes.html new file mode 100644 index 0000000000..db99d586e2 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/about-blank-iframes.html @@ -0,0 +1,115 @@ + + +about:blank iframe initiator and prerendered page + + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/accept-ch.html b/testing/web-platform/tests/speculation-rules/prerender/resources/accept-ch.html new file mode 100644 index 0000000000..1a23661a44 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/accept-ch.html @@ -0,0 +1,4 @@ + + + This page does nothing but update the ACCEPT-CH headers. + diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/accept-ch.html.headers b/testing/web-platform/tests/speculation-rules/prerender/resources/accept-ch.html.headers new file mode 100644 index 0000000000..6c56648705 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/accept-ch.html.headers @@ -0,0 +1,2 @@ +Accept-CH: sec-ch-ua-bitness +Access-Control-Allow-Origin: * \ No newline at end of file diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/audio-setSinkId.https.html b/testing/web-platform/tests/speculation-rules/prerender/resources/audio-setSinkId.https.html new file mode 100644 index 0000000000..1121b20915 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/audio-setSinkId.https.html @@ -0,0 +1,27 @@ + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/background-fetch.https.html b/testing/web-platform/tests/speculation-rules/prerender/resources/background-fetch.https.html new file mode 100644 index 0000000000..659a821e35 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/background-fetch.https.html @@ -0,0 +1,29 @@ + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/background-sync.https.html b/testing/web-platform/tests/speculation-rules/prerender/resources/background-sync.https.html new file mode 100644 index 0000000000..dd452aa345 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/background-sync.https.html @@ -0,0 +1,29 @@ + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/battery-status.https.html b/testing/web-platform/tests/speculation-rules/prerender/resources/battery-status.https.html new file mode 100644 index 0000000000..dc1e745cbe --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/battery-status.https.html @@ -0,0 +1,21 @@ + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/bear-av1-opus.mp4 b/testing/web-platform/tests/speculation-rules/prerender/resources/bear-av1-opus.mp4 new file mode 100644 index 0000000000..64a5e1ffcc Binary files /dev/null and b/testing/web-platform/tests/speculation-rules/prerender/resources/bear-av1-opus.mp4 differ diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/bluetooth-access.https.html b/testing/web-platform/tests/speculation-rules/prerender/resources/bluetooth-access.https.html new file mode 100644 index 0000000000..b14b46c09c --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/bluetooth-access.https.html @@ -0,0 +1,25 @@ + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/broadcast-channel.html b/testing/web-platform/tests/speculation-rules/prerender/resources/broadcast-channel.html new file mode 100644 index 0000000000..14980720a1 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/broadcast-channel.html @@ -0,0 +1,35 @@ + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/cache.txt b/testing/web-platform/tests/speculation-rules/prerender/resources/cache.txt new file mode 100644 index 0000000000..89164cfabe --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/cache.txt @@ -0,0 +1 @@ +Hello, Prerender API! \ No newline at end of file diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/clients-matchall-service-worker.js b/testing/web-platform/tests/speculation-rules/prerender/resources/clients-matchall-service-worker.js new file mode 100644 index 0000000000..634b13160a --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/clients-matchall-service-worker.js @@ -0,0 +1,11 @@ +onmessage = e => { + // Collect all client URLs in this origin. + const options = { includeUncontrolled: true, type: 'all' }; + const promise = self.clients.matchAll(options) + .then(clients => { + const client_urls = []; + clients.forEach(client => client_urls.push(client.url)); + e.source.postMessage(client_urls); + }); + e.waitUntil(promise); +}; diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/cross-origin-iframe-src.html b/testing/web-platform/tests/speculation-rules/prerender/resources/cross-origin-iframe-src.html new file mode 100644 index 0000000000..77fa9bc208 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/cross-origin-iframe-src.html @@ -0,0 +1,7 @@ + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/cross-origin-iframe.html b/testing/web-platform/tests/speculation-rules/prerender/resources/cross-origin-iframe.html new file mode 100644 index 0000000000..10a3b62f0e --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/cross-origin-iframe.html @@ -0,0 +1,57 @@ + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/cross-origin-isolated-iframe.https.html b/testing/web-platform/tests/speculation-rules/prerender/resources/cross-origin-isolated-iframe.https.html new file mode 100644 index 0000000000..acad3c3e64 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/cross-origin-isolated-iframe.https.html @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/cross-origin-isolated-iframe.https.html.headers b/testing/web-platform/tests/speculation-rules/prerender/resources/cross-origin-isolated-iframe.https.html.headers new file mode 100644 index 0000000000..b227e843ae --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/cross-origin-isolated-iframe.https.html.headers @@ -0,0 +1,2 @@ +Cross-Origin-Embedder-Policy: require-corp +Cross-Origin-Resource-Policy: cross-origin \ No newline at end of file diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/cross-origin-isolated.https.html b/testing/web-platform/tests/speculation-rules/prerender/resources/cross-origin-isolated.https.html new file mode 100644 index 0000000000..4fdc6c9541 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/cross-origin-isolated.https.html @@ -0,0 +1,21 @@ + + + + + + + \ No newline at end of file diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/cross-origin-isolated.https.html.headers b/testing/web-platform/tests/speculation-rules/prerender/resources/cross-origin-isolated.https.html.headers new file mode 100644 index 0000000000..5f8621ef83 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/cross-origin-isolated.https.html.headers @@ -0,0 +1,2 @@ +Cross-Origin-Embedder-Policy: require-corp +Cross-Origin-Opener-Policy: same-origin diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/csp-script-src-elem-inline-speculation-rules.html b/testing/web-platform/tests/speculation-rules/prerender/resources/csp-script-src-elem-inline-speculation-rules.html new file mode 100644 index 0000000000..19aff92206 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/csp-script-src-elem-inline-speculation-rules.html @@ -0,0 +1,14 @@ + + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/csp-script-src-inline-speculation-rules.html b/testing/web-platform/tests/speculation-rules/prerender/resources/csp-script-src-inline-speculation-rules.html new file mode 100644 index 0000000000..febfbd01ba --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/csp-script-src-inline-speculation-rules.html @@ -0,0 +1,14 @@ + + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/csp-script-src-self.html b/testing/web-platform/tests/speculation-rules/prerender/resources/csp-script-src-self.html new file mode 100644 index 0000000000..8dc382068a --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/csp-script-src-self.html @@ -0,0 +1,15 @@ + + + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/csp-script-src-strict-dynamic.html b/testing/web-platform/tests/speculation-rules/prerender/resources/csp-script-src-strict-dynamic.html new file mode 100644 index 0000000000..00db373c47 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/csp-script-src-strict-dynamic.html @@ -0,0 +1,15 @@ + + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/csp-script-src-unsafe-inline.html b/testing/web-platform/tests/speculation-rules/prerender/resources/csp-script-src-unsafe-inline.html new file mode 100644 index 0000000000..d2f010dc56 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/csp-script-src-unsafe-inline.html @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/csp-script-src.js b/testing/web-platform/tests/speculation-rules/prerender/resources/csp-script-src.js new file mode 100644 index 0000000000..6107819a36 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/csp-script-src.js @@ -0,0 +1,60 @@ +const params = new URLSearchParams(location.search); + +// Take a key used for storing a test result in the server. +const key = params.get('key'); + +// Take a target hint to decide a target context for prerendering. +const rule_extras = {'target_hint': getTargetHint()}; + +// Speculation rules injection is blocked in the csp-script-src 'self' test. +const block = location.pathname.endsWith('csp-script-src-self.html'); + +// The main test page (csp-script-src-*.html) in the parent directory) will load +// this page only with the "key" parameter. This page will then try prerendering +// itself with the "run-test" parameter. When "run-test" is in the URL we'll +// actually start the test process and record the results to send back to the +// main test page. We do this because the main test page cannot navigate itself +// but it also cannot open a popup to a prerendered browsing context so the +// prerender triggering and activation must both happen in this popup. +const run_test = params.has('run-test'); +if (!run_test) { + // Generate a new stash key so we can communicate with the prerendered page + // about when to close the popup. + const done_key = token(); + const url = new URL(document.URL); + url.searchParams.append('run-test', ''); + url.searchParams.append('done-key', done_key); + + if (block) { + // Observe `securitypolicyviolation` event that will be triggered by + // startPrerendering(). + document.addEventListener('securitypolicyviolation', e => { + if (e.effectiveDirective != 'script-src' && + e.effectiveDirective != 'script-src-elem') { + const message = 'unexpected effective directive: ' + e.effectiveDirective; + writeValueToServer(key, message).then(() => { window.close(); }); + } else { + const message = 'blocked by ' + e.effectiveDirective; + writeValueToServer(key, message).then(() => { window.close(); }); + } + }); + } + + startPrerendering(url.toString(), rule_extras); + + // Wait until the prerendered page signals us it's ready to close. + nextValueFromServer(done_key).then(() => { + window.close(); + }); +} else { + if (block) { + writeValueToServer(key, 'unexpected prerendering'); + } else { + // Tell the harness the initial document.prerendering value. + writeValueToServer(key, document.prerendering); + + // Tell the prerendering initiating page test being finished. + const done_key = params.get('done-key'); + writeValueToServer(done_key, "done"); + } +} diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/dedicated-worker.https.html b/testing/web-platform/tests/speculation-rules/prerender/resources/dedicated-worker.https.html new file mode 100644 index 0000000000..570d4b33a1 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/dedicated-worker.https.html @@ -0,0 +1,31 @@ + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/dedicated-worker.js b/testing/web-platform/tests/speculation-rules/prerender/resources/dedicated-worker.js new file mode 100644 index 0000000000..d8029556be --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/dedicated-worker.js @@ -0,0 +1 @@ +postMessage('readyToActivate'); diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/deferred-promise-utils.js b/testing/web-platform/tests/speculation-rules/prerender/resources/deferred-promise-utils.js new file mode 100644 index 0000000000..19bc981a2a --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/deferred-promise-utils.js @@ -0,0 +1,74 @@ +/** + * This file co-works with a html file and utils.js to test a promise that + * should be deferred during prerendering. + * + * Usage example: + * Suppose the html is "prerender-promise-test.html" + * On prerendering page, prerender-promise-test.html?prerendering: + * const prerenderEventCollector = new PrerenderEventCollector(); + * const promise = {a promise that should be deferred during prerendering}; + * prerenderEventCollector.start(promise, {promise name}); + * + * On the initiator page, prerender-promise-test.html: + * execute + * `loadInitiatorPage();` + */ + +// Collects events that happen relevant to a prerendering page. +// An event is added when: +// 1. start() is called. +// 2. a prerenderingchange event is dispatched on this document. +// 3. the promise passed to start() is resolved. +// 4. addEvent() is called manually. +class PrerenderEventCollector { + constructor() { + this.eventsSeen_ = []; + new PrerenderChannel('close').addEventListener('message', () => { + window.close(); + }); + } + + // Adds an event to `eventsSeen_` along with the prerendering state of the + // page. + addEvent(eventMessage) { + this.eventsSeen_.push( + {event: eventMessage, prerendering: document.prerendering}); + } + + // Starts collecting events until the promise resolves. Triggers activation by + // telling the initiator page that it is ready for activation. + async start(promise, promiseName) { + assert_true(document.prerendering); + this.addEvent(`started waiting ${promiseName}`); + promise + .then( + () => { + this.addEvent(`finished waiting ${promiseName}`); + }, + (error) => { + if (error instanceof Error) + error = error.name; + this.addEvent(`${promiseName} rejected: ${error}`); + }) + .finally(() => { + // Used to communicate with the main test page. + const testChannel = new PrerenderChannel('test-channel'); + // Send the observed events back to the main test page. + testChannel.postMessage(this.eventsSeen_); + testChannel.close(); + }); + document.addEventListener('prerenderingchange', () => { + this.addEvent('prerendering change'); + }); + + // Post a task to give the implementation a chance to fail in case it + // resolves a promise without waiting for activation. + setTimeout(() => { + // Used to communicate with the initiator page. + const prerenderChannel = new PrerenderChannel('prerender-channel'); + // Inform the initiator page that this page is ready to be activated. + prerenderChannel.postMessage('readyToActivate'); + prerenderChannel.close(); + }, 0); + } +} diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/deprecated-broadcast-channel.py b/testing/web-platform/tests/speculation-rules/prerender/resources/deprecated-broadcast-channel.py new file mode 100644 index 0000000000..62631d922f --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/deprecated-broadcast-channel.py @@ -0,0 +1,28 @@ +import json +import time +def main(request, response): + uid = request.GET.first(b"uid") + name = request.GET.first(b"name") + time.sleep(0.1) + + messagesByName = [] + if request.method == 'POST': + with request.server.stash.lock: + messages = request.server.stash.take(uid) or {} + if name in messages: + messagesByName = messages[name] + + messagesByName.append(json.loads(request.body)) + messages[name] = messagesByName + request.server.stash.put(uid, messages) + response.status = 204 + else: + with request.server.stash.lock: + messages = request.server.stash.take(uid) or {} + if name in messages: + messagesByName = messages[name] + + request.server.stash.put(uid, messages) + response.status = 200 + response.headers['Content-Type'] = 'application/json' + response.content = json.dumps(messagesByName) diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/do-nothing-worker.js b/testing/web-platform/tests/speculation-rules/prerender/resources/do-nothing-worker.js new file mode 100644 index 0000000000..49ceb2648a --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/do-nothing-worker.js @@ -0,0 +1 @@ +// Do nothing. diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/echo-client-hints-received.py b/testing/web-platform/tests/speculation-rules/prerender/resources/echo-client-hints-received.py new file mode 100644 index 0000000000..26bd48d007 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/echo-client-hints-received.py @@ -0,0 +1,88 @@ +""" Handle the initiator navigation request and attach the received client info +to the returned page. +""" + + +import textwrap + +html_template = """ + + + +echo client hints on prerendering page + + + + + + +""" + +def translate_to_js(val: bool) -> str: + if isinstance(val, bool): + return "true" if val else "false" + return "" + +def main(request, response): + response.status = 200 + + # Insert the received hints into script. + content = html_template % ( + textwrap.dedent( + f""" + const server_received_bitness = + {translate_to_js(b"sec-ch-ua-bitness" in request.headers)}; + const server_received_full_version_list = + {translate_to_js(b"sec-ch-ua-full-version-list" in + request.headers)}; + """ + ) + ) + response.content = content.encode("utf-8") diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/echo-prerender-page-client-hints-received.py b/testing/web-platform/tests/speculation-rules/prerender/resources/echo-prerender-page-client-hints-received.py new file mode 100644 index 0000000000..b32dcec8f6 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/echo-prerender-page-client-hints-received.py @@ -0,0 +1,96 @@ +""" Handle the prerendering navigation request and insert the received client +info to the returned page. +""" + +import textwrap + +html_template = """ + + + +echo client hints on prerendering page + + + + + + +""" + +def translate_to_js(val: bool) -> str: + if isinstance(val, bool): + return "true" if val else "false" + return "" + +def main(request, response): + response.headers.set(b"Accept-CH", "sec-ch-ua-full-version-list") + response.status = 200 + + # Insert the received hints into script. + content = html_template % ( + textwrap.dedent( + f""" + const server_received_bitness = + {translate_to_js(b"sec-ch-ua-bitness" in request.headers)}; + const server_received_full_version_list = + {translate_to_js(b"sec-ch-ua-full-version-list" in + request.headers)}; + """ + ) + ) + response.content = content.encode("utf-8") diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/echo-referrer.py b/testing/web-platform/tests/speculation-rules/prerender/resources/echo-referrer.py new file mode 100644 index 0000000000..38b54291ca --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/echo-referrer.py @@ -0,0 +1,27 @@ +"""A page that echoes the Referrer header value via BroadcastChannel. +""" + + +def main(request, response): + referrer = request.headers.get(b"referer") + uid = request.GET.first(b"uid") + + if referrer is None: + referrer = b"(none)" + + html = u''' + + +Echo referrer + + + + + + +''' + return (200, [("Content-Type", b"text/html")], + html % (uid.decode("utf-8"), referrer.decode("utf-8"))) diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/echo-subresource-client-hints-received.py b/testing/web-platform/tests/speculation-rules/prerender/resources/echo-subresource-client-hints-received.py new file mode 100644 index 0000000000..bb0d128e50 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/echo-subresource-client-hints-received.py @@ -0,0 +1,15 @@ +""" Handle the sub-resource requests and attach the received client info to +the response. +""" + + +def main(request, response): + response.status = 200 + + # Echo the received CH headers. + response.headers.set( + b"server_received_bitness", + "true" if b"sec-ch-ua-bitness" in request.headers else "false") + response.headers.set( + b"server_received_full_version_list", "true" + if b"sec-ch-ua-full-version-list" in request.headers else "false") diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/empty.html b/testing/web-platform/tests/speculation-rules/prerender/resources/empty.html new file mode 100644 index 0000000000..e69de29bb2 diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/encrypted-media.https.html b/testing/web-platform/tests/speculation-rules/prerender/resources/encrypted-media.https.html new file mode 100644 index 0000000000..1c3a3ab0ea --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/encrypted-media.https.html @@ -0,0 +1,39 @@ + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/exec.html b/testing/web-platform/tests/speculation-rules/prerender/resources/exec.html new file mode 100644 index 0000000000..1eebaa73d0 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/exec.html @@ -0,0 +1,18 @@ + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/exec.py b/testing/web-platform/tests/speculation-rules/prerender/resources/exec.py new file mode 100644 index 0000000000..de0636117d --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/exec.py @@ -0,0 +1,26 @@ +from wptserve.utils import isomorphic_decode +import os + +def main(request, response): + purpose = request.headers.get(b"purpose") + if (purpose == b'prefetch' and b"code" in request.GET): + code = int(request.GET.first(b"code")) + else: + code = 200 + + if b"uuid" in request.GET: + path = '/speculation-rules/prerender/resources/exec.py' + uuid = request.GET.first(b"uuid") + with request.server.stash.lock: + count = request.server.stash.take(uuid, path) or 0 + if b"get-fetch-count" in request.GET: + response.status = 200 + response.content = '%d' % count + request.server.stash.put(uuid, count, path) + return + count += 1 + request.server.stash.put(uuid, count, path) + + with open(os.path.join(os.path.dirname(isomorphic_decode(__file__)), "exec.html"), u"r") as fn: + response.content = fn.read() + response.status = code diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/fetch-intercept-worker.js b/testing/web-platform/tests/speculation-rules/prerender/resources/fetch-intercept-worker.js new file mode 100644 index 0000000000..f6e056a8eb --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/fetch-intercept-worker.js @@ -0,0 +1,9 @@ +self.addEventListener('fetch', e => { + if (e.request.url.includes('should-intercept')) { + if (e.request.destination === 'document') { + e.respondWith(fetch('./prerendered-page.html')); + } else { + e.respondWith(new Response('intercepted by service worker')); + } + } +}); diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/fetch-intercepted-by-service-worker.html b/testing/web-platform/tests/speculation-rules/prerender/resources/fetch-intercepted-by-service-worker.html new file mode 100644 index 0000000000..46aefb4e15 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/fetch-intercepted-by-service-worker.html @@ -0,0 +1,22 @@ + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/file-picker.html b/testing/web-platform/tests/speculation-rules/prerender/resources/file-picker.html new file mode 100644 index 0000000000..22245a49bc --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/file-picker.html @@ -0,0 +1,27 @@ + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/generic-sensor.https.html b/testing/web-platform/tests/speculation-rules/prerender/resources/generic-sensor.https.html new file mode 100644 index 0000000000..26f4ac7dcd --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/generic-sensor.https.html @@ -0,0 +1,35 @@ + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/idle-detection.https.html b/testing/web-platform/tests/speculation-rules/prerender/resources/idle-detection.https.html new file mode 100644 index 0000000000..4f4554983a --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/idle-detection.https.html @@ -0,0 +1,27 @@ + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/iframe-added-post-activation.html b/testing/web-platform/tests/speculation-rules/prerender/resources/iframe-added-post-activation.html new file mode 100644 index 0000000000..10a48df58c --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/iframe-added-post-activation.html @@ -0,0 +1,57 @@ + + +iframe added post activation: initiator and prerendered page + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/indexedb-utils.js b/testing/web-platform/tests/speculation-rules/prerender/resources/indexedb-utils.js new file mode 100644 index 0000000000..7c57000d5c --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/indexedb-utils.js @@ -0,0 +1,61 @@ +const STORAGE_NAME = 'prerender_test'; +const INITIATOR_KEY = 'initiator'; +const INITIATOR_VALUE = INITIATOR_KEY + '_set'; +const PRERENDER_KEY = 'prerender'; +const PRERENDER_VALUE = PRERENDER_KEY + '_set'; + +async function openIndexedDatabase(t) { + return new Promise(resolve => { + const request = window.indexedDB.open(STORAGE_NAME); + if (t) + t.add_cleanup(() => new Promise(resolve => { + window.indexedDB.deleteDatabase(STORAGE_NAME); + resolve(); + })); + request.onupgradeneeded = e => { + const db = e.target.result; + const objectStore = + db.createObjectStore(STORAGE_NAME, {autoIncrement: true}); + objectStore.createIndex('key', 'key', {unique: true}); + }; + request.onerror = e => { + resolve(null); + }; + request.onsuccess = e => { + resolve(e.target.result); + }; + }); +} + +async function addData(db, key, value) { + return new Promise((resolve, reject) => { + const transaction = db.transaction(STORAGE_NAME, 'readwrite'); + const request = + transaction.objectStore(STORAGE_NAME).add({'key': key, 'value': value}); + // Use `transaction.oncomplete` rather than `request.onsuccess` to ensure + // that IndexedDB has flushed to disk. + transaction.oncomplete = e => { + resolve(true); + }; + transaction.onerror = e => { + reject(e.target.error); + }; + }); +} + +async function readData(db, key) { + return new Promise((resolve, reject) => { + const transaction = db.transaction(STORAGE_NAME); + const request = transaction.objectStore(STORAGE_NAME).index('key').get(key); + request.onsuccess = e => { + if (e.target.result) { + resolve(e.target.result.value); + } else { + reject(new Error('Empty result.')); + } + }; + request.onerror = e => { + reject(e.target.error); + }; + }); +} diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/key-value-store.py b/testing/web-platform/tests/speculation-rules/prerender/resources/key-value-store.py new file mode 100644 index 0000000000..1ab609f11b --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/key-value-store.py @@ -0,0 +1,27 @@ +"""Key-Value store server. + +The request takes "key=" and "value=" URL parameters. The key must be UUID +generated by token(). + +- When only the "key=" is specified, serves a 200 response whose body contains + the stored value specified by the key. If the stored value doesn't exist, + serves a 200 response with an empty body. +- When both the "key=" and "value=" are specified, stores the pair and serves + a 200 response without body. +""" + + +def main(request, response): + key = request.GET.get(b"key") + value = request.GET.get(b"value", None) + + # Store the value. + if value: + request.server.stash.put(key, value) + return (200, [], b"") + + # Get the value. + data = request.server.stash.take(key) + if not data: + return (200, [], b"") + return (200, [], data) diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/main-frame-navigation.html b/testing/web-platform/tests/speculation-rules/prerender/resources/main-frame-navigation.html new file mode 100644 index 0000000000..8781edef66 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/main-frame-navigation.html @@ -0,0 +1,84 @@ + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/media-autoplay-attribute.html b/testing/web-platform/tests/speculation-rules/prerender/resources/media-autoplay-attribute.html new file mode 100644 index 0000000000..c14df77154 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/media-autoplay-attribute.html @@ -0,0 +1,41 @@ + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/media-device-info.https.html b/testing/web-platform/tests/speculation-rules/prerender/resources/media-device-info.https.html new file mode 100644 index 0000000000..14d2ff78c9 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/media-device-info.https.html @@ -0,0 +1,26 @@ + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/media-devices-access.https.html b/testing/web-platform/tests/speculation-rules/prerender/resources/media-devices-access.https.html new file mode 100644 index 0000000000..6739605f03 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/media-devices-access.https.html @@ -0,0 +1,27 @@ + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/media-play.html b/testing/web-platform/tests/speculation-rules/prerender/resources/media-play.html new file mode 100644 index 0000000000..f4c0af9579 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/media-play.html @@ -0,0 +1,42 @@ + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/message-boxes.html b/testing/web-platform/tests/speculation-rules/prerender/resources/message-boxes.html new file mode 100644 index 0000000000..8e0a6e874f --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/message-boxes.html @@ -0,0 +1,50 @@ + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/midi.https.html b/testing/web-platform/tests/speculation-rules/prerender/resources/midi.https.html new file mode 100644 index 0000000000..0cd98a1693 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/midi.https.html @@ -0,0 +1,37 @@ + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/navigator-plugins.html b/testing/web-platform/tests/speculation-rules/prerender/resources/navigator-plugins.html new file mode 100644 index 0000000000..dcb9302d8d --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/navigator-plugins.html @@ -0,0 +1,20 @@ + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/notification-before-activation.html b/testing/web-platform/tests/speculation-rules/prerender/resources/notification-before-activation.html new file mode 100644 index 0000000000..16aab488a5 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/notification-before-activation.html @@ -0,0 +1,40 @@ + + + + + + \ No newline at end of file diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/notification-on-activation.html b/testing/web-platform/tests/speculation-rules/prerender/resources/notification-on-activation.html new file mode 100644 index 0000000000..0a85746b04 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/notification-on-activation.html @@ -0,0 +1,44 @@ + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/post-message-prerendering-completion-notification.html b/testing/web-platform/tests/speculation-rules/prerender/resources/post-message-prerendering-completion-notification.html new file mode 100644 index 0000000000..77fa9bc208 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/post-message-prerendering-completion-notification.html @@ -0,0 +1,7 @@ + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/postmessage-to-client-worker.js b/testing/web-platform/tests/speculation-rules/prerender/resources/postmessage-to-client-worker.js new file mode 100644 index 0000000000..4aff84f336 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/postmessage-to-client-worker.js @@ -0,0 +1,3 @@ +self.onmessage = e => { + e.source.postMessage('postmessage to client'); +}; diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/postmessage-to-service-worker.html b/testing/web-platform/tests/speculation-rules/prerender/resources/postmessage-to-service-worker.html new file mode 100644 index 0000000000..198ef64b2c --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/postmessage-to-service-worker.html @@ -0,0 +1,34 @@ + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/prerender-response-code.html b/testing/web-platform/tests/speculation-rules/prerender/resources/prerender-response-code.html new file mode 100644 index 0000000000..c3a680bba8 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/prerender-response-code.html @@ -0,0 +1,22 @@ + + + + + \ No newline at end of file diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/prerender-state.html b/testing/web-platform/tests/speculation-rules/prerender/resources/prerender-state.html new file mode 100644 index 0000000000..34a59f07ee --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/prerender-state.html @@ -0,0 +1,85 @@ + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/prerender-while-prerender-initiator.html b/testing/web-platform/tests/speculation-rules/prerender/resources/prerender-while-prerender-initiator.html new file mode 100644 index 0000000000..1764271581 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/prerender-while-prerender-initiator.html @@ -0,0 +1,18 @@ + + +Prerender while prerendering test: referrer page, opened in a window + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/prerender-while-prerender-inner.html b/testing/web-platform/tests/speculation-rules/prerender/resources/prerender-while-prerender-inner.html new file mode 100644 index 0000000000..60b6c64ded --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/prerender-while-prerender-inner.html @@ -0,0 +1,19 @@ + + +Prerender while prerendering test: inner maybe-prerendered page + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/prerender-while-prerender-outer.html b/testing/web-platform/tests/speculation-rules/prerender/resources/prerender-while-prerender-outer.html new file mode 100644 index 0000000000..313c34667f --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/prerender-while-prerender-outer.html @@ -0,0 +1,23 @@ + + +Prerender while prerendering test: outer prerendered page + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/prerendered-iframe.html b/testing/web-platform/tests/speculation-rules/prerender/resources/prerendered-iframe.html new file mode 100644 index 0000000000..dcdfb9b65b --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/prerendered-iframe.html @@ -0,0 +1,17 @@ + +Prerendered iframe + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/prerendered-page.html b/testing/web-platform/tests/speculation-rules/prerender/resources/prerendered-page.html new file mode 100644 index 0000000000..e6ab00788b --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/prerendered-page.html @@ -0,0 +1,17 @@ + +Prerendered page + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/presentation-request.html b/testing/web-platform/tests/speculation-rules/prerender/resources/presentation-request.html new file mode 100644 index 0000000000..18475a3d67 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/presentation-request.html @@ -0,0 +1,26 @@ + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/prompt-by-before-unload-inner-frame.html b/testing/web-platform/tests/speculation-rules/prerender/resources/prompt-by-before-unload-inner-frame.html new file mode 100644 index 0000000000..ba59ca7960 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/prompt-by-before-unload-inner-frame.html @@ -0,0 +1,12 @@ + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/prompt-by-before-unload.html b/testing/web-platform/tests/speculation-rules/prerender/resources/prompt-by-before-unload.html new file mode 100644 index 0000000000..8cfe09a41f --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/prompt-by-before-unload.html @@ -0,0 +1,53 @@ + + + + +
+ + diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/push.https.html b/testing/web-platform/tests/speculation-rules/prerender/resources/push.https.html new file mode 100644 index 0000000000..30eb563ab7 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/push.https.html @@ -0,0 +1,31 @@ + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/referrer-test.js b/testing/web-platform/tests/speculation-rules/prerender/resources/referrer-test.js new file mode 100644 index 0000000000..5091b6403c --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/referrer-test.js @@ -0,0 +1,15 @@ +async function referrer_test(expected, uid) { + const bc = new PrerenderChannel('prerender-channel', uid); + + const gotMessage = new Promise(resolve => { + bc.addEventListener('message', e => { + resolve(e.data); + }, {once: true}); + }); + + // Start prerendering a page that will echo its referrer. + startPrerendering(`resources/echo-referrer.py?uid=${uid}`); + + const result = await gotMessage; + assert_equals(result.referrer, expected, 'referrer'); +} diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/register-service-worker.html b/testing/web-platform/tests/speculation-rules/prerender/resources/register-service-worker.html new file mode 100644 index 0000000000..ccdf220573 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/register-service-worker.html @@ -0,0 +1,41 @@ + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/request-picture-in-picture.html b/testing/web-platform/tests/speculation-rules/prerender/resources/request-picture-in-picture.html new file mode 100644 index 0000000000..9aea3d33d5 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/request-picture-in-picture.html @@ -0,0 +1,34 @@ + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/sandbox-iframe.html b/testing/web-platform/tests/speculation-rules/prerender/resources/sandbox-iframe.html new file mode 100644 index 0000000000..478dfccb3a --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/sandbox-iframe.html @@ -0,0 +1,50 @@ + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/screen-capture.https.html b/testing/web-platform/tests/speculation-rules/prerender/resources/screen-capture.https.html new file mode 100644 index 0000000000..1304b9d74b --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/screen-capture.https.html @@ -0,0 +1,24 @@ + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/screen-orientation-lock.https.html b/testing/web-platform/tests/speculation-rules/prerender/resources/screen-orientation-lock.https.html new file mode 100644 index 0000000000..a152e34490 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/screen-orientation-lock.https.html @@ -0,0 +1,23 @@ + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/service-worker-unregister.html b/testing/web-platform/tests/speculation-rules/prerender/resources/service-worker-unregister.html new file mode 100644 index 0000000000..a78775a5a2 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/service-worker-unregister.html @@ -0,0 +1,34 @@ + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/service-worker-update.html b/testing/web-platform/tests/speculation-rules/prerender/resources/service-worker-update.html new file mode 100644 index 0000000000..d9a9273526 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/service-worker-update.html @@ -0,0 +1,33 @@ + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/service-worker.js b/testing/web-platform/tests/speculation-rules/prerender/resources/service-worker.js new file mode 100644 index 0000000000..763d55764a --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/service-worker.js @@ -0,0 +1,11 @@ +self.addEventListener("fetch", async e => { + if (e.request.url.endsWith("ping")) + e.respondWith(new Response('pong')); + else if (e.request.url.endsWith("client")) { + e.respondWith((async () => { + const client = await clients.get(e.clientId); + const clientInfo = client ? {id: e.clientId, visibilityState: client.visibilityState, focused: client.focused} : null; + return new Response(JSON.stringify({clientInfo}), {headers: {'Content-Type': 'application/json'}}); + })()); + } +}); diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/session-history-harness.js b/testing/web-platform/tests/speculation-rules/prerender/resources/session-history-harness.js new file mode 100644 index 0000000000..619ee3aa92 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/session-history-harness.js @@ -0,0 +1,75 @@ +// We don't have the test harness in this context, so we roll our own +// which communicates with our initiator which is actually running the tests. + +function assert(condition, message) { + if (!condition) { + throw new Error("Assertion failed: " + message); + } +} + +// Run a test after activation. +document.addEventListener("prerenderingchange", async (_) => { + // history.length is racy on activation. Wait *100ms* as a workaround. + // See crbug.com/1222893. + await new Promise((resolve) => { + window.setTimeout(resolve, 100); + }); + + const urlParams = new URLSearchParams(window.location.search); + const testName = urlParams.get("testName"); + const uid = urlParams.get("uid"); + const testChannel = new PrerenderChannel( + `test-channel-${testName}`, uid + ); + + try { + const activationTestFn = testName + "Activation"; + const testFn = window[activationTestFn]; + if (!testFn) { + testChannel.postMessage("Missing test: " + testName); + return; + } + testFn(); + testChannel.postMessage("Passed"); + } catch (e) { + testChannel.postMessage( + "Failed: " + e.name + ": " + e.message, + ); + } finally { + testChannel.close(); + } +}) + +if (document.prerendering) { + window.onload = async () => { + const urlParams = new URLSearchParams(window.location.search); + const testName = urlParams.get("testName"); + const uid = urlParams.get("uid"); + const prerenderChannel = new PrerenderChannel( + `prerender-channel-${testName}`, uid + ); + + // The document load event is not finished at this point, so navigations + // would be done with replacement. This interferes with our tests. We wait + // for the next task before navigating to avoid this. + await new Promise((resolve) => { + window.setTimeout(resolve); + }); + + try { + let testFn = window[testName]; + if (!testFn) { + prerenderChannel.postMessage("Missing test: " + testName); + return; + } + await testFn(); + prerenderChannel.postMessage("Passed"); + } catch (e) { + prerenderChannel.postMessage( + "Failed: " + e.name + ": " + e.message, + ); + } finally { + prerenderChannel.close(); + } + }; +} diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/session-history-initiator.https.html b/testing/web-platform/tests/speculation-rules/prerender/resources/session-history-initiator.https.html new file mode 100644 index 0000000000..f6d5eb555c --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/session-history-initiator.https.html @@ -0,0 +1,61 @@ + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/session-history-prerender.https.html b/testing/web-platform/tests/speculation-rules/prerender/resources/session-history-prerender.https.html new file mode 100644 index 0000000000..b02865c1bc --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/session-history-prerender.https.html @@ -0,0 +1,149 @@ + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/session-history-test-util.js b/testing/web-platform/tests/speculation-rules/prerender/resources/session-history-test-util.js new file mode 100644 index 0000000000..c1ca36dc2f --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/session-history-test-util.js @@ -0,0 +1,40 @@ +// Note: Following utility functions are expected to be used from +// session-history-* test files. + +async function waitChannelMessage(testName, uid) { + const result = new Promise((resolve) => { + const testChannel = new PrerenderChannel(testName, uid); + testChannel.addEventListener( + "message", + (e) => { + testChannel.close(); + resolve(e.data); + }, + { once: true }, + ); + }); + return result; +} + +async function runTestInPrerender(testName, uid) { + const result = waitChannelMessage(`test-channel-${testName}`, uid); + + // Run test in a new window for test isolation. + const prerender = "session-history-prerender.https.html"; + window.open( + `./resources/session-history-initiator.https.html?prerender=${prerender}&testName=${testName}&uid=${uid}`, + "_blank", + "noopener", + ); + return result; +} + +// This will activate the prerendered context created in runTestInPrerender +// and then run the post-activation variation of `testName`. +async function runTestInActivatedPage(testName, uid) { + const testChannel = new PrerenderChannel(`test-channel-${testName}`, uid); + testChannel.postMessage("activate"); + testChannel.close(); + + return waitChannelMessage(`test-channel-${testName}`, uid); +} diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/shared-worker.py b/testing/web-platform/tests/speculation-rules/prerender/resources/shared-worker.py new file mode 100644 index 0000000000..48e5cd9c15 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/shared-worker.py @@ -0,0 +1,11 @@ +def main(request, response): + if b"check" in request.GET: + with request.server.stash.lock: + result = request.server.stash.take(request.GET[b"id"]) + response.headers.set(b"Content-Type", b"text/plain") + return result + else: + with request.server.stash.lock: + request.server.stash.put(request.GET[b"id"], "ok") + response.headers.set(b"Content-Type", b"text/javascript") + return u"onconnect = ({ports: [port]}) => port.postMessage(performance.timeOrigin);" \ No newline at end of file diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/speech-synthesis.https.html b/testing/web-platform/tests/speculation-rules/prerender/resources/speech-synthesis.https.html new file mode 100644 index 0000000000..f7436e42ce --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/speech-synthesis.https.html @@ -0,0 +1,65 @@ + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/storage-persist.https.html b/testing/web-platform/tests/speculation-rules/prerender/resources/storage-persist.https.html new file mode 100644 index 0000000000..ab5fabd9e3 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/storage-persist.https.html @@ -0,0 +1,23 @@ + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/utils.js b/testing/web-platform/tests/speculation-rules/prerender/resources/utils.js new file mode 100644 index 0000000000..940edcc0ca --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/utils.js @@ -0,0 +1,451 @@ +const STORE_URL = '/speculation-rules/prerender/resources/key-value-store.py'; + +// Starts prerendering for `url`. +// +// `rule_extras` provides additional parameters for the speculation rule used +// to trigger prerendering. +function startPrerendering(url, rule_extras = {}) { + // Adds + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/web-hid.https.html b/testing/web-platform/tests/speculation-rules/prerender/resources/web-hid.https.html new file mode 100644 index 0000000000..e9531293ea --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/web-hid.https.html @@ -0,0 +1,23 @@ + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/web-locks.html b/testing/web-platform/tests/speculation-rules/prerender/resources/web-locks.html new file mode 100644 index 0000000000..621dd18b4d --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/web-locks.html @@ -0,0 +1,32 @@ + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/web-nfc.https.html b/testing/web-platform/tests/speculation-rules/prerender/resources/web-nfc.https.html new file mode 100644 index 0000000000..61207ab346 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/web-nfc.https.html @@ -0,0 +1,36 @@ + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/web-serial.https.html b/testing/web-platform/tests/speculation-rules/prerender/resources/web-serial.https.html new file mode 100644 index 0000000000..cfae1372c2 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/web-serial.https.html @@ -0,0 +1,27 @@ + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/web-share.https.html b/testing/web-platform/tests/speculation-rules/prerender/resources/web-share.https.html new file mode 100644 index 0000000000..f4e2f30471 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/web-share.https.html @@ -0,0 +1,24 @@ + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/web-usb.https.html b/testing/web-platform/tests/speculation-rules/prerender/resources/web-usb.https.html new file mode 100644 index 0000000000..555825a81c --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/web-usb.https.html @@ -0,0 +1,22 @@ + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/web-xr-immersive-vr-session.https.html b/testing/web-platform/tests/speculation-rules/prerender/resources/web-xr-immersive-vr-session.https.html new file mode 100644 index 0000000000..decb33657a --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/web-xr-immersive-vr-session.https.html @@ -0,0 +1,24 @@ + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/web-xr-inline-session.https.html b/testing/web-platform/tests/speculation-rules/prerender/resources/web-xr-inline-session.https.html new file mode 100644 index 0000000000..cde1f15a2a --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/web-xr-inline-session.https.html @@ -0,0 +1,24 @@ + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/window-move.html b/testing/web-platform/tests/speculation-rules/prerender/resources/window-move.html new file mode 100644 index 0000000000..0c5888c957 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/window-move.html @@ -0,0 +1,62 @@ + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/window-open-during-prerendering.html b/testing/web-platform/tests/speculation-rules/prerender/resources/window-open-during-prerendering.html new file mode 100644 index 0000000000..a314d5005b --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/window-open-during-prerendering.html @@ -0,0 +1,41 @@ + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/window-open-in-prerenderingchange.html b/testing/web-platform/tests/speculation-rules/prerender/resources/window-open-in-prerenderingchange.html new file mode 100644 index 0000000000..f32126f93d --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/window-open-in-prerenderingchange.html @@ -0,0 +1,65 @@ + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/window-resize.html b/testing/web-platform/tests/speculation-rules/prerender/resources/window-resize.html new file mode 100644 index 0000000000..8b6172ee16 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/window-resize.html @@ -0,0 +1,64 @@ + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/windowclient-navigate-on-iframe.html b/testing/web-platform/tests/speculation-rules/prerender/resources/windowclient-navigate-on-iframe.html new file mode 100644 index 0000000000..cc49e202c3 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/windowclient-navigate-on-iframe.html @@ -0,0 +1,97 @@ + +WindowClient.navigate() on a prerendered iframe + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/windowclient-navigate-worker.js b/testing/web-platform/tests/speculation-rules/prerender/resources/windowclient-navigate-worker.js new file mode 100644 index 0000000000..8a17b13bbb --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/windowclient-navigate-worker.js @@ -0,0 +1,38 @@ +importScripts("/speculation-rules/prerender/resources/utils.js"); + +const params = new URLSearchParams(location.search); +const uid = params.get('uid'); + +const bc = new PrerenderChannel('navigation-channel', uid); + +bc.onmessage = async e => { + const data = JSON.parse(e.data); + const navigationUrl = data.navigationUrl; + const clientUrl = data.clientUrl; + const respondTo = data.respondTo; + + const clients = await self.clients.matchAll(); + const client = clients.find(c => c.url == clientUrl); + if (!client) { + const bc = new PrerenderChannel(respondTo, uid); + bc.postMessage('Client was not found'); + bc.close(); + return; + } + + let result; + try { + await client.navigate(navigationUrl); + result = 'navigate() succeeded'; + } catch (e) { + if (e instanceof TypeError) { + result = 'navigate() failed with TypeError'; + } else { + result = 'navigate() failed with unknown error'; + } + } finally { + const bc = new PrerenderChannel(respondTo, uid); + bc.postMessage(result); + bc.close(); + } +}; diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/worker-post-timeOrigin.js b/testing/web-platform/tests/speculation-rules/prerender/resources/worker-post-timeOrigin.js new file mode 100644 index 0000000000..86c7d3136d --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/worker-post-timeOrigin.js @@ -0,0 +1 @@ +postMessage(performance.timeOrigin); diff --git a/testing/web-platform/tests/speculation-rules/prerender/resources/workers-in-cross-origin-iframe.html b/testing/web-platform/tests/speculation-rules/prerender/resources/workers-in-cross-origin-iframe.html new file mode 100644 index 0000000000..8f27533ed1 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/resources/workers-in-cross-origin-iframe.html @@ -0,0 +1,15 @@ + +Construction of Web Workers is deferred + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/response-code-non-successful.html b/testing/web-platform/tests/speculation-rules/prerender/response-code-non-successful.html new file mode 100644 index 0000000000..05d997a008 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/response-code-non-successful.html @@ -0,0 +1,29 @@ + +Check that non-successful responses result in discarding the prerender + + + + + + + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/response-code-successful.html b/testing/web-platform/tests/speculation-rules/prerender/response-code-successful.html new file mode 100644 index 0000000000..0e8433b3b2 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/response-code-successful.html @@ -0,0 +1,28 @@ + +Check that successful responses result in activating the prerender + + + + + + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/restriction-audio-setSinkId-with-invalid-sinkId.https.tentative.html b/testing/web-platform/tests/speculation-rules/prerender/restriction-audio-setSinkId-with-invalid-sinkId.https.tentative.html new file mode 100644 index 0000000000..f4a362894c --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/restriction-audio-setSinkId-with-invalid-sinkId.https.tentative.html @@ -0,0 +1,62 @@ + + +Access to the setSinkId of the Audio API with an invalid value is deferred + + + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/restriction-audio-setSinkId.https.tentative.html b/testing/web-platform/tests/speculation-rules/prerender/restriction-audio-setSinkId.https.tentative.html new file mode 100644 index 0000000000..a3b6db5041 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/restriction-audio-setSinkId.https.tentative.html @@ -0,0 +1,60 @@ + +Access to the setSinkId of the Audio API is deferred + + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/restriction-background-fetch.https.html b/testing/web-platform/tests/speculation-rules/prerender/restriction-background-fetch.https.html new file mode 100644 index 0000000000..466e886dcb --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/restriction-background-fetch.https.html @@ -0,0 +1,67 @@ + +Access to the Background Fetch API is deferred + + + + + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/restriction-background-sync.tentative.https.html b/testing/web-platform/tests/speculation-rules/prerender/restriction-background-sync.tentative.https.html new file mode 100644 index 0000000000..53dbb56d99 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/restriction-background-sync.tentative.https.html @@ -0,0 +1,67 @@ + +Access to the Background Sync API is deferred + + + + + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/restriction-battery-status.https.html b/testing/web-platform/tests/speculation-rules/prerender/restriction-battery-status.https.html new file mode 100644 index 0000000000..995b3d85d9 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/restriction-battery-status.https.html @@ -0,0 +1,48 @@ + +Access to the Battery Status API is deferred + + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/restriction-bluetooth.tentative.https.html b/testing/web-platform/tests/speculation-rules/prerender/restriction-bluetooth.tentative.https.html new file mode 100644 index 0000000000..b642e87ef5 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/restriction-bluetooth.tentative.https.html @@ -0,0 +1,58 @@ + +Access to the Bluetooth API is deferred + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/restriction-broadcast-channel.html b/testing/web-platform/tests/speculation-rules/prerender/restriction-broadcast-channel.html new file mode 100644 index 0000000000..167f5f9bc4 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/restriction-broadcast-channel.html @@ -0,0 +1,60 @@ + +BroadcastChannel#postMessage is deferred + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/restriction-dedicated-worker.https.html b/testing/web-platform/tests/speculation-rules/prerender/restriction-dedicated-worker.https.html new file mode 100644 index 0000000000..05cfc39379 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/restriction-dedicated-worker.https.html @@ -0,0 +1,55 @@ + +Access to the Dedicated Worker API is deferred + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/restriction-encrypted-media-unsupported-config.https.html b/testing/web-platform/tests/speculation-rules/prerender/restriction-encrypted-media-unsupported-config.https.html new file mode 100644 index 0000000000..312f979d08 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/restriction-encrypted-media-unsupported-config.https.html @@ -0,0 +1,57 @@ + +Access to the Encrypted Media API is deferred with unsupported config + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/restriction-encrypted-media.https.html b/testing/web-platform/tests/speculation-rules/prerender/restriction-encrypted-media.https.html new file mode 100644 index 0000000000..33836372c8 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/restriction-encrypted-media.https.html @@ -0,0 +1,55 @@ + +Access to the Encrypted Media API is deferred + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/restriction-focus.html b/testing/web-platform/tests/speculation-rules/prerender/restriction-focus.html new file mode 100644 index 0000000000..b606d1f8bf --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/restriction-focus.html @@ -0,0 +1,39 @@ + +Prerendering documents are not focused + + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/restriction-idle-detection.https.html b/testing/web-platform/tests/speculation-rules/prerender/restriction-idle-detection.https.html new file mode 100644 index 0000000000..953d3dded4 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/restriction-idle-detection.https.html @@ -0,0 +1,34 @@ + +Prerendering cannot invoke the Idle Detection API + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/restriction-local-file-system-access.https.html b/testing/web-platform/tests/speculation-rules/prerender/restriction-local-file-system-access.https.html new file mode 100644 index 0000000000..8aecf98b24 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/restriction-local-file-system-access.https.html @@ -0,0 +1,32 @@ + +Same-origin prerendering cannot access local file system + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/restriction-media-auto-play-attribute.html b/testing/web-platform/tests/speculation-rules/prerender/restriction-media-auto-play-attribute.html new file mode 100644 index 0000000000..10db174db9 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/restriction-media-auto-play-attribute.html @@ -0,0 +1,71 @@ + + +Access to the Autoplay of the Media is deferred + + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/restriction-media-camera.https.html b/testing/web-platform/tests/speculation-rules/prerender/restriction-media-camera.https.html new file mode 100644 index 0000000000..5435c737cc --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/restriction-media-camera.https.html @@ -0,0 +1,59 @@ + +Access to the Camera of the user media device is deferred + + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/restriction-media-device-info.https.html b/testing/web-platform/tests/speculation-rules/prerender/restriction-media-device-info.https.html new file mode 100644 index 0000000000..f725145aa1 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/restriction-media-device-info.https.html @@ -0,0 +1,57 @@ + +Access to the Media Device Info is deferred + + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/restriction-media-microphone.https.html b/testing/web-platform/tests/speculation-rules/prerender/restriction-media-microphone.https.html new file mode 100644 index 0000000000..36607ed95e --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/restriction-media-microphone.https.html @@ -0,0 +1,59 @@ + +Access to the Microphone of the user media device is deferred + + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/restriction-media-play.html b/testing/web-platform/tests/speculation-rules/prerender/restriction-media-play.html new file mode 100644 index 0000000000..3db8c22c41 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/restriction-media-play.html @@ -0,0 +1,73 @@ + + +Access to the Play of the Media is deferred + + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/restriction-message-boxes.html b/testing/web-platform/tests/speculation-rules/prerender/restriction-message-boxes.html new file mode 100644 index 0000000000..a40df1acc2 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/restriction-message-boxes.html @@ -0,0 +1,52 @@ + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/restriction-midi-sysex.https.html b/testing/web-platform/tests/speculation-rules/prerender/restriction-midi-sysex.https.html new file mode 100644 index 0000000000..3201267901 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/restriction-midi-sysex.https.html @@ -0,0 +1,64 @@ + +Access to the Midi API with sysex=true is deferred + + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/restriction-midi.https.html b/testing/web-platform/tests/speculation-rules/prerender/restriction-midi.https.html new file mode 100644 index 0000000000..49c3082d61 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/restriction-midi.https.html @@ -0,0 +1,64 @@ + +Access to the Midi API with sysex=false is deferred + + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/restriction-notification.https.html b/testing/web-platform/tests/speculation-rules/prerender/restriction-notification.https.html new file mode 100644 index 0000000000..78d7d06ecb --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/restriction-notification.https.html @@ -0,0 +1,105 @@ + + +Access to the Notification API before and after prerender activation + + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/restriction-presentation-request.https.html b/testing/web-platform/tests/speculation-rules/prerender/restriction-presentation-request.https.html new file mode 100644 index 0000000000..0dc961c0c8 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/restriction-presentation-request.https.html @@ -0,0 +1,32 @@ + +Same-origin prerendering cannot start presentation + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/restriction-prompt-by-before-unload.html b/testing/web-platform/tests/speculation-rules/prerender/restriction-prompt-by-before-unload.html new file mode 100644 index 0000000000..63a4b11fc3 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/restriction-prompt-by-before-unload.html @@ -0,0 +1,36 @@ + +Prerendering cannot invoke the prompt generated by the + beforeunload event + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/restriction-push.https.html b/testing/web-platform/tests/speculation-rules/prerender/restriction-push.https.html new file mode 100644 index 0000000000..708a0fed2f --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/restriction-push.https.html @@ -0,0 +1,66 @@ + +Access to the Push API is deferred + + + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/restriction-request-picture-in-picture.html b/testing/web-platform/tests/speculation-rules/prerender/restriction-request-picture-in-picture.html new file mode 100644 index 0000000000..743254d3d9 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/restriction-request-picture-in-picture.html @@ -0,0 +1,37 @@ + +Prerendering cannot invoke + HTMLVideoElement.requestPictureInPicture + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/restriction-screen-capture.https.html b/testing/web-platform/tests/speculation-rules/prerender/restriction-screen-capture.https.html new file mode 100644 index 0000000000..f1ad821a00 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/restriction-screen-capture.https.html @@ -0,0 +1,38 @@ + +Prerendering cannot invoke the Screen Capture API + + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/restriction-screen-orientation-lock.https.html b/testing/web-platform/tests/speculation-rules/prerender/restriction-screen-orientation-lock.https.html new file mode 100644 index 0000000000..f62740f5ce --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/restriction-screen-orientation-lock.https.html @@ -0,0 +1,47 @@ + +Access to the Screen Orientation Lock API is deferred + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/restriction-sensor-accelerometer.https.html b/testing/web-platform/tests/speculation-rules/prerender/restriction-sensor-accelerometer.https.html new file mode 100644 index 0000000000..72e3e86bce --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/restriction-sensor-accelerometer.https.html @@ -0,0 +1,65 @@ + +Access to the Accelerometer API is deferred + + + + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/restriction-sensor-ambient-light-sensor.https.html b/testing/web-platform/tests/speculation-rules/prerender/restriction-sensor-ambient-light-sensor.https.html new file mode 100644 index 0000000000..b398c4bd6c --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/restriction-sensor-ambient-light-sensor.https.html @@ -0,0 +1,65 @@ + +Access to the Ambient Light Sensor API is deferred + + + + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/restriction-sensor-gyroscope.https.html b/testing/web-platform/tests/speculation-rules/prerender/restriction-sensor-gyroscope.https.html new file mode 100644 index 0000000000..48e018e018 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/restriction-sensor-gyroscope.https.html @@ -0,0 +1,65 @@ + +Access to the Gyroscope API is deferred + + + + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/restriction-sensor-magnetometer.https.html b/testing/web-platform/tests/speculation-rules/prerender/restriction-sensor-magnetometer.https.html new file mode 100644 index 0000000000..928a73f572 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/restriction-sensor-magnetometer.https.html @@ -0,0 +1,65 @@ + +Access to the Magnetometer API is deferred + + + + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/restriction-service-worker-postmessage.https.html b/testing/web-platform/tests/speculation-rules/prerender/restriction-service-worker-postmessage.https.html new file mode 100644 index 0000000000..a837f6b0e7 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/restriction-service-worker-postmessage.https.html @@ -0,0 +1,58 @@ + +postMessage() between service worker and prerendered page + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/restriction-service-worker-unregister.https.html b/testing/web-platform/tests/speculation-rules/prerender/restriction-service-worker-unregister.https.html new file mode 100644 index 0000000000..2b83e3858f --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/restriction-service-worker-unregister.https.html @@ -0,0 +1,55 @@ + +ServiceWorkerRegistration.unregister in a prerendered page + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/restriction-service-worker-update.https.html b/testing/web-platform/tests/speculation-rules/prerender/restriction-service-worker-update.https.html new file mode 100644 index 0000000000..b2c164603d --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/restriction-service-worker-update.https.html @@ -0,0 +1,55 @@ + +ServiceWorkerRegistration.update in a prerendered page + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/restriction-speech-synthesis.html b/testing/web-platform/tests/speculation-rules/prerender/restriction-speech-synthesis.html new file mode 100644 index 0000000000..9dbdf9fd45 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/restriction-speech-synthesis.html @@ -0,0 +1,61 @@ + +Access to the speech synthesis is deferred + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/restriction-storage-persist.https.html b/testing/web-platform/tests/speculation-rules/prerender/restriction-storage-persist.https.html new file mode 100644 index 0000000000..5ccbff391b --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/restriction-storage-persist.https.html @@ -0,0 +1,54 @@ + +Access to storage.persist() is deferred + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/restriction-wake-lock.https.html b/testing/web-platform/tests/speculation-rules/prerender/restriction-wake-lock.https.html new file mode 100644 index 0000000000..5db64be5dc --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/restriction-wake-lock.https.html @@ -0,0 +1,71 @@ + +Access to the Wake Lock API is deferred + + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/restriction-web-hid.https.html b/testing/web-platform/tests/speculation-rules/prerender/restriction-web-hid.https.html new file mode 100644 index 0000000000..32aabde45e --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/restriction-web-hid.https.html @@ -0,0 +1,46 @@ + +Access to the Web HID API is deferred + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/restriction-web-locks.https.html b/testing/web-platform/tests/speculation-rules/prerender/restriction-web-locks.https.html new file mode 100644 index 0000000000..a3976cad6f --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/restriction-web-locks.https.html @@ -0,0 +1,50 @@ + +Access to the Web Locks API is deferred + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/restriction-web-nfc.https.html b/testing/web-platform/tests/speculation-rules/prerender/restriction-web-nfc.https.html new file mode 100644 index 0000000000..605c908892 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/restriction-web-nfc.https.html @@ -0,0 +1,48 @@ + +Access to the Web NFC API is deferred + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/restriction-web-serial.tentative.https.html b/testing/web-platform/tests/speculation-rules/prerender/restriction-web-serial.tentative.https.html new file mode 100644 index 0000000000..96b7fe6da1 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/restriction-web-serial.tentative.https.html @@ -0,0 +1,49 @@ + +Access to the Web Serial API is deferred + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/restriction-web-share.https.html b/testing/web-platform/tests/speculation-rules/prerender/restriction-web-share.https.html new file mode 100644 index 0000000000..e9b22d58ef --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/restriction-web-share.https.html @@ -0,0 +1,34 @@ + +Prerendering cannot invoke the Web Share API + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/restriction-web-usb.https.html b/testing/web-platform/tests/speculation-rules/prerender/restriction-web-usb.https.html new file mode 100644 index 0000000000..8fd5c4fa76 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/restriction-web-usb.https.html @@ -0,0 +1,46 @@ + +Access to the Web USB API is deferred + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/restriction-web-xr-immersive-vr-session.https.html b/testing/web-platform/tests/speculation-rules/prerender/restriction-web-xr-immersive-vr-session.https.html new file mode 100644 index 0000000000..094bdbd1a0 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/restriction-web-xr-immersive-vr-session.https.html @@ -0,0 +1,58 @@ + +Access to the WebXR immersive-vr session API is deferred + + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/restriction-web-xr-inline-session.https.html b/testing/web-platform/tests/speculation-rules/prerender/restriction-web-xr-inline-session.https.html new file mode 100644 index 0000000000..398f2cb504 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/restriction-web-xr-inline-session.https.html @@ -0,0 +1,58 @@ + +Access to the WebXR inline session API is deferred + + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/restriction-window-move.html b/testing/web-platform/tests/speculation-rules/prerender/restriction-window-move.html new file mode 100644 index 0000000000..232760db36 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/restriction-window-move.html @@ -0,0 +1,48 @@ + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/restriction-window-open.html b/testing/web-platform/tests/speculation-rules/prerender/restriction-window-open.html new file mode 100644 index 0000000000..7397d31e65 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/restriction-window-open.html @@ -0,0 +1,40 @@ + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/restriction-window-resize.html b/testing/web-platform/tests/speculation-rules/prerender/restriction-window-resize.html new file mode 100644 index 0000000000..a2466c48b3 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/restriction-window-resize.html @@ -0,0 +1,49 @@ + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/restrictions.html b/testing/web-platform/tests/speculation-rules/prerender/restrictions.html new file mode 100644 index 0000000000..817a1995bc --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/restrictions.html @@ -0,0 +1,33 @@ + +Same-origin prerendering cannot access some APIs + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/sandbox-iframe.html b/testing/web-platform/tests/speculation-rules/prerender/sandbox-iframe.html new file mode 100644 index 0000000000..469b8aadc3 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/sandbox-iframe.html @@ -0,0 +1,56 @@ + + +Load a prerendered iframe with sandbox attributes + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/script-supports-speculationrules.html b/testing/web-platform/tests/speculation-rules/prerender/script-supports-speculationrules.html new file mode 100644 index 0000000000..2dc856fce5 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/script-supports-speculationrules.html @@ -0,0 +1,21 @@ + + +HTMLScriptElement.supports speculationrules + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/service-workers.https.html b/testing/web-platform/tests/speculation-rules/prerender/service-workers.https.html new file mode 100644 index 0000000000..0f907c35aa --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/service-workers.https.html @@ -0,0 +1,116 @@ + +Service Workers APIs with prerendering + + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/session-history-activation.https.html b/testing/web-platform/tests/speculation-rules/prerender/session-history-activation.https.html new file mode 100644 index 0000000000..a1ee4a3190 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/session-history-activation.https.html @@ -0,0 +1,29 @@ + +Test history.length + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/session-history-location.https.html b/testing/web-platform/tests/speculation-rules/prerender/session-history-location.https.html new file mode 100644 index 0000000000..f32bec2bf9 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/session-history-location.https.html @@ -0,0 +1,37 @@ + +Test history.length + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/session-history-navigation.https.html b/testing/web-platform/tests/speculation-rules/prerender/session-history-navigation.https.html new file mode 100644 index 0000000000..46bd414819 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/session-history-navigation.https.html @@ -0,0 +1,25 @@ + +Test history.length + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/session-history-pushstate.https.html b/testing/web-platform/tests/speculation-rules/prerender/session-history-pushstate.https.html new file mode 100644 index 0000000000..89a0276984 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/session-history-pushstate.https.html @@ -0,0 +1,30 @@ + +Test history.length + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/session-history-subframe-navigation.https.html b/testing/web-platform/tests/speculation-rules/prerender/session-history-subframe-navigation.https.html new file mode 100644 index 0000000000..db3d9f8347 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/session-history-subframe-navigation.https.html @@ -0,0 +1,23 @@ + +Test history.length during a subframe navigation + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/session-history-subframe-reload.https.html b/testing/web-platform/tests/speculation-rules/prerender/session-history-subframe-reload.https.html new file mode 100644 index 0000000000..1caf360f1b --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/session-history-subframe-reload.https.html @@ -0,0 +1,23 @@ + +Test history.length and reloading a subframe + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/state-and-event.html b/testing/web-platform/tests/speculation-rules/prerender/state-and-event.html new file mode 100644 index 0000000000..7e8e7fd0a9 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/state-and-event.html @@ -0,0 +1,47 @@ + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/visibility-state.html b/testing/web-platform/tests/speculation-rules/prerender/visibility-state.html new file mode 100644 index 0000000000..e9e8548c4f --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/visibility-state.html @@ -0,0 +1,27 @@ + +visibilityState must be updated after prerendering + + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/windowclient-navigate-to-cross-origin-url-on-iframe.https.html b/testing/web-platform/tests/speculation-rules/prerender/windowclient-navigate-to-cross-origin-url-on-iframe.https.html new file mode 100644 index 0000000000..1bfc2e0eb0 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/windowclient-navigate-to-cross-origin-url-on-iframe.https.html @@ -0,0 +1,83 @@ + + +WindowClient.navigate() to cross-origin url in a prerendered iframe + + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/windowclient-navigate-to-same-origin-url-on-iframe.https.html b/testing/web-platform/tests/speculation-rules/prerender/windowclient-navigate-to-same-origin-url-on-iframe.https.html new file mode 100644 index 0000000000..5f53e97685 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/windowclient-navigate-to-same-origin-url-on-iframe.https.html @@ -0,0 +1,57 @@ + +WindowClient.navigate() to same-origin url in a prerendered iframe + + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/windowclient-navigate.https.html b/testing/web-platform/tests/speculation-rules/prerender/windowclient-navigate.https.html new file mode 100644 index 0000000000..608584636a --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/windowclient-navigate.https.html @@ -0,0 +1,72 @@ + +WindowClient.navigate() for prerendered main page + + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/workers-in-cross-origin-iframe.html b/testing/web-platform/tests/speculation-rules/prerender/workers-in-cross-origin-iframe.html new file mode 100644 index 0000000000..260bc8eacb --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/workers-in-cross-origin-iframe.html @@ -0,0 +1,49 @@ + +Construction of Web Workers in cross-origin iframe is deferred + + + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/prerender/workers.html b/testing/web-platform/tests/speculation-rules/prerender/workers.html new file mode 100644 index 0000000000..3abae233a5 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/prerender/workers.html @@ -0,0 +1,95 @@ + +Construction of Web Workers is deferred + + + + + + + + + + diff --git a/testing/web-platform/tests/speculation-rules/resources/utils.js b/testing/web-platform/tests/speculation-rules/resources/utils.js new file mode 100644 index 0000000000..cb72f44681 --- /dev/null +++ b/testing/web-platform/tests/speculation-rules/resources/utils.js @@ -0,0 +1,8 @@ +window.assertSpeculationRulesIsSupported = () => { + assert_implements( + 'supports' in HTMLScriptElement, + 'HTMLScriptElement.supports must be supported'); + assert_implements( + HTMLScriptElement.supports('speculationrules'), + '