diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
commit | 26a029d407be480d791972afb5975cf62c9360a6 (patch) | |
tree | f435a8308119effd964b339f76abb83a57c29483 /testing/web-platform/tests/client-hints/accept-ch/feature-policy-navigation | |
parent | Initial commit. (diff) | |
download | firefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz firefox-26a029d407be480d791972afb5975cf62c9360a6.zip |
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/client-hints/accept-ch/feature-policy-navigation')
4 files changed, 67 insertions, 0 deletions
diff --git a/testing/web-platform/tests/client-hints/accept-ch/feature-policy-navigation/__dir__.headers b/testing/web-platform/tests/client-hints/accept-ch/feature-policy-navigation/__dir__.headers new file mode 100644 index 0000000000..4d4739028d --- /dev/null +++ b/testing/web-platform/tests/client-hints/accept-ch/feature-policy-navigation/__dir__.headers @@ -0,0 +1 @@ +Accept-CH: device-memory, dpr, width, viewport-width, rtt, downlink, ect, sec-ch-ua, sec-ch-ua-arch, sec-ch-ua-platform, sec-ch-ua-model, sec-ch-ua-mobile, sec-ch-ua-full-version, sec-ch-ua-platform-version, sec-ch-prefers-color-scheme, sec-ch-prefers-reduced-motion, sec-ch-ua-bitness, sec-ch-viewport-height, sec-ch-device-memory, sec-ch-dpr, sec-ch-width, sec-ch-viewport-width, sec-ch-ua-full-version-list, sec-ch-ua-wow64, sec-ch-prefers-reduced-transparency diff --git a/testing/web-platform/tests/client-hints/accept-ch/feature-policy-navigation/feature-policy.https.html b/testing/web-platform/tests/client-hints/accept-ch/feature-policy-navigation/feature-policy.https.html new file mode 100644 index 0000000000..90a27280c1 --- /dev/null +++ b/testing/web-platform/tests/client-hints/accept-ch/feature-policy-navigation/feature-policy.https.html @@ -0,0 +1,29 @@ +<html> +<body> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/get-host-info.sub.js"></script> +<script src="/client-hints/resources/export.js"></script> +<script src="/client-hints/resources/feature-policy-navigation.js"></script> +<script> +(async () => { + await test_frame( + "HTTPS_REMOTE_ORIGIN", + cross_origin_client_hints, + "", + "Client hints loaded on cross-origin iframe request with feature policy."); + await test_frame( + "HTTPS_ORIGIN", + same_origin_client_hints, + "", + "Client hints loaded on same-origin iframe request with feature policy."); + await test_frame( + "HTTPS_REMOTE_ORIGIN", + cross_origin_client_hints, + "", + "Client hints loaded on cross-origin iframe request with feature policy after attempting to set independently."); +})(); + +</script> +</body> +</html> diff --git a/testing/web-platform/tests/client-hints/accept-ch/feature-policy-navigation/feature-policy.https.html.headers b/testing/web-platform/tests/client-hints/accept-ch/feature-policy-navigation/feature-policy.https.html.headers new file mode 100644 index 0000000000..11bbceff0a --- /dev/null +++ b/testing/web-platform/tests/client-hints/accept-ch/feature-policy-navigation/feature-policy.https.html.headers @@ -0,0 +1 @@ +Permissions-Policy: ch-device-memory=*, ch-dpr=(), ch-viewport-width=(self), ch-ua=(self), ch-ua-mobile=() diff --git a/testing/web-platform/tests/client-hints/accept-ch/feature-policy-navigation/no-feature-policy.https.html b/testing/web-platform/tests/client-hints/accept-ch/feature-policy-navigation/no-feature-policy.https.html new file mode 100644 index 0000000000..02458f3116 --- /dev/null +++ b/testing/web-platform/tests/client-hints/accept-ch/feature-policy-navigation/no-feature-policy.https.html @@ -0,0 +1,36 @@ +<html> +<body> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/get-host-info.sub.js"></script> +<script src="/client-hints/resources/export.js"></script> +<script src="/client-hints/resources/feature-policy-navigation.js"></script> +<script> +(async () => { + await test_frame( + "HTTPS_REMOTE_ORIGIN", + expect_iframe_no_hints, + "", + "Client hints not loaded on cross-origin iframe request with no feature policy."); + await test_frame( + "HTTPS_ORIGIN", + expect_iframe_hints, + "", + "Client hints loaded on same-origin iframe request with no feature policy."); + + let allow = "ch-device-memory *; ch-dpr 'none'; ch-viewport-width 'self'; ch-ua 'self'; ch-ua-mobile 'none';"; await test_frame( + "HTTPS_REMOTE_ORIGIN", + cross_origin_client_hints, + allow, + "Client hints loaded on cross-origin iframe request with allow list."); + await test_frame( + "HTTPS_ORIGIN", + same_origin_client_hints, + allow, + "Client hints loaded on same-origin iframe request with allow list."); +})(); + +</script> +</body> +</html> + |