summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/webusb/insecure-context.any.js
blob: 962738987bf41f1005e99b0beb5a0de33a8d7935 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
'use strict';

test(() => {
  assert_false(isSecureContext);
  assert_false('usb' in navigator);
}, '"usb" should not be present on navigator in an insecure context.');

[
    'USB', 'USBAlternateInterface', 'USBConfiguration', 'USBConnectionEvent',
    'USBDevice', 'USBEndpoint', 'USBInterface', 'USBInTransferResult',
    'USBOutTransferResult', 'USBIsochronousInTransferResult',
    'USBIsochronousOutTransferResult', 'USBIsochronousInTransferPacket',
    'USBIsochronousOutTransferPacket',
].forEach((symbol) => {
  test(() => {
    assert_false(isSecureContext);
    assert_false(symbol in this)
  }, '"' + symbol + '" should not be visible in an insecure context.');
});

done();