usb-default-permissions-policy.https.sub.html (927B)
1 <!DOCTYPE html> 2 <body> 3 <script src=/resources/testharness.js></script> 4 <script src=/resources/testharnessreport.js></script> 5 <script src=/permissions-policy/resources/permissions-policy.js></script> 6 <script> 7 'use strict'; 8 var same_origin_src = '/permissions-policy/resources/permissions-policy-usb.html'; 9 var cross_origin_src = 'https://{{domains[www]}}:{{ports[https][0]}}' + 10 same_origin_src; 11 var header = 'Default "usb" permissions policy ["self"]'; 12 13 promise_test( 14 () => navigator.usb.getDevices(), 15 header + ' allows the top-level document.'); 16 17 async_test(t => { 18 test_feature_availability('usb.getDevices()', t, same_origin_src, 19 expect_feature_available_default); 20 }, header + ' allows same-origin iframes.'); 21 22 async_test(t => { 23 test_feature_availability('usb.getDevices()', t, cross_origin_src, 24 expect_feature_unavailable_default); 25 }, header + ' disallows cross-origin iframes.'); 26 </script> 27 </body>