diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
commit | 43a97878ce14b72f0981164f87f2e35e14151312 (patch) | |
tree | 620249daf56c0258faa40cbdcf9cfba06de2a846 /testing/web-platform/tests/client-hints/resources/export.js | |
parent | Initial commit. (diff) | |
download | firefox-43a97878ce14b72f0981164f87f2e35e14151312.tar.xz firefox-43a97878ce14b72f0981164f87f2e35e14151312.zip |
Adding upstream version 110.0.1.upstream/110.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/client-hints/resources/export.js')
-rw-r--r-- | testing/web-platform/tests/client-hints/resources/export.js | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/testing/web-platform/tests/client-hints/resources/export.js b/testing/web-platform/tests/client-hints/resources/export.js new file mode 100644 index 0000000000..68cea03ce4 --- /dev/null +++ b/testing/web-platform/tests/client-hints/resources/export.js @@ -0,0 +1,49 @@ +const client_hints_list = [ + "device-memory", + "dpr", + // "width", (only available for images) + "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", (Only available for images) + "sec-ch-viewport-width", + "sec-ch-ua-full-version-list", + "sec-ch-ua-wow64", +]; + +const client_hints_full_list = client_hints_list.concat(["width", "sec-ch-width"]) + +const default_on_client_hints = [ + "sec-ch-ua", + "sec-ch-ua-mobile", + "sec-ch-ua-platform", +]; + +const iframe_src = + "/client-hints/resources/expect-client-hints-headers-iframe.py?"; + +const expect_iframe_no_hints = iframe_src + + client_hints_list.map((e) => { + if(default_on_client_hints.includes(e)) { + return e+"=true"; + } else { + return e+"=false"; + } + }).join("&"); + +const expect_iframe_hints = iframe_src + + client_hints_list.map(e => e+"=true").join("&");
\ No newline at end of file |