trisquel-icecat/icecat/testing/web-platform/tests/client-hints/permissions-policy/ch-ua-high-entropy-values-default-permissions-policy.https.sub.html
2025-10-06 02:35:48 -06: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>