ch-ua-high-entropy-values-enabled-by-permissions-policy.https.sub.html (1724B)
1 <!DOCTYPE html> 2 <body> 3 <script src="/resources/testharness.js"></script> 4 <script src="/resources/testharnessreport.js"></script> 5 <script src="../../permissions-policy/resources/permissions-policy.js"></script> 6 <script> 7 const same_origin_src = 8 "/permissions-policy/resources/permissions-policy-ch-ua-high-entropy-values.html"; 9 const cross_origin_src = 10 "https://{{hosts[alt][]}}:{{ports[https][0]}}" + same_origin_src; 11 const header = 'Permissions policy header "ch-ua-high-entropy-values=*"'; 12 13 promise_test(async () => { 14 return navigator.userAgentData.getHighEntropyValues(["bitness"]).then( 15 hints => { 16 assert_own_property(hints, "brands"); 17 assert_own_property(hints, "mobile"); 18 assert_own_property(hints, "platform"); 19 assert_own_property(hints, "bitness"); 20 } 21 ); 22 }, `${header} allows high-entropy values via getHighEntropyValues() in top-level document.`); 23 24 async_test((test) => { 25 return test_feature_availability({ 26 feature_description: "navigator.userAgentData.getHighEntropyValues()", 27 test, 28 src: same_origin_src, 29 expect_feature_available: expect_feature_available_default, 30 }); 31 }, `${header} allows high-entropy values via getHighEntropyValues() in same-origin iframes.`); 32 33 async_test((test) => { 34 return test_feature_availability({ 35 feature_description: "navigator.userAgentData.getHighEntropyValues()", 36 test, 37 src: cross_origin_src, 38 expect_feature_available: expect_feature_available_default, 39 }); 40 }, `${header} allows high-entropy values via getHighEntropyValues() in cross-origin iframes.`); 41 </script> 42 </body>