reject_opaque_origin.https.html (514B)
1 <!DOCTYPE html> 2 3 <script src="/resources/testharness.js"></script> 4 <script src="/resources/testharnessreport.js"></script> 5 <script> 6 'use strict'; 7 8 promise_test(async (t) => { 9 await promise_rejects_dom( 10 t, 'SecurityError', navigator.serial.getPorts(), 11 'getPorts() should throw a SecurityError DOMException when called ' + 12 'from a context where the top-level document has an opaque origin.'); 13 }, 'Calls to Serial APIs from an origin with opaque top origin get blocked.'); 14 </script>