bluetooth-allowed-by-permissions-policy-attribute-redirect-on-load.https.sub.html (1244B)
1 <!DOCTYPE html> 2 <body> 3 <script src=/resources/testharness.js></script> 4 <script src=/resources/testharnessreport.js></script> 5 <script src=/bluetooth/resources/bluetooth-test.js></script> 6 <script src=/permissions-policy/resources/permissions-policy.js></script> 7 <script> 8 'use strict' 9 10 const relative_path = '/permissions-policy/resources/permissions-policy-bluetooth.html'; 11 const base_src = '/permissions-policy/resources/redirect-on-load.html#'; 12 const same_origin_src = base_src + relative_path; 13 const cross_origin_src = base_src + 'https://{{domains[www]}}:{{ports[https][0]}}' + relative_path; 14 const feature_name = 'permissions policy "bluetooth"'; 15 const header = 'permissions policy allow="bluetooth"'; 16 17 bluetooth_test(() => { 18 async_test(t => { 19 test_feature_availability('bluetooth.getDevices()', t, same_origin_src, expect_feature_available_default, 'bluetooth'); 20 }, header + ' allows same-origin navigation in an iframe.'); 21 22 async_test(t => { 23 test_feature_availability('bluetooth.getDevices()', t, cross_origin_src, expect_feature_unavailable_default, 'bluetooth'); 24 }, header + ' disallows cross-origin navigation in an iframe.'); 25 }); 26 </script> 27 </body>