enabled-by-permission-policy-attribute-redirect-on-load.https.sub.html (2006B)
1 <!DOCTYPE html> 2 <body> 3 <script src="/resources/testharness.js"></script> 4 <script src="/resources/testharnessreport.js"></script> 5 <script src="/resources/testdriver.js?feature=bidi"></script> 6 <script src="/resources/testdriver-vendor.js"></script> 7 <script src="/permissions-policy/resources/permissions-policy.js"></script> 8 <script> 9 "use strict"; 10 11 const relative_path = 12 "/permissions-policy/resources/permissions-policy-geolocation.html"; 13 const base_src = "/permissions-policy/resources/redirect-on-load.html#"; 14 const same_origin_src = base_src + relative_path; 15 const cross_origin_src = `${base_src}https://{{hosts[alt][]}}:{{ports[https][0]}}${relative_path}`; 16 17 // Grant permission to outer frame 18 promise_setup(async () => { 19 await test_driver.bidi.permissions.set_permission({ 20 descriptor: { name: "geolocation" }, state: "granted" 21 }); 22 await test_driver.bidi.emulation.set_geolocation_override({ 23 coordinates: { 24 latitude: 52.51, 25 longitude: 13.39, 26 accuracy: 0.5, 27 altitude: 34, 28 altitudeAccuracy: 0.75, 29 heading: 180, 30 speed: 2.77 31 } 32 }); 33 }); 34 35 promise_test(async (test) => { 36 await test_feature_availability({ 37 feature_description: "Geolocation", 38 test, 39 src: same_origin_src, 40 expect_feature_available: expect_feature_available_default, 41 is_promise_test: true, 42 feature_name: "geolocation", 43 }); 44 }, 'Permissions-Policy allow="geolocation" allows same-origin redirection'); 45 46 promise_test(async (test) => { 47 await test_feature_availability({ 48 feature_description: "Geolocation", 49 test, 50 src: cross_origin_src, 51 expect_feature_available: expect_feature_available_default, 52 is_promise_test: true, 53 feature_name: "geolocation", 54 }); 55 }, 'Permissions-Policy allow="geolocation" allows cross-origin redirection'); 56 </script> 57 </body>