permissions-policy-feature-policy-coexist.https.html (843B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <script src=/resources/testharness.js> </script> 4 <script src=/resources/testharnessreport.js> </script> 5 <div> 6 This is a page with following headers: <br> 7 <div> 8 Feature-Policy: geolocation 'none', fullscreen 'none'<br> 9 Permissions-Policy: geolocation=self, payment=() 10 </div> 11 </div> 12 <script> 13 const policy = document.featurePolicy; 14 test(() => { 15 assert_true(policy.allowsFeature('geolocation')); 16 }, "When there is conflict in Feature Policy header and Permissions Policy" + 17 "header, Permissions Policy wins."); 18 19 test(() => { 20 assert_false(policy.allowsFeature('fullscreen')); 21 assert_false(policy.allowsFeature('payment')); 22 }, "When there is no conflict, Feature Policy and Permissions Policy should " + 23 "all be able to control each feature by themselves."); 24 </script>