From 0be8ae9aa0b7d169483053b33b9cf4124bdc29ec Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 12 Dec 2024 08:52:21 +0100 Subject: [PATCH] test: Update WPT (#3888) Co-authored-by: Uzlopak <5059100+Uzlopak@users.noreply.github.com> --- .../generated/audioworklet.https.sub.html | 26 +++ .../css-font-face.https.sub.tentative.html | 20 ++ .../css-font-face.sub.tentative.html | 30 +++ .../css-images.https.sub.tentative.html | 145 ++++++++++++ .../generated/css-images.sub.tentative.html | 210 ++++++++++++++++++ .../generated/element-a.https.sub.html | 40 ++++ .../metadata/generated/element-a.sub.html | 60 +++++ .../generated/element-area.https.sub.html | 40 ++++ .../metadata/generated/element-area.sub.html | 60 +++++ .../generated/element-audio.https.sub.html | 27 +++ .../metadata/generated/element-audio.sub.html | 39 ++++ .../generated/element-embed.https.sub.html | 21 ++ .../metadata/generated/element-embed.sub.html | 30 +++ .../generated/element-frame.https.sub.html | 29 +++ .../metadata/generated/element-frame.sub.html | 42 ++++ .../generated/element-iframe.https.sub.html | 29 +++ .../generated/element-iframe.sub.html | 42 ++++ ...ment-img-environment-change.https.sub.html | 29 +++ .../element-img-environment-change.sub.html | 42 ++++ .../generated/element-img.https.sub.html | 58 +++++ .../metadata/generated/element-img.sub.html | 84 +++++++ .../element-input-image.https.sub.html | 21 ++ .../generated/element-input-image.sub.html | 30 +++ .../element-link-icon.https.sub.html | 31 +++ .../generated/element-link-icon.sub.html | 45 ++++ ...ment-link-prefetch.https.optional.sub.html | 31 +++ .../element-link-prefetch.optional.sub.html | 45 ++++ ...ement-meta-refresh.https.optional.sub.html | 24 ++ .../element-meta-refresh.optional.sub.html | 36 +++ .../generated/element-picture.https.sub.html | 93 ++++++++ .../generated/element-picture.sub.html | 135 +++++++++++ .../generated/element-script.https.sub.html | 31 +++ .../generated/element-script.sub.html | 90 ++++++++ .../element-video-poster.https.sub.html | 21 ++ .../generated/element-video-poster.sub.html | 30 +++ .../generated/element-video.https.sub.html | 27 +++ .../metadata/generated/element-video.sub.html | 39 ++++ .../fetch-via-serviceworker.https.sub.html | 62 ++++++ .../metadata/generated/fetch.https.sub.html | 27 +++ .../fetch/metadata/generated/fetch.sub.html | 39 ++++ .../generated/form-submission.https.sub.html | 44 ++++ .../generated/form-submission.sub.html | 66 ++++++ .../generated/header-link.https.sub.html | 58 +++++ .../metadata/generated/header-link.sub.html | 84 +++++++ .../header-refresh.https.optional.sub.html | 24 ++ .../header-refresh.optional.sub.html | 36 +++ ...cript-module-import-dynamic.https.sub.html | 26 +++ .../script-module-import-dynamic.sub.html | 39 ++++ ...script-module-import-static.https.sub.html | 28 +++ .../script-module-import-static.sub.html | 42 ++++ .../generated/svg-image.https.sub.html | 29 +++ .../metadata/generated/svg-image.sub.html | 42 ++++ .../generated/window-history.https.sub.html | 44 ++++ .../generated/window-history.sub.html | 66 ++++++ .../generated/window-location.https.sub.html | 112 ++++++++++ .../generated/window-location.sub.html | 168 ++++++++++++++ .../worker-dedicated-constructor.sub.html | 15 ++ ...ker-dedicated-importscripts.https.sub.html | 27 +++ .../worker-dedicated-importscripts.sub.html | 39 ++++ .../metadata/tools/fetch-metadata.conf.yml | 81 +++++++ .../wpt/interfaces/compute-pressure.idl | 2 +- test/fixtures/wpt/interfaces/fedcm.idl | 4 +- test/fixtures/wpt/interfaces/gpc.idl | 10 + test/fixtures/wpt/interfaces/html.idl | 17 +- .../wpt/interfaces/long-animation-frames.idl | 2 + .../mediacapture-surface-control.idl | 16 ++ .../fixtures/wpt/interfaces/sanitizer-api.idl | 17 +- test/fixtures/wpt/interfaces/vibration.idl | 2 +- test/fixtures/wpt/interfaces/webnn.idl | 35 ++- .../wpt/resources/idlharness-shadowrealm.js | 52 ----- test/fixtures/wpt/resources/idlharness.js | 19 +- .../IdlNamespace/test_operation.html | 13 +- .../testharness-shadowrealm-inner.js | 11 + .../testharness-shadowrealm-outer.js | 52 +++-- test/fixtures/wpt/resources/testharness.js | 2 +- 75 files changed, 3192 insertions(+), 92 deletions(-) create mode 100644 test/fixtures/wpt/interfaces/gpc.idl create mode 100644 test/fixtures/wpt/interfaces/mediacapture-surface-control.idl delete mode 100644 test/fixtures/wpt/resources/idlharness-shadowrealm.js diff --git a/test/fixtures/wpt/fetch/metadata/generated/audioworklet.https.sub.html b/test/fixtures/wpt/fetch/metadata/generated/audioworklet.https.sub.html index 64fb7607e26..5ea1cdc8bc9 100644 --- a/test/fixtures/wpt/fetch/metadata/generated/audioworklet.https.sub.html +++ b/test/fixtures/wpt/fetch/metadata/generated/audioworklet.https.sub.html @@ -266,6 +266,32 @@ assert_not_own_property(headers, 'sec-fetch-user'); }); }, 'sec-fetch-user'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, ['httpsCrossSite'], {mime: 'text/javascript'}), + t + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Cross-site'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, ['httpsSameSite'], {mime: 'text/javascript'}), + t + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Same site'); diff --git a/test/fixtures/wpt/fetch/metadata/generated/css-font-face.https.sub.tentative.html b/test/fixtures/wpt/fetch/metadata/generated/css-font-face.https.sub.tentative.html index 332effeb1f8..481355c0a6c 100644 --- a/test/fixtures/wpt/fetch/metadata/generated/css-font-face.https.sub.tentative.html +++ b/test/fixtures/wpt/fetch/metadata/generated/css-font-face.https.sub.tentative.html @@ -225,6 +225,26 @@ assert_not_own_property(headers, 'sec-fetch-user'); }); }, 'sec-fetch-user'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + return induceRequest(t, makeRequestURL(key, ['httpsCrossSite'])) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Cross-site'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + return induceRequest(t, makeRequestURL(key, ['httpsSameSite'])) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Same site'); diff --git a/test/fixtures/wpt/fetch/metadata/generated/css-font-face.sub.tentative.html b/test/fixtures/wpt/fetch/metadata/generated/css-font-face.sub.tentative.html index 8a0b90cee10..a0d2a06fed3 100644 --- a/test/fixtures/wpt/fetch/metadata/generated/css-font-face.sub.tentative.html +++ b/test/fixtures/wpt/fetch/metadata/generated/css-font-face.sub.tentative.html @@ -160,6 +160,36 @@ }); }, 'sec-fetch-user - Not sent to non-trustworthy cross-site destination'); + promise_test((t) => { + const key = '{{uuid()}}'; + + return induceRequest(t, makeRequestURL(key, ['httpOrigin'])) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy same-origin destination'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + return induceRequest(t, makeRequestURL(key, ['httpSameSite'])) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy same-site destination'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + return induceRequest(t, makeRequestURL(key, ['httpCrossSite'])) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy cross-site destination'); + promise_test((t) => { const key = '{{uuid()}}'; diff --git a/test/fixtures/wpt/fetch/metadata/generated/css-images.https.sub.tentative.html b/test/fixtures/wpt/fetch/metadata/generated/css-images.https.sub.tentative.html index 3fa24019289..63dcb4bf027 100644 --- a/test/fixtures/wpt/fetch/metadata/generated/css-images.https.sub.tentative.html +++ b/test/fixtures/wpt/fetch/metadata/generated/css-images.https.sub.tentative.html @@ -1374,6 +1374,151 @@ .then(t.step_func_done(), t.unreached_func()); }, 'list-style-image sec-fetch-user'); + async_test((t) => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['httpsCrossSite']); + + declarations.push(`background-image: url("${url}");`); + + whenIframeReady + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-storage-access'); + assert_equals(headers['sec-fetch-storage-access'], 'none'); + }) + .then(t.step_func_done(), (error) => t.unreached_func()); + }, 'background-image sec-fetch-storage-access - Cross-site'); + + async_test((t) => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['httpsCrossSite']); + + declarations.push(`border-image: url("${url}");`); + + whenIframeReady + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-storage-access'); + assert_array_equals(headers['sec-fetch-storage-access'], ['none']); + }) + .then(t.step_func_done(), t.unreached_func()); + }, 'border-image sec-fetch-storage-access - Cross-site'); + + async_test((t) => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['httpsCrossSite']); + + declarations.push(`content: url("${url}");`); + + whenIframeReady + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-storage-access'); + assert_array_equals(headers['sec-fetch-storage-access'], ['none']); + }) + .then(t.step_func_done(), t.unreached_func()); + }, 'content sec-fetch-storage-access - Cross-site'); + + async_test((t) => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['httpsCrossSite']); + + declarations.push(`cursor: url("${url}"), auto;`); + + whenIframeReady + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-storage-access'); + assert_array_equals(headers['sec-fetch-storage-access'], ['none']); + }) + .then(t.step_func_done(), t.unreached_func()); + }, 'cursor sec-fetch-storage-access - Cross-site'); + + async_test((t) => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['httpsCrossSite']); + + declarations.push(`list-style-image: url("${url}");`); + + whenIframeReady + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-storage-access'); + assert_array_equals(headers['sec-fetch-storage-access'], ['none']); + }) + .then(t.step_func_done(), t.unreached_func()); + }, 'list-style-image sec-fetch-storage-access - Cross-site'); + + async_test((t) => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['httpsSameSite']); + + declarations.push(`background-image: url("${url}");`); + + whenIframeReady + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }) + .then(t.step_func_done(), (error) => t.unreached_func()); + }, 'background-image sec-fetch-storage-access - Same site'); + + async_test((t) => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['httpsSameSite']); + + declarations.push(`border-image: url("${url}");`); + + whenIframeReady + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }) + .then(t.step_func_done(), t.unreached_func()); + }, 'border-image sec-fetch-storage-access - Same site'); + + async_test((t) => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['httpsSameSite']); + + declarations.push(`content: url("${url}");`); + + whenIframeReady + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }) + .then(t.step_func_done(), t.unreached_func()); + }, 'content sec-fetch-storage-access - Same site'); + + async_test((t) => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['httpsSameSite']); + + declarations.push(`cursor: url("${url}"), auto;`); + + whenIframeReady + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }) + .then(t.step_func_done(), t.unreached_func()); + }, 'cursor sec-fetch-storage-access - Same site'); + + async_test((t) => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['httpsSameSite']); + + declarations.push(`list-style-image: url("${url}");`); + + whenIframeReady + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }) + .then(t.step_func_done(), t.unreached_func()); + }, 'list-style-image sec-fetch-storage-access - Same site'); + iframe.srcdoc = declarations.map((declaration, index) => `
` ).join(''); diff --git a/test/fixtures/wpt/fetch/metadata/generated/css-images.sub.tentative.html b/test/fixtures/wpt/fetch/metadata/generated/css-images.sub.tentative.html index f1ef27cf087..2f6f2f75f1b 100644 --- a/test/fixtures/wpt/fetch/metadata/generated/css-images.sub.tentative.html +++ b/test/fixtures/wpt/fetch/metadata/generated/css-images.sub.tentative.html @@ -869,6 +869,216 @@ .then(t.step_func_done(), t.unreached_func()); }, 'list-style-image sec-fetch-user - Not sent to non-trustworthy cross-site destination'); + async_test((t) => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['httpOrigin']); + + declarations.push(`background-image: url("${url}");`); + + whenIframeReady + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }) + .then(t.step_func_done(), (error) => t.unreached_func()); + }, 'background-image sec-fetch-storage-access - Not sent to non-trustworthy same-origin destination'); + + async_test((t) => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['httpOrigin']); + + declarations.push(`border-image: url("${url}");`); + + whenIframeReady + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }) + .then(t.step_func_done(), t.unreached_func()); + }, 'border-image sec-fetch-storage-access - Not sent to non-trustworthy same-origin destination'); + + async_test((t) => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['httpOrigin']); + + declarations.push(`content: url("${url}");`); + + whenIframeReady + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }) + .then(t.step_func_done(), t.unreached_func()); + }, 'content sec-fetch-storage-access - Not sent to non-trustworthy same-origin destination'); + + async_test((t) => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['httpOrigin']); + + declarations.push(`cursor: url("${url}"), auto;`); + + whenIframeReady + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }) + .then(t.step_func_done(), t.unreached_func()); + }, 'cursor sec-fetch-storage-access - Not sent to non-trustworthy same-origin destination'); + + async_test((t) => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['httpOrigin']); + + declarations.push(`list-style-image: url("${url}");`); + + whenIframeReady + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }) + .then(t.step_func_done(), t.unreached_func()); + }, 'list-style-image sec-fetch-storage-access - Not sent to non-trustworthy same-origin destination'); + + async_test((t) => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['httpSameSite']); + + declarations.push(`background-image: url("${url}");`); + + whenIframeReady + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }) + .then(t.step_func_done(), (error) => t.unreached_func()); + }, 'background-image sec-fetch-storage-access - Not sent to non-trustworthy same-site destination'); + + async_test((t) => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['httpSameSite']); + + declarations.push(`border-image: url("${url}");`); + + whenIframeReady + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }) + .then(t.step_func_done(), t.unreached_func()); + }, 'border-image sec-fetch-storage-access - Not sent to non-trustworthy same-site destination'); + + async_test((t) => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['httpSameSite']); + + declarations.push(`content: url("${url}");`); + + whenIframeReady + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }) + .then(t.step_func_done(), t.unreached_func()); + }, 'content sec-fetch-storage-access - Not sent to non-trustworthy same-site destination'); + + async_test((t) => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['httpSameSite']); + + declarations.push(`cursor: url("${url}"), auto;`); + + whenIframeReady + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }) + .then(t.step_func_done(), t.unreached_func()); + }, 'cursor sec-fetch-storage-access - Not sent to non-trustworthy same-site destination'); + + async_test((t) => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['httpSameSite']); + + declarations.push(`list-style-image: url("${url}");`); + + whenIframeReady + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }) + .then(t.step_func_done(), t.unreached_func()); + }, 'list-style-image sec-fetch-storage-access - Not sent to non-trustworthy same-site destination'); + + async_test((t) => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['httpCrossSite']); + + declarations.push(`background-image: url("${url}");`); + + whenIframeReady + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }) + .then(t.step_func_done(), (error) => t.unreached_func()); + }, 'background-image sec-fetch-storage-access - Not sent to non-trustworthy cross-site destination'); + + async_test((t) => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['httpCrossSite']); + + declarations.push(`border-image: url("${url}");`); + + whenIframeReady + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }) + .then(t.step_func_done(), t.unreached_func()); + }, 'border-image sec-fetch-storage-access - Not sent to non-trustworthy cross-site destination'); + + async_test((t) => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['httpCrossSite']); + + declarations.push(`content: url("${url}");`); + + whenIframeReady + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }) + .then(t.step_func_done(), t.unreached_func()); + }, 'content sec-fetch-storage-access - Not sent to non-trustworthy cross-site destination'); + + async_test((t) => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['httpCrossSite']); + + declarations.push(`cursor: url("${url}"), auto;`); + + whenIframeReady + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }) + .then(t.step_func_done(), t.unreached_func()); + }, 'cursor sec-fetch-storage-access - Not sent to non-trustworthy cross-site destination'); + + async_test((t) => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['httpCrossSite']); + + declarations.push(`list-style-image: url("${url}");`); + + whenIframeReady + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }) + .then(t.step_func_done(), t.unreached_func()); + }, 'list-style-image sec-fetch-storage-access - Not sent to non-trustworthy cross-site destination'); + async_test((t) => { const key = '{{uuid()}}'; const url = makeRequestURL(key, ['httpsOrigin', 'httpOrigin']); diff --git a/test/fixtures/wpt/fetch/metadata/generated/element-a.https.sub.html b/test/fixtures/wpt/fetch/metadata/generated/element-a.https.sub.html index dffd36c73ee..6bc50692761 100644 --- a/test/fixtures/wpt/fetch/metadata/generated/element-a.https.sub.html +++ b/test/fixtures/wpt/fetch/metadata/generated/element-a.https.sub.html @@ -477,6 +477,46 @@ assert_array_equals(headers['sec-fetch-user'], ['?1']); }); }, 'sec-fetch-user - no attributes with user activation'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + induceRequest( + makeRequestURL(key, ['httpsCrossSite'], {mime: 'text/html'}), + { + test: t, + userActivated: false, + attributes: {} + } + ); + + // `induceRequest` does not necessarily trigger a navigation, so the Python + // handler must be polled until it has received the initial request. + return retrieve(key, {poll: true}) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Cross-site - no attributes'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + induceRequest( + makeRequestURL(key, ['httpsSameSite'], {mime: 'text/html'}), + { + test: t, + userActivated: false, + attributes: {} + } + ); + + // `induceRequest` does not necessarily trigger a navigation, so the Python + // handler must be polled until it has received the initial request. + return retrieve(key, {poll: true}) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Same site - no attributes'); diff --git a/test/fixtures/wpt/fetch/metadata/generated/element-a.sub.html b/test/fixtures/wpt/fetch/metadata/generated/element-a.sub.html index 0661de3c871..389d3393b64 100644 --- a/test/fixtures/wpt/fetch/metadata/generated/element-a.sub.html +++ b/test/fixtures/wpt/fetch/metadata/generated/element-a.sub.html @@ -276,6 +276,66 @@ }); }, 'sec-fetch-user - Not sent to non-trustworthy cross-site destination - no attributes'); + promise_test((t) => { + const key = '{{uuid()}}'; + + induceRequest( + makeRequestURL(key, ['httpOrigin'], {mime: 'text/html'}), + { + test: t, + userActivated: false, + attributes: {} + } + ); + + // `induceRequest` does not necessarily trigger a navigation, so the Python + // handler must be polled until it has received the initial request. + return retrieve(key, {poll: true}) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy same-origin destination - no attributes'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + induceRequest( + makeRequestURL(key, ['httpSameSite'], {mime: 'text/html'}), + { + test: t, + userActivated: false, + attributes: {} + } + ); + + // `induceRequest` does not necessarily trigger a navigation, so the Python + // handler must be polled until it has received the initial request. + return retrieve(key, {poll: true}) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy same-site destination - no attributes'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + induceRequest( + makeRequestURL(key, ['httpCrossSite'], {mime: 'text/html'}), + { + test: t, + userActivated: false, + attributes: {} + } + ); + + // `induceRequest` does not necessarily trigger a navigation, so the Python + // handler must be polled until it has received the initial request. + return retrieve(key, {poll: true}) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy cross-site destination - no attributes'); + promise_test((t) => { const key = '{{uuid()}}'; diff --git a/test/fixtures/wpt/fetch/metadata/generated/element-area.https.sub.html b/test/fixtures/wpt/fetch/metadata/generated/element-area.https.sub.html index be3f5f9b621..2355cceda09 100644 --- a/test/fixtures/wpt/fetch/metadata/generated/element-area.https.sub.html +++ b/test/fixtures/wpt/fetch/metadata/generated/element-area.https.sub.html @@ -477,6 +477,46 @@ assert_array_equals(headers['sec-fetch-user'], ['?1']); }); }, 'sec-fetch-user - no attributes with user activation'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + induceRequest( + makeRequestURL(key, ['httpsCrossSite'], {mime: 'text/html'}), + { + test: t, + userActivated: false, + attributes: {} + } + ); + + // `induceRequest` does not necessarily trigger a navigation, so the Python + // handler must be polled until it has received the initial request. + return retrieve(key, {poll: true}) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Cross-site - no attributes'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + induceRequest( + makeRequestURL(key, ['httpsSameSite'], {mime: 'text/html'}), + { + test: t, + userActivated: false, + attributes: {} + } + ); + + // `induceRequest` does not necessarily trigger a navigation, so the Python + // handler must be polled until it has received the initial request. + return retrieve(key, {poll: true}) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Same site - no attributes'); diff --git a/test/fixtures/wpt/fetch/metadata/generated/element-area.sub.html b/test/fixtures/wpt/fetch/metadata/generated/element-area.sub.html index 5f5c338324f..1932a66cc09 100644 --- a/test/fixtures/wpt/fetch/metadata/generated/element-area.sub.html +++ b/test/fixtures/wpt/fetch/metadata/generated/element-area.sub.html @@ -276,6 +276,66 @@ }); }, 'sec-fetch-user - Not sent to non-trustworthy cross-site destination - no attributes'); + promise_test((t) => { + const key = '{{uuid()}}'; + + induceRequest( + makeRequestURL(key, ['httpOrigin'], {mime: 'text/html'}), + { + test: t, + userActivated: false, + attributes: {} + } + ); + + // `induceRequest` does not necessarily trigger a navigation, so the Python + // handler must be polled until it has received the initial request. + return retrieve(key, {poll: true}) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy same-origin destination - no attributes'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + induceRequest( + makeRequestURL(key, ['httpSameSite'], {mime: 'text/html'}), + { + test: t, + userActivated: false, + attributes: {} + } + ); + + // `induceRequest` does not necessarily trigger a navigation, so the Python + // handler must be polled until it has received the initial request. + return retrieve(key, {poll: true}) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy same-site destination - no attributes'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + induceRequest( + makeRequestURL(key, ['httpCrossSite'], {mime: 'text/html'}), + { + test: t, + userActivated: false, + attributes: {} + } + ); + + // `induceRequest` does not necessarily trigger a navigation, so the Python + // handler must be polled until it has received the initial request. + return retrieve(key, {poll: true}) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy cross-site destination - no attributes'); + promise_test((t) => { const key = '{{uuid()}}'; diff --git a/test/fixtures/wpt/fetch/metadata/generated/element-audio.https.sub.html b/test/fixtures/wpt/fetch/metadata/generated/element-audio.https.sub.html index a9d951233e2..f0ce53cbd15 100644 --- a/test/fixtures/wpt/fetch/metadata/generated/element-audio.https.sub.html +++ b/test/fixtures/wpt/fetch/metadata/generated/element-audio.https.sub.html @@ -320,6 +320,33 @@ assert_not_own_property(headers, 'sec-fetch-user'); }); }, 'sec-fetch-user - no attributes'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, ['httpsCrossSite']), + {} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-storage-access'); + assert_array_equals(headers['sec-fetch-storage-access'], ['none']); + }); + }, 'sec-fetch-storage-access - Cross-site, no attributes'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, ['httpsSameSite']), + {} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Same site, no attributes'); diff --git a/test/fixtures/wpt/fetch/metadata/generated/element-audio.sub.html b/test/fixtures/wpt/fetch/metadata/generated/element-audio.sub.html index 2b62632ac2e..efe9164c6d2 100644 --- a/test/fixtures/wpt/fetch/metadata/generated/element-audio.sub.html +++ b/test/fixtures/wpt/fetch/metadata/generated/element-audio.sub.html @@ -184,6 +184,45 @@ }); }, 'sec-fetch-user - Not sent to non-trustworthy cross-site destination, no attributes'); + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, ['httpOrigin']), + {} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy same-origin destination, no attributes'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, ['httpSameSite']), + {} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy same-site destination, no attributes'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, ['httpCrossSite']), + {} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy cross-site destination, no attributes'); + promise_test(() => { const key = '{{uuid()}}'; diff --git a/test/fixtures/wpt/fetch/metadata/generated/element-embed.https.sub.html b/test/fixtures/wpt/fetch/metadata/generated/element-embed.https.sub.html index 819bed888ee..2aea58d0b4d 100644 --- a/test/fixtures/wpt/fetch/metadata/generated/element-embed.https.sub.html +++ b/test/fixtures/wpt/fetch/metadata/generated/element-embed.https.sub.html @@ -219,6 +219,27 @@ assert_not_own_property(headers, 'sec-fetch-user'); }); }, 'sec-fetch-user'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + return induceRequest(t, makeRequestURL(key, ['httpsCrossSite'], params)) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-storage-access'); + assert_array_equals(headers['sec-fetch-storage-access'], ['none']); + }); + }, 'sec-fetch-storage-access - Cross-site'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + return induceRequest(t, makeRequestURL(key, ['httpsSameSite'], params)) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Same site'); diff --git a/test/fixtures/wpt/fetch/metadata/generated/element-embed.sub.html b/test/fixtures/wpt/fetch/metadata/generated/element-embed.sub.html index b6e14a55e4a..e394d4d7f9a 100644 --- a/test/fixtures/wpt/fetch/metadata/generated/element-embed.sub.html +++ b/test/fixtures/wpt/fetch/metadata/generated/element-embed.sub.html @@ -154,6 +154,36 @@ }); }, 'sec-fetch-user - Not sent to non-trustworthy cross-site destination'); + promise_test((t) => { + const key = '{{uuid()}}'; + + return induceRequest(t, makeRequestURL(key, ['httpOrigin'], params)) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy same-origin destination'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + return induceRequest(t, makeRequestURL(key, ['httpSameSite'], params)) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy same-site destination'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + return induceRequest(t, makeRequestURL(key, ['httpCrossSite'], params)) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy cross-site destination'); + promise_test((t) => { const key = '{{uuid()}}'; diff --git a/test/fixtures/wpt/fetch/metadata/generated/element-frame.https.sub.html b/test/fixtures/wpt/fetch/metadata/generated/element-frame.https.sub.html index 17504ff5635..7df86fb7b4b 100644 --- a/test/fixtures/wpt/fetch/metadata/generated/element-frame.https.sub.html +++ b/test/fixtures/wpt/fetch/metadata/generated/element-frame.https.sub.html @@ -304,6 +304,35 @@ assert_array_equals(headers['sec-fetch-user'], ['?1']); }); }, 'sec-fetch-user with user activation'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, ['httpsCrossSite'], {mime: 'text/html'}), + t, + false + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-storage-access'); + assert_array_equals(headers['sec-fetch-storage-access'], ['none']); + }); + }, 'sec-fetch-storage-access - Cross-site'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, ['httpsSameSite'], {mime: 'text/html'}), + t, + false + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Same site'); diff --git a/test/fixtures/wpt/fetch/metadata/generated/element-frame.sub.html b/test/fixtures/wpt/fetch/metadata/generated/element-frame.sub.html index 2d9a7ec97d7..6a10ca2b34d 100644 --- a/test/fixtures/wpt/fetch/metadata/generated/element-frame.sub.html +++ b/test/fixtures/wpt/fetch/metadata/generated/element-frame.sub.html @@ -202,6 +202,48 @@ }); }, 'sec-fetch-user - Not sent to non-trustworthy cross-site destination'); + promise_test((t) => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, ['httpOrigin'], {mime: 'text/html'}), + t, + false + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy same-origin destination'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, ['httpSameSite'], {mime: 'text/html'}), + t, + false + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy same-site destination'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, ['httpCrossSite'], {mime: 'text/html'}), + t, + false + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy cross-site destination'); + promise_test((t) => { const key = '{{uuid()}}'; diff --git a/test/fixtures/wpt/fetch/metadata/generated/element-iframe.https.sub.html b/test/fixtures/wpt/fetch/metadata/generated/element-iframe.https.sub.html index fba1c8b9e02..10de0061480 100644 --- a/test/fixtures/wpt/fetch/metadata/generated/element-iframe.https.sub.html +++ b/test/fixtures/wpt/fetch/metadata/generated/element-iframe.https.sub.html @@ -304,6 +304,35 @@ assert_array_equals(headers['sec-fetch-user'], ['?1']); }); }, 'sec-fetch-user with user activation'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, ['httpsCrossSite'], {mime: 'text/html'}), + t, + false + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-storage-access'); + assert_array_equals(headers['sec-fetch-storage-access'], ['none']); + }); + }, 'sec-fetch-storage-access - Cross-site'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, ['httpsSameSite'], {mime: 'text/html'}), + t, + false + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Same site'); diff --git a/test/fixtures/wpt/fetch/metadata/generated/element-iframe.sub.html b/test/fixtures/wpt/fetch/metadata/generated/element-iframe.sub.html index 6f71cc0d254..5d2f096a3fa 100644 --- a/test/fixtures/wpt/fetch/metadata/generated/element-iframe.sub.html +++ b/test/fixtures/wpt/fetch/metadata/generated/element-iframe.sub.html @@ -202,6 +202,48 @@ }); }, 'sec-fetch-user - Not sent to non-trustworthy cross-site destination'); + promise_test((t) => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, ['httpOrigin'], {mime: 'text/html'}), + t, + false + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy same-origin destination'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, ['httpSameSite'], {mime: 'text/html'}), + t, + false + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy same-site destination'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, ['httpCrossSite'], {mime: 'text/html'}), + t, + false + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy cross-site destination'); + promise_test((t) => { const key = '{{uuid()}}'; diff --git a/test/fixtures/wpt/fetch/metadata/generated/element-img-environment-change.https.sub.html b/test/fixtures/wpt/fetch/metadata/generated/element-img-environment-change.https.sub.html index a19aa117c4f..9e9c3723e9a 100644 --- a/test/fixtures/wpt/fetch/metadata/generated/element-img-environment-change.https.sub.html +++ b/test/fixtures/wpt/fetch/metadata/generated/element-img-environment-change.https.sub.html @@ -352,6 +352,35 @@ assert_not_own_property(headers, 'sec-fetch-user'); }); }, 'sec-fetch-user - no attributes'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + return induceRequest( + t, + makeRequestURL(key, ['httpsCrossSite'], params), + {} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-storage-access'); + assert_array_equals(headers['sec-fetch-storage-access'], ['none']); + }); + }, 'sec-fetch-storage-access - Cross-site, no attributes'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + return induceRequest( + t, + makeRequestURL(key, ['httpsSameSite'], params), + {} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Same site, no attributes'); diff --git a/test/fixtures/wpt/fetch/metadata/generated/element-img-environment-change.sub.html b/test/fixtures/wpt/fetch/metadata/generated/element-img-environment-change.sub.html index 96658726ba0..0d99cb3171b 100644 --- a/test/fixtures/wpt/fetch/metadata/generated/element-img-environment-change.sub.html +++ b/test/fixtures/wpt/fetch/metadata/generated/element-img-environment-change.sub.html @@ -222,6 +222,48 @@ }); }, 'sec-fetch-user - Not sent to non-trustworthy cross-site destination, no attributes'); + promise_test((t) => { + const key = '{{uuid()}}'; + + return induceRequest( + t, + makeRequestURL(key, ['httpOrigin'], params), + {} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy same-origin destination, no attributes'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + return induceRequest( + t, + makeRequestURL(key, ['httpSameSite'], params), + {} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy same-site destination, no attributes'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + return induceRequest( + t, + makeRequestURL(key, ['httpCrossSite'], params), + {} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy cross-site destination, no attributes'); + promise_test((t) => { const key = '{{uuid()}}'; diff --git a/test/fixtures/wpt/fetch/metadata/generated/element-img.https.sub.html b/test/fixtures/wpt/fetch/metadata/generated/element-img.https.sub.html index 51d6e082b0e..5a0f2e4e200 100644 --- a/test/fixtures/wpt/fetch/metadata/generated/element-img.https.sub.html +++ b/test/fixtures/wpt/fetch/metadata/generated/element-img.https.sub.html @@ -640,6 +640,64 @@ assert_not_own_property(headers, 'sec-fetch-user'); }); }, 'sec-fetch-user - srcset - no attributes'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, ['httpsCrossSite']), + 'src', + {} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-storage-access'); + assert_array_equals(headers['sec-fetch-storage-access'], ['none']); + }); + }, 'sec-fetch-storage-access - src - Cross-site, no attributes'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, ['httpsCrossSite']), + 'srcset', + {} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-storage-access'); + assert_array_equals(headers['sec-fetch-storage-access'], ['none']); + }); + }, 'sec-fetch-storage-access - srcset - Cross-site, no attributes'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, ['httpsSameSite']), + 'src', + {} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - src - Same site, no attributes'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, ['httpsSameSite']), + 'srcset', + {} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - srcset - Same site, no attributes'); diff --git a/test/fixtures/wpt/fetch/metadata/generated/element-img.sub.html b/test/fixtures/wpt/fetch/metadata/generated/element-img.sub.html index 5a4b152c552..23008791d7f 100644 --- a/test/fixtures/wpt/fetch/metadata/generated/element-img.sub.html +++ b/test/fixtures/wpt/fetch/metadata/generated/element-img.sub.html @@ -364,6 +364,90 @@ }); }, 'sec-fetch-user - srcset - Not sent to non-trustworthy cross-site destination, no attributes'); + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, ['httpOrigin']), + 'src', + {} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - src - Not sent to non-trustworthy same-origin destination, no attributes'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, ['httpOrigin']), + 'srcset', + {} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - srcset - Not sent to non-trustworthy same-origin destination, no attributes'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, ['httpSameSite']), + 'src', + {} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - src - Not sent to non-trustworthy same-site destination, no attributes'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, ['httpSameSite']), + 'srcset', + {} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - srcset - Not sent to non-trustworthy same-site destination, no attributes'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, ['httpCrossSite']), + 'src', + {} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - src - Not sent to non-trustworthy cross-site destination, no attributes'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, ['httpCrossSite']), + 'srcset', + {} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - srcset - Not sent to non-trustworthy cross-site destination, no attributes'); + promise_test(() => { const key = '{{uuid()}}'; diff --git a/test/fixtures/wpt/fetch/metadata/generated/element-input-image.https.sub.html b/test/fixtures/wpt/fetch/metadata/generated/element-input-image.https.sub.html index 7fa674043e2..b5537eec60e 100644 --- a/test/fixtures/wpt/fetch/metadata/generated/element-input-image.https.sub.html +++ b/test/fixtures/wpt/fetch/metadata/generated/element-input-image.https.sub.html @@ -224,6 +224,27 @@ assert_not_own_property(headers, 'sec-fetch-user'); }); }, 'sec-fetch-user - no attributes'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + return induceRequest(makeRequestURL(key, ['httpsCrossSite']), t) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-storage-access'); + assert_array_equals(headers['sec-fetch-storage-access'], ['none']); + }); + }, 'sec-fetch-storage-access - Cross-site, no attributes'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + return induceRequest(makeRequestURL(key, ['httpsSameSite']), t) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Same site, no attributes'); diff --git a/test/fixtures/wpt/fetch/metadata/generated/element-input-image.sub.html b/test/fixtures/wpt/fetch/metadata/generated/element-input-image.sub.html index fb2a146b199..6f8743633fa 100644 --- a/test/fixtures/wpt/fetch/metadata/generated/element-input-image.sub.html +++ b/test/fixtures/wpt/fetch/metadata/generated/element-input-image.sub.html @@ -148,6 +148,36 @@ }); }, 'sec-fetch-user - Not sent to non-trustworthy cross-site destination, no attributes'); + promise_test((t) => { + const key = '{{uuid()}}'; + + return induceRequest(makeRequestURL(key, ['httpOrigin']), t) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy same-origin destination, no attributes'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + return induceRequest(makeRequestURL(key, ['httpSameSite']), t) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy same-site destination, no attributes'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + return induceRequest(makeRequestURL(key, ['httpCrossSite']), t) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy cross-site destination, no attributes'); + promise_test((t) => { const key = '{{uuid()}}'; diff --git a/test/fixtures/wpt/fetch/metadata/generated/element-link-icon.https.sub.html b/test/fixtures/wpt/fetch/metadata/generated/element-link-icon.https.sub.html index b2449607553..b41f0afe4a8 100644 --- a/test/fixtures/wpt/fetch/metadata/generated/element-link-icon.https.sub.html +++ b/test/fixtures/wpt/fetch/metadata/generated/element-link-icon.https.sub.html @@ -366,6 +366,37 @@ assert_not_own_property(headers, 'sec-fetch-user'); }); }, 'sec-fetch-user no attributes'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + induceRequest( + t, + makeRequestURL(key, ['httpsCrossSite'], params), + {} + ); + + return retrieve(key, {poll:true}) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-storage-access'); + assert_array_equals(headers['sec-fetch-storage-access'], ['none']); + }); + }, 'sec-fetch-storage-access - Cross-site no attributes'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + induceRequest( + t, + makeRequestURL(key, ['httpsSameSite'], params), + {} + ); + + return retrieve(key, {poll:true}) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Same site no attributes'); diff --git a/test/fixtures/wpt/fetch/metadata/generated/element-link-icon.sub.html b/test/fixtures/wpt/fetch/metadata/generated/element-link-icon.sub.html index e9226c190a5..ea9ecb4ffe0 100644 --- a/test/fixtures/wpt/fetch/metadata/generated/element-link-icon.sub.html +++ b/test/fixtures/wpt/fetch/metadata/generated/element-link-icon.sub.html @@ -228,6 +228,51 @@ }); }, 'sec-fetch-user - Not sent to non-trustworthy cross-site destination no attributes'); + promise_test((t) => { + const key = '{{uuid()}}'; + + induceRequest( + t, + makeRequestURL(key, ['httpOrigin'], params), + {} + ); + + return retrieve(key, {poll:true}) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy same-origin destination no attributes'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + induceRequest( + t, + makeRequestURL(key, ['httpSameSite'], params), + {} + ); + + return retrieve(key, {poll:true}) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy same-site destination no attributes'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + induceRequest( + t, + makeRequestURL(key, ['httpCrossSite'], params), + {} + ); + + return retrieve(key, {poll:true}) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy cross-site destination no attributes'); + promise_test((t) => { const key = '{{uuid()}}'; diff --git a/test/fixtures/wpt/fetch/metadata/generated/element-link-prefetch.https.optional.sub.html b/test/fixtures/wpt/fetch/metadata/generated/element-link-prefetch.https.optional.sub.html index bdd684a2679..16347abc825 100644 --- a/test/fixtures/wpt/fetch/metadata/generated/element-link-prefetch.https.optional.sub.html +++ b/test/fixtures/wpt/fetch/metadata/generated/element-link-prefetch.https.optional.sub.html @@ -553,6 +553,37 @@ assert_not_own_property(headers, 'sec-fetch-user'); }); }, 'sec-fetch-user no attributes'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + induceRequest( + t, + makeRequestURL(key, ['httpsCrossSite']), + {} + ); + + return retrieve(key, {poll:true}) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-storage-access'); + assert_array_equals(headers['sec-fetch-storage-access'], ['none']); + }); + }, 'sec-fetch-storage-access - Cross-site no attributes'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + induceRequest( + t, + makeRequestURL(key, ['httpsSameSite']), + {} + ); + + return retrieve(key, {poll:true}) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Same site no attributes'); diff --git a/test/fixtures/wpt/fetch/metadata/generated/element-link-prefetch.optional.sub.html b/test/fixtures/wpt/fetch/metadata/generated/element-link-prefetch.optional.sub.html index c2244883cc9..c9386717602 100644 --- a/test/fixtures/wpt/fetch/metadata/generated/element-link-prefetch.optional.sub.html +++ b/test/fixtures/wpt/fetch/metadata/generated/element-link-prefetch.optional.sub.html @@ -223,6 +223,51 @@ }); }, 'sec-fetch-user - Not sent to non-trustworthy cross-site destination no attributes'); + promise_test((t) => { + const key = '{{uuid()}}'; + + induceRequest( + t, + makeRequestURL(key, ['httpOrigin']), + {} + ); + + return retrieve(key, {poll:true}) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy same-origin destination no attributes'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + induceRequest( + t, + makeRequestURL(key, ['httpSameSite']), + {} + ); + + return retrieve(key, {poll:true}) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy same-site destination no attributes'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + induceRequest( + t, + makeRequestURL(key, ['httpCrossSite']), + {} + ); + + return retrieve(key, {poll:true}) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy cross-site destination no attributes'); + promise_test((t) => { const key = '{{uuid()}}'; diff --git a/test/fixtures/wpt/fetch/metadata/generated/element-meta-refresh.https.optional.sub.html b/test/fixtures/wpt/fetch/metadata/generated/element-meta-refresh.https.optional.sub.html index 3a1a8eb49af..7f763d630a3 100644 --- a/test/fixtures/wpt/fetch/metadata/generated/element-meta-refresh.https.optional.sub.html +++ b/test/fixtures/wpt/fetch/metadata/generated/element-meta-refresh.https.optional.sub.html @@ -271,6 +271,30 @@ assert_not_own_property(headers, 'sec-fetch-user'); }); }, 'sec-fetch-user'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, ['httpsCrossSite'], responseParams), t + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Cross-site'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, ['httpsSameSite'], responseParams), t + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Same site'); diff --git a/test/fixtures/wpt/fetch/metadata/generated/element-meta-refresh.optional.sub.html b/test/fixtures/wpt/fetch/metadata/generated/element-meta-refresh.optional.sub.html index df3e92e2c8f..c1f3ecbbf86 100644 --- a/test/fixtures/wpt/fetch/metadata/generated/element-meta-refresh.optional.sub.html +++ b/test/fixtures/wpt/fetch/metadata/generated/element-meta-refresh.optional.sub.html @@ -183,6 +183,42 @@ }); }, 'sec-fetch-user - Not sent to non-trustworthy cross-site destination'); + promise_test((t) => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, ['httpOrigin'], responseParams), t + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy same-origin destination'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, ['httpSameSite'], responseParams), t + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy same-site destination'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, ['httpCrossSite'], responseParams), t + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy cross-site destination'); + promise_test((t) => { const key = '{{uuid()}}'; diff --git a/test/fixtures/wpt/fetch/metadata/generated/element-picture.https.sub.html b/test/fixtures/wpt/fetch/metadata/generated/element-picture.https.sub.html index ba6636a019a..2de087218ac 100644 --- a/test/fixtures/wpt/fetch/metadata/generated/element-picture.https.sub.html +++ b/test/fixtures/wpt/fetch/metadata/generated/element-picture.https.sub.html @@ -991,6 +991,99 @@ assert_not_own_property(headers, 'sec-fetch-user'); }); }, 'sec-fetch-user - source[srcset] - no attributes'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, ['httpsCrossSite']), + 'img', + 'src', + {} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-storage-access'); + assert_array_equals(headers['sec-fetch-storage-access'], ['none']); + }); + }, 'sec-fetch-storage-access - img[src] - Cross-site, no attributes'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, ['httpsCrossSite']), + 'img', + 'srcset', + {} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-storage-access'); + assert_array_equals(headers['sec-fetch-storage-access'], ['none']); + }); + }, 'sec-fetch-storage-access - img[srcset] - Cross-site, no attributes'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, ['httpsCrossSite']), + 'source', + 'srcset', + {} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-storage-access'); + assert_array_equals(headers['sec-fetch-storage-access'], ['none']); + }); + }, 'sec-fetch-storage-access - source[srcset] - Cross-site, no attributes'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, ['httpsSameSite']), + 'img', + 'src', + {} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - img[src] - Same site, no attributes'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, ['httpsSameSite']), + 'img', + 'srcset', + {} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - img[srcset] - Same site, no attributes'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, ['httpsSameSite']), + 'source', + 'srcset', + {} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - source[srcset] - Same site, no attributes'); diff --git a/test/fixtures/wpt/fetch/metadata/generated/element-picture.sub.html b/test/fixtures/wpt/fetch/metadata/generated/element-picture.sub.html index 64f851c682b..f0e087483d5 100644 --- a/test/fixtures/wpt/fetch/metadata/generated/element-picture.sub.html +++ b/test/fixtures/wpt/fetch/metadata/generated/element-picture.sub.html @@ -575,6 +575,141 @@ }); }, 'sec-fetch-user - source[srcset] - Not sent to non-trustworthy cross-site destination, no attributes'); + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, ['httpOrigin']), + 'img', + 'src', + {} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - img[src] - Not sent to non-trustworthy same-origin destination, no attributes'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, ['httpOrigin']), + 'img', + 'srcset', + {} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - img[srcset] - Not sent to non-trustworthy same-origin destination, no attributes'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, ['httpOrigin']), + 'source', + 'srcset', + {} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - source[srcset] - Not sent to non-trustworthy same-origin destination, no attributes'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, ['httpSameSite']), + 'img', + 'src', + {} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - img[src] - Not sent to non-trustworthy same-site destination, no attributes'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, ['httpSameSite']), + 'img', + 'srcset', + {} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - img[srcset] - Not sent to non-trustworthy same-site destination, no attributes'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, ['httpSameSite']), + 'source', + 'srcset', + {} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - source[srcset] - Not sent to non-trustworthy same-site destination, no attributes'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, ['httpCrossSite']), + 'img', + 'src', + {} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - img[src] - Not sent to non-trustworthy cross-site destination, no attributes'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, ['httpCrossSite']), + 'img', + 'srcset', + {} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - img[srcset] - Not sent to non-trustworthy cross-site destination, no attributes'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, ['httpCrossSite']), + 'source', + 'srcset', + {} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - source[srcset] - Not sent to non-trustworthy cross-site destination, no attributes'); + promise_test(() => { const key = '{{uuid()}}'; diff --git a/test/fixtures/wpt/fetch/metadata/generated/element-script.https.sub.html b/test/fixtures/wpt/fetch/metadata/generated/element-script.https.sub.html index dcdcba2792d..e52b165b747 100644 --- a/test/fixtures/wpt/fetch/metadata/generated/element-script.https.sub.html +++ b/test/fixtures/wpt/fetch/metadata/generated/element-script.https.sub.html @@ -589,5 +589,36 @@ assert_not_own_property(headers, 'sec-fetch-user'); }); }, 'sec-fetch-user - no attributes'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL( + key, ['httpsCrossSite'], { mime: 'application/javascript' } + ); + + return induceRequest(url, + {} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-storage-access'); + assert_array_equals(headers['sec-fetch-storage-access'], ['none']); + }); + }, 'sec-fetch-storage-access - Cross-site, no attributes'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL( + key, ['httpsSameSite'], { mime: 'application/javascript' } + ); + + return induceRequest(url, + {} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Same site, no attributes'); diff --git a/test/fixtures/wpt/fetch/metadata/generated/element-script.sub.html b/test/fixtures/wpt/fetch/metadata/generated/element-script.sub.html index a2526698fbd..47ed5fa9f8f 100644 --- a/test/fixtures/wpt/fetch/metadata/generated/element-script.sub.html +++ b/test/fixtures/wpt/fetch/metadata/generated/element-script.sub.html @@ -391,6 +391,96 @@ }); }, 'sec-fetch-user - Not sent to non-trustworthy cross-site destination, attributes: type=module'); + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL( + key, ['httpOrigin'], { mime: 'application/javascript' } + ); + + return induceRequest(url, + {} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy same-origin destination, no attributes'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL( + key, ['httpOrigin'], { mime: 'application/javascript' } + ); + + return induceRequest(url, + {"type": "module"} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy same-origin destination, attributes: type=module'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL( + key, ['httpSameSite'], { mime: 'application/javascript' } + ); + + return induceRequest(url, + {} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy same-site destination, no attributes'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL( + key, ['httpSameSite'], { mime: 'application/javascript' } + ); + + return induceRequest(url, + {"type": "module"} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy same-site destination, attributes: type=module'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL( + key, ['httpCrossSite'], { mime: 'application/javascript' } + ); + + return induceRequest(url, + {} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy cross-site destination, no attributes'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL( + key, ['httpCrossSite'], { mime: 'application/javascript' } + ); + + return induceRequest(url, + {"type": "module"} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy cross-site destination, attributes: type=module'); + promise_test(() => { const key = '{{uuid()}}'; const url = makeRequestURL( diff --git a/test/fixtures/wpt/fetch/metadata/generated/element-video-poster.https.sub.html b/test/fixtures/wpt/fetch/metadata/generated/element-video-poster.https.sub.html index 5805b46bd0c..ddd870af7c2 100644 --- a/test/fixtures/wpt/fetch/metadata/generated/element-video-poster.https.sub.html +++ b/test/fixtures/wpt/fetch/metadata/generated/element-video-poster.https.sub.html @@ -238,6 +238,27 @@ assert_not_own_property(headers, 'sec-fetch-user'); }); }, 'sec-fetch-user'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + return induceRequest(t, makeRequestURL(key, ['httpsCrossSite'], params)) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-storage-access'); + assert_array_equals(headers['sec-fetch-storage-access'], ['none']); + }); + }, 'sec-fetch-storage-access - Cross-site'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + return induceRequest(t, makeRequestURL(key, ['httpsSameSite'], params)) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Same site'); diff --git a/test/fixtures/wpt/fetch/metadata/generated/element-video-poster.sub.html b/test/fixtures/wpt/fetch/metadata/generated/element-video-poster.sub.html index e6cc5ee7e06..aeb3d4f9b5e 100644 --- a/test/fixtures/wpt/fetch/metadata/generated/element-video-poster.sub.html +++ b/test/fixtures/wpt/fetch/metadata/generated/element-video-poster.sub.html @@ -162,6 +162,36 @@ }); }, 'sec-fetch-user - Not sent to non-trustworthy cross-site destination'); + promise_test((t) => { + const key = '{{uuid()}}'; + + return induceRequest(t, makeRequestURL(key, ['httpOrigin'], params)) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy same-origin destination'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + return induceRequest(t, makeRequestURL(key, ['httpSameSite'], params)) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy same-site destination'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + return induceRequest(t, makeRequestURL(key, ['httpCrossSite'], params)) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy cross-site destination'); + promise_test((t) => { const key = '{{uuid()}}'; diff --git a/test/fixtures/wpt/fetch/metadata/generated/element-video.https.sub.html b/test/fixtures/wpt/fetch/metadata/generated/element-video.https.sub.html index 971360dceea..c900807820c 100644 --- a/test/fixtures/wpt/fetch/metadata/generated/element-video.https.sub.html +++ b/test/fixtures/wpt/fetch/metadata/generated/element-video.https.sub.html @@ -320,6 +320,33 @@ assert_not_own_property(headers, 'sec-fetch-user'); }); }, 'sec-fetch-user - no attributes'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, ['httpsCrossSite']), + {} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-storage-access'); + assert_array_equals(headers['sec-fetch-storage-access'], ['none']); + }); + }, 'sec-fetch-storage-access - Cross-site, no attributes'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, ['httpsSameSite']), + {} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Same site, no attributes'); diff --git a/test/fixtures/wpt/fetch/metadata/generated/element-video.sub.html b/test/fixtures/wpt/fetch/metadata/generated/element-video.sub.html index 9707413ab68..bf357e9da0e 100644 --- a/test/fixtures/wpt/fetch/metadata/generated/element-video.sub.html +++ b/test/fixtures/wpt/fetch/metadata/generated/element-video.sub.html @@ -184,6 +184,45 @@ }); }, 'sec-fetch-user - Not sent to non-trustworthy cross-site destination, no attributes'); + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, ['httpOrigin']), + {} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy same-origin destination, no attributes'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, ['httpSameSite']), + {} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy same-site destination, no attributes'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, ['httpCrossSite']), + {} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy cross-site destination, no attributes'); + promise_test(() => { const key = '{{uuid()}}'; diff --git a/test/fixtures/wpt/fetch/metadata/generated/fetch-via-serviceworker.https.sub.html b/test/fixtures/wpt/fetch/metadata/generated/fetch-via-serviceworker.https.sub.html index 22f930960d6..c3b0599b9da 100644 --- a/test/fixtures/wpt/fetch/metadata/generated/fetch-via-serviceworker.https.sub.html +++ b/test/fixtures/wpt/fetch/metadata/generated/fetch-via-serviceworker.https.sub.html @@ -678,6 +678,68 @@ }); }, 'sec-fetch-user - no init - fallback'); + promise_test((t) => { + const key = '{{uuid()}}'; + + return induceRequest( + t, + makeRequestURL(key, ['httpsCrossSite']), + {"credentials": "include", "mode": "no-cors"}, + 'respondWith' + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-storage-access'); + assert_array_equals(headers['sec-fetch-storage-access'], ['none']); + }); + }, 'sec-fetch-storage-access - Cross-site, init: mode=no-cors, credentials=include - respondWith'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + return induceRequest( + t, + makeRequestURL(key, ['httpsCrossSite']), + {"credentials": "include", "mode": "no-cors"}, + 'fallback' + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-storage-access'); + assert_array_equals(headers['sec-fetch-storage-access'], ['none']); + }); + }, 'sec-fetch-storage-access - Cross-site, init: mode=no-cors, credentials=include - fallback'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + return induceRequest( + t, + makeRequestURL(key, ['httpsSameSite']), + {"credentials": "include", "mode": "no-cors"}, + 'respondWith' + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Same site, init: mode=no-cors, credentials=include - respondWith'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + return induceRequest( + t, + makeRequestURL(key, ['httpsSameSite']), + {"credentials": "include", "mode": "no-cors"}, + 'fallback' + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Same site, init: mode=no-cors, credentials=include - fallback'); + diff --git a/test/fixtures/wpt/fetch/metadata/generated/fetch.https.sub.html b/test/fixtures/wpt/fetch/metadata/generated/fetch.https.sub.html index dde1daede4e..486f404d4bd 100644 --- a/test/fixtures/wpt/fetch/metadata/generated/fetch.https.sub.html +++ b/test/fixtures/wpt/fetch/metadata/generated/fetch.https.sub.html @@ -297,6 +297,33 @@ assert_not_own_property(headers, 'sec-fetch-user'); }); }, 'sec-fetch-user - no init'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, ['httpsCrossSite']), + {"credentials": "include", "mode": "no-cors"} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-storage-access'); + assert_array_equals(headers['sec-fetch-storage-access'], ['none']); + }); + }, 'sec-fetch-storage-access - Cross-site, init: mode=no-cors, credentials=include'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, ['httpsSameSite']), + {"credentials": "include", "mode": "no-cors"} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Same site, init: mode=no-cors, credentials=include'); diff --git a/test/fixtures/wpt/fetch/metadata/generated/fetch.sub.html b/test/fixtures/wpt/fetch/metadata/generated/fetch.sub.html index d28ea9bb900..7d9536efcfb 100644 --- a/test/fixtures/wpt/fetch/metadata/generated/fetch.sub.html +++ b/test/fixtures/wpt/fetch/metadata/generated/fetch.sub.html @@ -175,6 +175,45 @@ }); }, 'sec-fetch-user - Not sent to non-trustworthy cross-site destination, no init'); + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, ['httpOrigin']), + {} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy same-origin destination, no init'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, ['httpSameSite']), + {} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy same-site destination, no init'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, ['httpCrossSite']), + {} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy cross-site destination, no init'); + promise_test(() => { const key = '{{uuid()}}'; diff --git a/test/fixtures/wpt/fetch/metadata/generated/form-submission.https.sub.html b/test/fixtures/wpt/fetch/metadata/generated/form-submission.https.sub.html index 988b07c74a9..0935f846111 100644 --- a/test/fixtures/wpt/fetch/metadata/generated/form-submission.https.sub.html +++ b/test/fixtures/wpt/fetch/metadata/generated/form-submission.https.sub.html @@ -517,6 +517,50 @@ assert_array_equals(headers['sec-fetch-user'], ['?1']); }); }, 'sec-fetch-user - POST with user activation'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['httpsCrossSite'], responseParams); + const userActivated = false; + return induceRequest('GET', url, userActivated) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Cross-site - GET'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['httpsCrossSite'], responseParams); + const userActivated = false; + return induceRequest('POST', url, userActivated) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Cross-site - POST'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['httpsSameSite'], responseParams); + const userActivated = false; + return induceRequest('GET', url, userActivated) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Same site - GET'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['httpsSameSite'], responseParams); + const userActivated = false; + return induceRequest('POST', url, userActivated) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Same site - POST'); diff --git a/test/fixtures/wpt/fetch/metadata/generated/form-submission.sub.html b/test/fixtures/wpt/fetch/metadata/generated/form-submission.sub.html index f862062aebc..b0f56f60942 100644 --- a/test/fixtures/wpt/fetch/metadata/generated/form-submission.sub.html +++ b/test/fixtures/wpt/fetch/metadata/generated/form-submission.sub.html @@ -326,6 +326,72 @@ }); }, 'sec-fetch-user - Not sent to non-trustworthy cross-site destination - POST'); + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['httpOrigin'], responseParams); + const userActivated = false; + return induceRequest('GET', url, userActivated) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy same-origin destination - GET'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['httpOrigin'], responseParams); + const userActivated = false; + return induceRequest('POST', url, userActivated) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy same-origin destination - POST'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['httpSameSite'], responseParams); + const userActivated = false; + return induceRequest('GET', url, userActivated) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy same-site destination - GET'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['httpSameSite'], responseParams); + const userActivated = false; + return induceRequest('POST', url, userActivated) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy same-site destination - POST'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['httpCrossSite'], responseParams); + const userActivated = false; + return induceRequest('GET', url, userActivated) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy cross-site destination - GET'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['httpCrossSite'], responseParams); + const userActivated = false; + return induceRequest('POST', url, userActivated) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy cross-site destination - POST'); + promise_test(() => { const key = '{{uuid()}}'; const url = makeRequestURL(key, ['httpsOrigin', 'httpOrigin'], responseParams); diff --git a/test/fixtures/wpt/fetch/metadata/generated/header-link.https.sub.html b/test/fixtures/wpt/fetch/metadata/generated/header-link.https.sub.html index 09f01138955..8e7d029dc25 100644 --- a/test/fixtures/wpt/fetch/metadata/generated/header-link.https.sub.html +++ b/test/fixtures/wpt/fetch/metadata/generated/header-link.https.sub.html @@ -524,6 +524,64 @@ assert_not_own_property(headers, 'sec-fetch-user'); }); }, 'sec-fetch-user rel=stylesheet'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, ['httpsCrossSite'], {mime: 'text/html'}), + 'icon', + t + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-storage-access'); + assert_array_equals(headers['sec-fetch-storage-access'], ['none']); + }); + }, 'sec-fetch-storage-access rel=icon - Cross-site'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, ['httpsCrossSite'], {mime: 'text/html'}), + 'stylesheet', + t + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-storage-access'); + assert_array_equals(headers['sec-fetch-storage-access'], ['none']); + }); + }, 'sec-fetch-storage-access rel=stylesheet - Cross-site'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, ['httpsSameSite'], {mime: 'text/html'}), + 'icon', + t + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access rel=icon - Same site'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, ['httpsSameSite'], {mime: 'text/html'}), + 'stylesheet', + t + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access rel=stylesheet - Same site'); diff --git a/test/fixtures/wpt/fetch/metadata/generated/header-link.sub.html b/test/fixtures/wpt/fetch/metadata/generated/header-link.sub.html index 8b6cdae0eda..b0823071345 100644 --- a/test/fixtures/wpt/fetch/metadata/generated/header-link.sub.html +++ b/test/fixtures/wpt/fetch/metadata/generated/header-link.sub.html @@ -368,6 +368,90 @@ }); }, 'sec-fetch-user rel=stylesheet - Not sent to non-trustworthy cross-site destination'); + promise_test((t) => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, ['httpOrigin'], {mime: 'text/html'}), + 'icon', + t + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access rel=icon - Not sent to non-trustworthy same-origin destination'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, ['httpOrigin'], {mime: 'text/html'}), + 'stylesheet', + t + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access rel=stylesheet - Not sent to non-trustworthy same-origin destination'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, ['httpSameSite'], {mime: 'text/html'}), + 'icon', + t + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access rel=icon - Not sent to non-trustworthy same-site destination'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, ['httpSameSite'], {mime: 'text/html'}), + 'stylesheet', + t + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access rel=stylesheet - Not sent to non-trustworthy same-site destination'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, ['httpCrossSite'], {mime: 'text/html'}), + 'icon', + t + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access rel=icon - Not sent to non-trustworthy cross-site destination'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, ['httpCrossSite'], {mime: 'text/html'}), + 'stylesheet', + t + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access rel=stylesheet - Not sent to non-trustworthy cross-site destination'); + promise_test((t) => { const key = '{{uuid()}}'; diff --git a/test/fixtures/wpt/fetch/metadata/generated/header-refresh.https.optional.sub.html b/test/fixtures/wpt/fetch/metadata/generated/header-refresh.https.optional.sub.html index e63ee423cd7..0f7e9e42b79 100644 --- a/test/fixtures/wpt/fetch/metadata/generated/header-refresh.https.optional.sub.html +++ b/test/fixtures/wpt/fetch/metadata/generated/header-refresh.https.optional.sub.html @@ -268,6 +268,30 @@ assert_not_own_property(headers, 'sec-fetch-user'); }); }, 'sec-fetch-user'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, ['httpsCrossSite'], responseParams), t + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Cross-site'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, ['httpsSameSite'], responseParams), t + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Same site'); diff --git a/test/fixtures/wpt/fetch/metadata/generated/header-refresh.optional.sub.html b/test/fixtures/wpt/fetch/metadata/generated/header-refresh.optional.sub.html index 4674ada9c6d..873013e821c 100644 --- a/test/fixtures/wpt/fetch/metadata/generated/header-refresh.optional.sub.html +++ b/test/fixtures/wpt/fetch/metadata/generated/header-refresh.optional.sub.html @@ -180,6 +180,42 @@ }); }, 'sec-fetch-user - Not sent to non-trustworthy cross-site destination'); + promise_test((t) => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, ['httpOrigin'], responseParams), t + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy same-origin destination'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, ['httpSameSite'], responseParams), t + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy same-site destination'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, ['httpCrossSite'], responseParams), t + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy cross-site destination'); + promise_test((t) => { const key = '{{uuid()}}'; diff --git a/test/fixtures/wpt/fetch/metadata/generated/script-module-import-dynamic.https.sub.html b/test/fixtures/wpt/fetch/metadata/generated/script-module-import-dynamic.https.sub.html index 72d60fc30cb..94ef41b9228 100644 --- a/test/fixtures/wpt/fetch/metadata/generated/script-module-import-dynamic.https.sub.html +++ b/test/fixtures/wpt/fetch/metadata/generated/script-module-import-dynamic.https.sub.html @@ -250,5 +250,31 @@ assert_not_own_property(headers, 'sec-fetch-user'); }); }, 'sec-fetch-user'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL( + key, ['httpsCrossSite'], { mime: 'application/javascript' } + ); + + return import(url) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Cross-site'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL( + key, ['httpsSameSite'], { mime: 'application/javascript' } + ); + + return import(url) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Same site'); diff --git a/test/fixtures/wpt/fetch/metadata/generated/script-module-import-dynamic.sub.html b/test/fixtures/wpt/fetch/metadata/generated/script-module-import-dynamic.sub.html index 088720c23e0..16aefa11176 100644 --- a/test/fixtures/wpt/fetch/metadata/generated/script-module-import-dynamic.sub.html +++ b/test/fixtures/wpt/fetch/metadata/generated/script-module-import-dynamic.sub.html @@ -170,6 +170,45 @@ }); }, 'sec-fetch-user - Not sent to non-trustworthy cross-site destination'); + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL( + key, ['httpOrigin'], { mime: 'application/javascript' } + ); + + return import(url) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy same-origin destination'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL( + key, ['httpSameSite'], { mime: 'application/javascript' } + ); + + return import(url) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy same-site destination'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL( + key, ['httpCrossSite'], { mime: 'application/javascript' } + ); + + return import(url) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy cross-site destination'); + promise_test(() => { const key = '{{uuid()}}'; const url = makeRequestURL( diff --git a/test/fixtures/wpt/fetch/metadata/generated/script-module-import-static.https.sub.html b/test/fixtures/wpt/fetch/metadata/generated/script-module-import-static.https.sub.html index cea3464f807..62968f318f5 100644 --- a/test/fixtures/wpt/fetch/metadata/generated/script-module-import-static.https.sub.html +++ b/test/fixtures/wpt/fetch/metadata/generated/script-module-import-static.https.sub.html @@ -284,5 +284,33 @@ assert_not_own_property(headers, 'sec-fetch-user'); }); }, 'sec-fetch-user'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL( + key, ['httpsCrossSite'], { mime: 'application/javascript' } + ) + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Cross-site'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL( + key, ['httpsSameSite'], { mime: 'application/javascript' } + ) + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Same site'); diff --git a/test/fixtures/wpt/fetch/metadata/generated/script-module-import-static.sub.html b/test/fixtures/wpt/fetch/metadata/generated/script-module-import-static.sub.html index 0f94f71cf6f..c4da1576606 100644 --- a/test/fixtures/wpt/fetch/metadata/generated/script-module-import-static.sub.html +++ b/test/fixtures/wpt/fetch/metadata/generated/script-module-import-static.sub.html @@ -199,6 +199,48 @@ }); }, 'sec-fetch-user - Not sent to non-trustworthy cross-site destination'); + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL( + key, ['httpOrigin'], { mime: 'application/javascript' } + ) + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy same-origin destination'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL( + key, ['httpSameSite'], { mime: 'application/javascript' } + ) + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy same-site destination'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL( + key, ['httpCrossSite'], { mime: 'application/javascript' } + ) + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy cross-site destination'); + promise_test(() => { const key = '{{uuid()}}'; diff --git a/test/fixtures/wpt/fetch/metadata/generated/svg-image.https.sub.html b/test/fixtures/wpt/fetch/metadata/generated/svg-image.https.sub.html index b059eb31456..9dd0da15f9d 100644 --- a/test/fixtures/wpt/fetch/metadata/generated/svg-image.https.sub.html +++ b/test/fixtures/wpt/fetch/metadata/generated/svg-image.https.sub.html @@ -362,6 +362,35 @@ assert_not_own_property(headers, 'sec-fetch-user'); }); }, 'sec-fetch-user no attributes'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + return induceRequest( + t, + makeRequestURL(key, ['httpsCrossSite'], params), + {} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-storage-access'); + assert_array_equals(headers['sec-fetch-storage-access'], ['none']); + }); + }, 'sec-fetch-storage-access - Cross-site no attributes'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + return induceRequest( + t, + makeRequestURL(key, ['httpsSameSite'], params), + {} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Same site no attributes'); diff --git a/test/fixtures/wpt/fetch/metadata/generated/svg-image.sub.html b/test/fixtures/wpt/fetch/metadata/generated/svg-image.sub.html index a28bbb12eb7..56427bedaa6 100644 --- a/test/fixtures/wpt/fetch/metadata/generated/svg-image.sub.html +++ b/test/fixtures/wpt/fetch/metadata/generated/svg-image.sub.html @@ -217,6 +217,48 @@ }); }, 'sec-fetch-user - Not sent to non-trustworthy cross-site destination no attributes'); + promise_test((t) => { + const key = '{{uuid()}}'; + + return induceRequest( + t, + makeRequestURL(key, ['httpOrigin'], params), + {} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy same-origin destination no attributes'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + return induceRequest( + t, + makeRequestURL(key, ['httpSameSite'], params), + {} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy same-site destination no attributes'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + return induceRequest( + t, + makeRequestURL(key, ['httpCrossSite'], params), + {} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy cross-site destination no attributes'); + promise_test((t) => { const key = '{{uuid()}}'; diff --git a/test/fixtures/wpt/fetch/metadata/generated/window-history.https.sub.html b/test/fixtures/wpt/fetch/metadata/generated/window-history.https.sub.html index c2b3079a6d3..64e282e7789 100644 --- a/test/fixtures/wpt/fetch/metadata/generated/window-history.https.sub.html +++ b/test/fixtures/wpt/fetch/metadata/generated/window-history.https.sub.html @@ -232,6 +232,50 @@ assert_not_own_property(headers, 'sec-fetch-user'); }); }, 'sec-fetch-user - history.forward'); + + promise_test((t) => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['httpsCrossSite'], responseParams); + + return induceBackRequest(url, t, () => retrieve(key)) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Cross-site - history.back'); + + promise_test((t) => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['httpsCrossSite'], responseParams); + + return induceForwardRequest(url, t, () => retrieve(key)) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Cross-site - history.forward'); + + promise_test((t) => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['httpsSameSite'], responseParams); + + return induceBackRequest(url, t, () => retrieve(key)) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Same site - history.back'); + + promise_test((t) => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['httpsSameSite'], responseParams); + + return induceForwardRequest(url, t, () => retrieve(key)) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Same site - history.forward'); diff --git a/test/fixtures/wpt/fetch/metadata/generated/window-history.sub.html b/test/fixtures/wpt/fetch/metadata/generated/window-history.sub.html index 333d90c2860..83670496477 100644 --- a/test/fixtures/wpt/fetch/metadata/generated/window-history.sub.html +++ b/test/fixtures/wpt/fetch/metadata/generated/window-history.sub.html @@ -355,6 +355,72 @@ assert_not_own_property(headers, 'sec-fetch-user'); }); }, 'sec-fetch-user - Not sent to non-trustworthy cross-site destination - history.forward'); + + promise_test((t) => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['httpOrigin'], responseParams); + + return induceBackRequest(url, t, () => retrieve(key)) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy same-origin destination - history.back'); + + promise_test((t) => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['httpOrigin'], responseParams); + + return induceForwardRequest(url, t, () => retrieve(key)) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy same-origin destination - history.forward'); + + promise_test((t) => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['httpSameSite'], responseParams); + + return induceBackRequest(url, t, () => retrieve(key)) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy same-site destination - history.back'); + + promise_test((t) => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['httpSameSite'], responseParams); + + return induceForwardRequest(url, t, () => retrieve(key)) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy same-site destination - history.forward'); + + promise_test((t) => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['httpCrossSite'], responseParams); + + return induceBackRequest(url, t, () => retrieve(key)) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy cross-site destination - history.back'); + + promise_test((t) => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['httpCrossSite'], responseParams); + + return induceForwardRequest(url, t, () => retrieve(key)) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy cross-site destination - history.forward'); diff --git a/test/fixtures/wpt/fetch/metadata/generated/window-location.https.sub.html b/test/fixtures/wpt/fetch/metadata/generated/window-location.https.sub.html index 4a0d2fdc068..387039bcf25 100644 --- a/test/fixtures/wpt/fetch/metadata/generated/window-location.https.sub.html +++ b/test/fixtures/wpt/fetch/metadata/generated/window-location.https.sub.html @@ -1179,6 +1179,118 @@ assert_array_equals(headers['sec-fetch-user'], ['?1']); }); }, 'sec-fetch-user - location.replace with user activation'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['httpsCrossSite'], responseParams); + + const navigate = (win, path) => { + win.location = path; + }; + return induceRequest(url, navigate, false) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Cross-site - location'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['httpsCrossSite'], responseParams); + + const navigate = (win, path) => { + win.location.href = path; + }; + return induceRequest(url, navigate, false) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Cross-site - location.href'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['httpsCrossSite'], responseParams); + + const navigate = (win, path) => { + win.location.assign(path); + }; + return induceRequest(url, navigate, false) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Cross-site - location.assign'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['httpsCrossSite'], responseParams); + + const navigate = (win, path) => { + win.location.replace(path); + }; + return induceRequest(url, navigate, false) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Cross-site - location.replace'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['httpsSameSite'], responseParams); + + const navigate = (win, path) => { + win.location = path; + }; + return induceRequest(url, navigate, false) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Same site - location'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['httpsSameSite'], responseParams); + + const navigate = (win, path) => { + win.location.href = path; + }; + return induceRequest(url, navigate, false) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Same site - location.href'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['httpsSameSite'], responseParams); + + const navigate = (win, path) => { + win.location.assign(path); + }; + return induceRequest(url, navigate, false) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Same site - location.assign'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['httpsSameSite'], responseParams); + + const navigate = (win, path) => { + win.location.replace(path); + }; + return induceRequest(url, navigate, false) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Same site - location.replace'); diff --git a/test/fixtures/wpt/fetch/metadata/generated/window-location.sub.html b/test/fixtures/wpt/fetch/metadata/generated/window-location.sub.html index bb3e6805cb0..e307b909dce 100644 --- a/test/fixtures/wpt/fetch/metadata/generated/window-location.sub.html +++ b/test/fixtures/wpt/fetch/metadata/generated/window-location.sub.html @@ -714,6 +714,174 @@ }); }, 'sec-fetch-user - Not sent to non-trustworthy cross-site destination - location.replace'); + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['httpOrigin'], responseParams); + + const navigate = (win, path) => { + win.location = path; + }; + return induceRequest(url, navigate, false) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy same-origin destination - location'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['httpOrigin'], responseParams); + + const navigate = (win, path) => { + win.location.href = path; + }; + return induceRequest(url, navigate, false) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy same-origin destination - location.href'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['httpOrigin'], responseParams); + + const navigate = (win, path) => { + win.location.assign(path); + }; + return induceRequest(url, navigate, false) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy same-origin destination - location.assign'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['httpOrigin'], responseParams); + + const navigate = (win, path) => { + win.location.replace(path); + }; + return induceRequest(url, navigate, false) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy same-origin destination - location.replace'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['httpSameSite'], responseParams); + + const navigate = (win, path) => { + win.location = path; + }; + return induceRequest(url, navigate, false) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy same-site destination - location'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['httpSameSite'], responseParams); + + const navigate = (win, path) => { + win.location.href = path; + }; + return induceRequest(url, navigate, false) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy same-site destination - location.href'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['httpSameSite'], responseParams); + + const navigate = (win, path) => { + win.location.assign(path); + }; + return induceRequest(url, navigate, false) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy same-site destination - location.assign'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['httpSameSite'], responseParams); + + const navigate = (win, path) => { + win.location.replace(path); + }; + return induceRequest(url, navigate, false) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy same-site destination - location.replace'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['httpCrossSite'], responseParams); + + const navigate = (win, path) => { + win.location = path; + }; + return induceRequest(url, navigate, false) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy cross-site destination - location'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['httpCrossSite'], responseParams); + + const navigate = (win, path) => { + win.location.href = path; + }; + return induceRequest(url, navigate, false) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy cross-site destination - location.href'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['httpCrossSite'], responseParams); + + const navigate = (win, path) => { + win.location.assign(path); + }; + return induceRequest(url, navigate, false) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy cross-site destination - location.assign'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['httpCrossSite'], responseParams); + + const navigate = (win, path) => { + win.location.replace(path); + }; + return induceRequest(url, navigate, false) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy cross-site destination - location.replace'); + promise_test(() => { const key = '{{uuid()}}'; const url = makeRequestURL(key, ['httpsOrigin', 'httpOrigin'], responseParams); diff --git a/test/fixtures/wpt/fetch/metadata/generated/worker-dedicated-constructor.sub.html b/test/fixtures/wpt/fetch/metadata/generated/worker-dedicated-constructor.sub.html index 65b1837c636..e05e12df395 100644 --- a/test/fixtures/wpt/fetch/metadata/generated/worker-dedicated-constructor.sub.html +++ b/test/fixtures/wpt/fetch/metadata/generated/worker-dedicated-constructor.sub.html @@ -80,5 +80,20 @@ assert_not_own_property(headers, 'sec-fetch-user'); }); }, 'sec-fetch-user - Not sent to non-trustworthy same-origin destination, no options'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL( + key, + ['httpOrigin'], + { mime: 'application/javascript', body: 'postMessage("")' } + ); + + return induceRequest(url) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy same-origin destination, no options'); diff --git a/test/fixtures/wpt/fetch/metadata/generated/worker-dedicated-importscripts.https.sub.html b/test/fixtures/wpt/fetch/metadata/generated/worker-dedicated-importscripts.https.sub.html index 0cd9f35d582..5b48e59e716 100644 --- a/test/fixtures/wpt/fetch/metadata/generated/worker-dedicated-importscripts.https.sub.html +++ b/test/fixtures/wpt/fetch/metadata/generated/worker-dedicated-importscripts.https.sub.html @@ -264,5 +264,32 @@ assert_not_own_property(headers, 'sec-fetch-user'); }); }, 'sec-fetch-user'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL( + key, ['httpsCrossSite'], { mime: 'application/javascript' } + ); + + return induceRequest(url) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-storage-access'); + assert_array_equals(headers['sec-fetch-storage-access'], ['none']); + }); + }, 'sec-fetch-storage-access - Cross-site'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL( + key, ['httpsSameSite'], { mime: 'application/javascript' } + ); + + return induceRequest(url) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Same site'); diff --git a/test/fixtures/wpt/fetch/metadata/generated/worker-dedicated-importscripts.sub.html b/test/fixtures/wpt/fetch/metadata/generated/worker-dedicated-importscripts.sub.html index 0555bbaf432..ad4792b8a60 100644 --- a/test/fixtures/wpt/fetch/metadata/generated/worker-dedicated-importscripts.sub.html +++ b/test/fixtures/wpt/fetch/metadata/generated/worker-dedicated-importscripts.sub.html @@ -184,6 +184,45 @@ }); }, 'sec-fetch-user - Not sent to non-trustworthy cross-site destination'); + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL( + key, ['httpOrigin'], { mime: 'application/javascript' } + ); + + return induceRequest(url) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy same-origin destination'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL( + key, ['httpSameSite'], { mime: 'application/javascript' } + ); + + return induceRequest(url) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy same-site destination'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL( + key, ['httpCrossSite'], { mime: 'application/javascript' } + ); + + return induceRequest(url) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-storage-access'); + }); + }, 'sec-fetch-storage-access - Not sent to non-trustworthy cross-site destination'); + promise_test(() => { const key = '{{uuid()}}'; const url = makeRequestURL( diff --git a/test/fixtures/wpt/fetch/metadata/tools/fetch-metadata.conf.yml b/test/fixtures/wpt/fetch/metadata/tools/fetch-metadata.conf.yml index b96bd2fd7b4..bc764aed02d 100644 --- a/test/fixtures/wpt/fetch/metadata/tools/fetch-metadata.conf.yml +++ b/test/fixtures/wpt/fetch/metadata/tools/fetch-metadata.conf.yml @@ -42,6 +42,15 @@ cases: - headerName: sec-fetch-user origins: [httpCrossSite] description: Not sent to non-trustworthy cross-site destination + - headerName: sec-fetch-storage-access + origins: [httpOrigin] + description: Not sent to non-trustworthy same-origin destination + - headerName: sec-fetch-storage-access + origins: [httpSameSite] + description: Not sent to non-trustworthy same-site destination + - headerName: sec-fetch-storage-access + origins: [httpCrossSite] + description: Not sent to non-trustworthy cross-site destination template_axes: # The `AudioWorklet` interface is only available in secure contexts # https://webaudio.github.io/web-audio-api/#AudioWorklet @@ -109,6 +118,9 @@ cases: - headerName: sec-fetch-user origins: [httpOrigin] description: Not sent to non-trustworthy same-origin destination + - headerName: sec-fetch-storage-access + origins: [httpOrigin] + description: Not sent to non-trustworthy same-origin destination template_axes: # All the templates in this block are unused with the exception of # `worker-dedicated-constructor` @@ -848,3 +860,72 @@ cases: expected: NULL worker-dedicated-importscripts.sub.html: - expected: NULL + # Sec-Fetch-Storage-Access + - all_subtests: + headerName: sec-fetch-storage-access + filename_flags: [https] + common_axis: + - description: Cross-site + origins: [httpsCrossSite] + expected: none + - description: Same site + origins: [httpsSameSite] + expected: NULL + template_axes: + # Service Workers' redirect mode is "error" + serviceworker.https.sub.html: [{}] + # Interstitial locations in an HTTP redirect chain are not added to the + # session history, so these requests cannot be initiated using the + # History API. + css-images.sub.html: + - filename_flags: [tentative] + element-audio.sub.html: [{}] + element-embed.sub.html: [{}] + element-frame.sub.html: [{}] + element-iframe.sub.html: [{}] + element-img.sub.html: + - sourceAttr: src + - sourceAttr: srcset + element-img-environment-change.sub.html: [{}] + element-input-image.sub.html: [{}] + element-link-icon.sub.html: [{}] + element-link-prefetch.optional.sub.html: [{}] + element-picture.sub.html: [{}] + element-script.sub.html: [{}] + element-video.sub.html: [{}] + element-video-poster.sub.html: [{}] + fetch.sub.html: [{ init: { mode: no-cors , credentials: include } }] + fetch-via-serviceworker.https.sub.html: [{ init: { mode: no-cors , credentials: include } }] + header-link.sub.html: + - rel: icon + - rel: stylesheet + svg-image.sub.html: [{}] + worker-dedicated-constructor.sub.html: [] + worker-dedicated-importscripts.sub.html: [{}] + # The following are cases where the Sec-Fetch-Storage-Access header should + # not be attached at all. + - all_subtests: + headerName: sec-fetch-storage-access + filename_flags: [https] + common_axis: + - description: Cross-site + origins: [httpsCrossSite] + expected: NULL + - description: Same site + origins: [httpsSameSite] + expected: NULL + template_axes: + audioworklet.https.sub.html: [{}] + css-font-face.sub.html: + - filename_flags: [tentative] + element-meta-refresh.optional.sub.html: [{}] + element-a.sub.html: [{}] + element-area.sub.html: [{}] + form-submission.sub.html: + - method: GET + - method: POST + header-refresh.optional.sub.html: [{}] + script-module-import-dynamic.sub.html: [{}] + script-module-import-static.sub.html: [{}] + window-history.sub.html: [{}] + window-location.sub.html: [{}] diff --git a/test/fixtures/wpt/interfaces/compute-pressure.idl b/test/fixtures/wpt/interfaces/compute-pressure.idl index 77537feb106..92bcc6e55e7 100644 --- a/test/fixtures/wpt/interfaces/compute-pressure.idl +++ b/test/fixtures/wpt/interfaces/compute-pressure.idl @@ -3,7 +3,7 @@ // (https://github.com/w3c/webref) // Source: Compute Pressure Level 1 (https://w3c.github.io/compute-pressure/) -enum PressureSource { "thermals", "cpu" }; +enum PressureSource { "cpu" }; enum PressureState { "nominal", "fair", "serious", "critical" }; diff --git a/test/fixtures/wpt/interfaces/fedcm.idl b/test/fixtures/wpt/interfaces/fedcm.idl index c308ee273b9..16b5b2faf10 100644 --- a/test/fixtures/wpt/interfaces/fedcm.idl +++ b/test/fixtures/wpt/interfaces/fedcm.idl @@ -53,7 +53,9 @@ dictionary IdentityProviderRequestOptions : IdentityProviderConfig { }; dictionary IdentityProviderWellKnown { - required sequence provider_urls; + sequence provider_urls; + USVString accounts_endpoint; + USVString login_url; }; dictionary IdentityProviderIcon { diff --git a/test/fixtures/wpt/interfaces/gpc.idl b/test/fixtures/wpt/interfaces/gpc.idl new file mode 100644 index 00000000000..9a16904ce1e --- /dev/null +++ b/test/fixtures/wpt/interfaces/gpc.idl @@ -0,0 +1,10 @@ +// GENERATED CONTENT - DO NOT EDIT +// Content was automatically extracted by Reffy into webref +// (https://github.com/w3c/webref) +// Source: Global Privacy Control (GPC) (https://w3c.github.io/gpc/) + +interface mixin GlobalPrivacyControl { + readonly attribute boolean globalPrivacyControl; +}; +Navigator includes GlobalPrivacyControl; +WorkerNavigator includes GlobalPrivacyControl; diff --git a/test/fixtures/wpt/interfaces/html.idl b/test/fixtures/wpt/interfaces/html.idl index aefa95dbd82..d4f8b9a7680 100644 --- a/test/fixtures/wpt/interfaces/html.idl +++ b/test/fixtures/wpt/interfaces/html.idl @@ -2520,6 +2520,11 @@ interface MessageChannel { readonly attribute MessagePort port2; }; +interface mixin MessageEventTarget { + attribute EventHandler onmessage; + attribute EventHandler onmessageerror; +}; + [Exposed=(Window,Worker,AudioWorklet), Transferable] interface MessagePort : EventTarget { undefined postMessage(any message, sequence transfer); @@ -2528,11 +2533,11 @@ interface MessagePort : EventTarget { undefined close(); // event handlers - attribute EventHandler onmessage; - attribute EventHandler onmessageerror; attribute EventHandler onclose; }; +MessagePort includes MessageEventTarget; + dictionary StructuredSerializeOptions { sequence transfer = []; }; @@ -2571,11 +2576,10 @@ interface DedicatedWorkerGlobalScope : WorkerGlobalScope { undefined postMessage(any message, optional StructuredSerializeOptions options = {}); undefined close(); - - attribute EventHandler onmessage; - attribute EventHandler onmessageerror; }; +DedicatedWorkerGlobalScope includes MessageEventTarget; + [Global=(Worker,SharedWorker),Exposed=SharedWorker] interface SharedWorkerGlobalScope : WorkerGlobalScope { [Replaceable] readonly attribute DOMString name; @@ -2597,8 +2601,6 @@ interface Worker : EventTarget { undefined postMessage(any message, sequence transfer); undefined postMessage(any message, optional StructuredSerializeOptions options = {}); - attribute EventHandler onmessage; - attribute EventHandler onmessageerror; }; dictionary WorkerOptions { @@ -2610,6 +2612,7 @@ dictionary WorkerOptions { enum WorkerType { "classic", "module" }; Worker includes AbstractWorker; +Worker includes MessageEventTarget; [Exposed=Window] interface SharedWorker : EventTarget { diff --git a/test/fixtures/wpt/interfaces/long-animation-frames.idl b/test/fixtures/wpt/interfaces/long-animation-frames.idl index 79a42ca8f0a..de0d7c9a66a 100644 --- a/test/fixtures/wpt/interfaces/long-animation-frames.idl +++ b/test/fixtures/wpt/interfaces/long-animation-frames.idl @@ -19,6 +19,8 @@ interface PerformanceLongAnimationFrameTiming : PerformanceEntry { [Default] object toJSON(); }; +PerformanceLongAnimationFrameTiming includes PaintTimingMixin; + enum ScriptInvokerType { "classic-script", "module-script", diff --git a/test/fixtures/wpt/interfaces/mediacapture-surface-control.idl b/test/fixtures/wpt/interfaces/mediacapture-surface-control.idl new file mode 100644 index 00000000000..b0bbd22304f --- /dev/null +++ b/test/fixtures/wpt/interfaces/mediacapture-surface-control.idl @@ -0,0 +1,16 @@ +// GENERATED CONTENT - DO NOT EDIT +// Content was automatically extracted by Reffy into webref +// (https://github.com/w3c/webref) +// Source: Captured Surface Control (https://w3c.github.io/mediacapture-surface-control/) + +partial interface CaptureController { + sequence getSupportedZoomLevels(); + long getZoomLevel(); + Promise setZoomLevel(long zoomLevel); + attribute EventHandler oncapturedzoomlevelchange; +}; + +partial interface CaptureController { + constructor(); + Promise forwardWheel(HTMLElement element); +}; diff --git a/test/fixtures/wpt/interfaces/sanitizer-api.idl b/test/fixtures/wpt/interfaces/sanitizer-api.idl index 8f5c667973a..47c6d12fab0 100644 --- a/test/fixtures/wpt/interfaces/sanitizer-api.idl +++ b/test/fixtures/wpt/interfaces/sanitizer-api.idl @@ -9,9 +9,22 @@ dictionary SetHTMLOptions { [Exposed=(Window,Worker)] interface Sanitizer { - constructor(optional SanitizerConfig config = {}); + constructor(optional SanitizerConfig configuration = {}); + + // Query configuration: SanitizerConfig get(); - SanitizerConfig getUnsafe(); + + // Modify a Sanitizer’s lists and fields: + undefined allowElement(SanitizerElementWithAttributes element); + undefined removeElement(SanitizerElement element); + undefined replaceElementWithChildren(SanitizerElement element); + undefined allowAttribute(SanitizerAttribute attribute); + undefined removeAttribute(SanitizerAttribute attribute); + undefined setComments(boolean allow); + undefined setDataAttributes(boolean allow); + + // Remove markup that executes script. May modify multiple lists: + undefined removeUnsafe(); }; dictionary SanitizerElementNamespace { diff --git a/test/fixtures/wpt/interfaces/vibration.idl b/test/fixtures/wpt/interfaces/vibration.idl index 22ab1c47df0..175d240d10d 100644 --- a/test/fixtures/wpt/interfaces/vibration.idl +++ b/test/fixtures/wpt/interfaces/vibration.idl @@ -1,7 +1,7 @@ // GENERATED CONTENT - DO NOT EDIT // Content was automatically extracted by Reffy into webref // (https://github.com/w3c/webref) -// Source: Vibration API (Second Edition) (https://w3c.github.io/vibration/) +// Source: Vibration API (https://w3c.github.io/vibration/) typedef (unsigned long or sequence) VibratePattern; diff --git a/test/fixtures/wpt/interfaces/webnn.idl b/test/fixtures/wpt/interfaces/webnn.idl index 112fa2bf832..132280b05f8 100644 --- a/test/fixtures/wpt/interfaces/webnn.idl +++ b/test/fixtures/wpt/interfaces/webnn.idl @@ -32,17 +32,18 @@ interface ML { Promise createContext(GPUDevice gpuDevice); }; -typedef record MLNamedArrayBufferViews; - -dictionary MLComputeResult { - MLNamedArrayBufferViews inputs; - MLNamedArrayBufferViews outputs; -}; +typedef record MLNamedTensors; [SecureContext, Exposed=(Window, DedicatedWorker)] interface MLContext { - Promise compute( - MLGraph graph, MLNamedArrayBufferViews inputs, MLNamedArrayBufferViews outputs); + undefined dispatch(MLGraph graph, MLNamedTensors inputs, MLNamedTensors outputs); + + Promise createTensor(MLTensorDescriptor descriptor); + + Promise readTensor(MLTensor tensor); + Promise readTensor(MLTensor tensor, AllowSharedBufferSource outputData); + + undefined writeTensor(MLTensor tensor, AllowSharedBufferSource inputData); MLOpSupportLimits opSupportLimits(); }; @@ -105,6 +106,21 @@ dictionary MLOperatorOptions { typedef (bigint or unrestricted double) MLNumber; +dictionary MLTensorDescriptor : MLOperandDescriptor { + boolean readable = false; + boolean writable = false; +}; + +[SecureContext, Exposed=(Window, DedicatedWorker)] +interface MLTensor { + readonly attribute MLOperandDataType dataType; + readonly attribute FrozenArray shape; + readonly attribute boolean readable; + readonly attribute boolean writable; + + undefined destroy(); +}; + typedef record MLNamedOperands; [SecureContext, Exposed=(Window, DedicatedWorker)] @@ -116,7 +132,8 @@ interface MLGraphBuilder { MLOperand input(USVString name, MLOperandDescriptor descriptor); // Create an operand for a graph constant. - MLOperand constant(MLOperandDescriptor descriptor, ArrayBufferView bufferView); + MLOperand constant(MLOperandDescriptor descriptor, + AllowSharedBufferSource buffer); // Create a scalar operand from the specified number of the specified type. MLOperand constant(MLOperandDataType type, MLNumber value); diff --git a/test/fixtures/wpt/resources/idlharness-shadowrealm.js b/test/fixtures/wpt/resources/idlharness-shadowrealm.js deleted file mode 100644 index b959ca00e83..00000000000 --- a/test/fixtures/wpt/resources/idlharness-shadowrealm.js +++ /dev/null @@ -1,52 +0,0 @@ -/* global shadowRealmEvalAsync */ - -// requires /resources/idlharness-shadowrealm-outer.js - -// TODO: it would be nice to support `idl_array.add_objects` -function fetch_text(url) { - return fetch(url).then(function (r) { - if (!r.ok) { - throw new Error("Error fetching " + url + "."); - } - return r.text(); - }); -} - -/** - * idl_test_shadowrealm is a promise_test wrapper that handles the fetching of the IDL, and - * running the code in a `ShadowRealm`, avoiding repetitive boilerplate. - * - * @see https://github.com/tc39/proposal-shadowrealm - * @param {String[]} srcs Spec name(s) for source idl files (fetched from - * /interfaces/{name}.idl). - * @param {String[]} deps Spec name(s) for dependency idl files (fetched - * from /interfaces/{name}.idl). Order is important - dependencies from - * each source will only be included if they're already know to be a - * dependency (i.e. have already been seen). - */ -function idl_test_shadowrealm(srcs, deps) { - promise_setup(async t => { - const realm = new ShadowRealm(); - const specs = await Promise.all(srcs.concat(deps).map(spec => { - return fetch_text("/interfaces/" + spec + ".idl"); - })); - const idls = JSON.stringify(specs); - await shadowRealmEvalAsync(realm, ` - await import("/resources/testharness-shadowrealm-inner.js"); - await import("/resources/testharness.js"); - await import("/resources/WebIDLParser.js"); - await import("/resources/idlharness.js"); - const idls = ${idls}; - const idl_array = new IdlArray(); - for (let i = 0; i < ${srcs.length}; i++) { - idl_array.add_idls(idls[i]); - } - for (let i = ${srcs.length}; i < ${srcs.length + deps.length}; i++) { - idl_array.add_dependency_idls(idls[i]); - } - idl_array.test(); - `); - await fetch_tests_from_shadow_realm(realm); - }); -} -// vim: set expandtab shiftwidth=4 tabstop=4 foldmarker=@{,@} foldmethod=marker: diff --git a/test/fixtures/wpt/resources/idlharness.js b/test/fixtures/wpt/resources/idlharness.js index 4cf19234af2..d52ba9fd3c4 100644 --- a/test/fixtures/wpt/resources/idlharness.js +++ b/test/fixtures/wpt/resources/idlharness.js @@ -734,7 +734,7 @@ IdlArray.prototype.test = function() Object.getOwnPropertyNames(this.members).forEach(function(memberName) { var member = this.members[memberName]; - if (!(member instanceof IdlInterface)) { + if (!(member instanceof IdlInterface || member instanceof IdlNamespace)) { return; } @@ -1421,7 +1421,7 @@ IdlInterface.prototype.test = function() if (!this.untested) { subsetTestByKey(this.name, test, function() { - assert_false(this.name in self); + assert_false(this.name in self, this.name + " interface should not exist"); }.bind(this), this.name + " interface: existence and properties of interface object"); } return; @@ -3451,6 +3451,17 @@ IdlNamespace.prototype.test_self = function () IdlNamespace.prototype.test = function () { + // If the namespace object is not exposed, only test that. Members can't be + // tested either + if (!this.exposed) { + if (!this.untested) { + subsetTestByKey(this.name, test, function() { + assert_false(this.name in self, this.name + " namespace should not exist"); + }.bind(this), this.name + " namespace: existence and properties of namespace object"); + } + return; + } + if (!this.untested) { this.test_self(); } @@ -3498,7 +3509,7 @@ function idl_test(srcs, deps, idl_setup_func) { "require-exposed" ]; return Promise.all( - srcs.concat(deps).map(fetch_spec)) + srcs.concat(deps).map(globalThis.fetch_spec)) .then(function(results) { const astArray = results.map(result => WebIDL2.parse(result.idl, { sourceName: result.spec }) @@ -3539,9 +3550,11 @@ function idl_test(srcs, deps, idl_setup_func) { }); }, 'idl_test setup'); } +globalThis.idl_test = idl_test; /** * fetch_spec is a shorthand for a Promise that fetches the spec's content. + * Note: ShadowRealm-specific implementation in testharness-shadowrealm-inner.js */ function fetch_spec(spec) { var url = '/interfaces/' + spec + '.idl'; diff --git a/test/fixtures/wpt/resources/test/tests/functional/idlharness/IdlNamespace/test_operation.html b/test/fixtures/wpt/resources/test/tests/functional/idlharness/IdlNamespace/test_operation.html index da70c8fa31c..d7fe20a5a57 100644 --- a/test/fixtures/wpt/resources/test/tests/functional/idlharness/IdlNamespace/test_operation.html +++ b/test/fixtures/wpt/resources/test/tests/functional/idlharness/IdlNamespace/test_operation.html @@ -67,7 +67,12 @@ namespace baz { DOMString LongStory(any hero, DOMString... details); DOMString ShortStory(DOMString... details); -};`); +}; +[Exposed=Worker] +namespace Absent { + undefined Lies(); +}; +`); idlArray.test();