webvr-enabled-by-feature-policy-attribute-redirect-on-load.https.sub.html (1054B)
1 <!DOCTYPE html> 2 <body> 3 <script src=/resources/testharness.js></script> 4 <script src=/resources/testharnessreport.js></script> 5 <script src=/feature-policy/resources/featurepolicy.js></script> 6 <script> 7 'use strict'; 8 var relative_path = '/feature-policy/resources/feature-policy-webvr.html'; 9 var base_src = '/feature-policy/resources/redirect-on-load.html#'; 10 var same_origin_src = base_src + relative_path; 11 var cross_origin_src = base_src + 'https://{{domains[www]}}:{{ports[https][0]}}' + 12 relative_path; 13 var header = 'Feature-Policy allow="vr" attribute'; 14 15 async_test(t => { 16 test_feature_availability( 17 'navigator.getVRDisplays()', t, same_origin_src, 18 expect_feature_available_default, 'vr'); 19 }, header + ' allows same-origin relocation'); 20 21 async_test(t => { 22 test_feature_availability( 23 'navigator.getVRDisplays()', t, cross_origin_src, 24 expect_feature_unavailable_default, 'vr'); 25 }, header + ' disallows cross-origin relocation'); 26 </script> 27 </body>