default-enabled-features-allow-none.https.html (1915B)
1 <!DOCTYPE html> 2 <title>Test default permission policy features gating ()</title> 3 <script src="/resources/testharness.js"></script> 4 <script src="/resources/testharnessreport.js"></script> 5 <script src="/common/utils.js"></script> 6 <script src="/common/dispatcher/dispatcher.js"></script> 7 <script src="resources/utils.js"></script> 8 <script src="/common/get-host-info.sub.js"></script> 9 <script src="resources/default-enabled-features-helper.js"></script> 10 11 <body> 12 <script> 13 // Note: Shared storage will refuse to run selectURL() on this page because its 14 // permissions policy is disabled. Therefore, we can only test the FLEDGE case. 15 promise_test(async(t) => { 16 await runDefaultEnabledFeaturesTest(t, false, get_host_info().ORIGIN); 17 }, 'Same-origin fenced frame does not load when feature policies are none'); 18 19 promise_test(async(t) => { 20 await runDefaultEnabledFeaturesTest(t, false, get_host_info().REMOTE_ORIGIN); 21 }, 'Cross-origin fenced frame does not load when feature policies are none'); 22 23 promise_test(async(t) => { 24 const fencedframe = await attachFencedFrameContext({ 25 origin: get_host_info().REMOTE_ORIGIN}); 26 27 await fencedframe.execute(async () => { 28 assert_false( 29 document.featurePolicy.allowsFeature('shared-storage'), 30 "Shared storage should be disallowed in the fenced frame."); 31 assert_false( 32 document.featurePolicy.allowsFeature('private-aggregation'), 33 "Private aggregation should be disallowed in the fenced frame."); 34 assert_false( 35 document.featurePolicy.allowsFeature('attribution-reporting'), 36 "Attribution reporting should be disallowed in the fenced frame."); 37 assert_false( 38 document.featurePolicy.allowsFeature('sync-xhr'), 39 "USB access should be disallowed in the fenced frame."); 40 }, []); 41 }, 'Flexible permissions fenced frames can have permissions restricted from ' + 42 'parent.'); 43 44 </script> 45 </body> 46 </html>