1
0
Fork 0
firefox/testing/web-platform/tests/client-hints/permissions-policy/ch-ua-high-entropy-values-default-permissions-policy.https.sub.html
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02:00

42 lines
No EOL
1.7 KiB
HTML

<!DOCTYPE html>
<body>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../../permissions-policy/resources/permissions-policy.js"></script>
<script>
const same_origin_src =
"/permissions-policy/resources/permissions-policy-ch-ua-high-entropy-values.html";
const cross_origin_src =
"https://{{hosts[alt][]}}:{{ports[https][0]}}" + same_origin_src;
const header = 'Permissions policy header "ch-ua-high-entropy-values=*"';
promise_test(async () => {
return navigator.userAgentData.getHighEntropyValues(["bitness"]).then(
hints => {
assert_own_property(hints, "brands");
assert_own_property(hints, "mobile");
assert_own_property(hints, "platform");
assert_own_property(hints, "bitness");
}
);
}, `high-entropy values via getHighEntropyValues() allowed by default in top-level document.`);
async_test((test) => {
return test_feature_availability({
feature_description: "navigator.userAgentData.getHighEntropyValues()",
test,
src: same_origin_src,
expect_feature_available: expect_feature_available_default,
});
}, `high-entropy values via getHighEntropyValues() allowed by default in same-origin iframes.`);
async_test((test) => {
return test_feature_availability({
feature_description: "navigator.userAgentData.getHighEntropyValues()",
test,
src: cross_origin_src,
expect_feature_available: expect_feature_available_default,
});
}, `high-entropy values via getHighEntropyValues() allowed by default in cross-origin iframes.`);
</script>
</body>