gamepad-default-feature-policy.https.sub.html (1275B)
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 src=util/utils.js></script> 7 <script> 8 "use strict"; 9 const relative_path = "/gamepad/feature-policy-gamepad.html"; 10 const base_src = "/feature-policy/resources/redirect-on-load.html#"; 11 const sub = "https://{{domains[www]}}:{{ports[https][0]}}"; 12 const same_origin_src = base_src + relative_path; 13 const cross_origin_src = sub + relative_path; 14 const header = 'Feature-Policy allow="gamepad"'; 15 16 async_test((t) => { 17 test_feature_availability( 18 "getGamepads()", 19 t, 20 same_origin_src, 21 expect_feature_available_default 22 ); 23 }, header + " allows same-origin by default."); 24 25 async_test((t) => { 26 test_feature_availability( 27 "getGamepads()", 28 t, 29 cross_origin_src, 30 expect_feature_available_default, 31 "gamepad" 32 ); 33 }, header + " allows cross-origin with feature allowed."); 34 35 async_test((t) => { 36 test_feature_availability( 37 "getGamepads()", 38 t, 39 cross_origin_src, 40 expect_feature_available_default 41 ); 42 }, header + " allows cross-origin by default."); 43 </script> 44 </body>