summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/webusb/requestDevice/reject_opaque_origin.https.html
blob: 34798ce2b1d4c4434e6b0a8e2a08701b31edb544 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<!DOCTYPE html>

<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
  'use strict';

  promise_test(async (t) => {
    await promise_rejects_dom(
        t, 'SecurityError', navigator.usb.requestDevice({filters:[]}),
        'requestDevice() should throw a SecurityError DOMException when ' +
        'called from a context where the top-level document has an opaque ' +
        'origin.');
  }, 'Calls to USB APIs from an origin with opaque top origin get blocked.');
</script>