Skip to content

Commit

Permalink
Add [SecureContext] to additional WebUSB interfaces
Browse files Browse the repository at this point in the history
This change updates the WebUSB WebIDL files to match the recently merged
spec pull request #142 by hiding interfaces which aren't useful in
insecure contexts.

Change-Id: I98625b2634e452c775601525300672d9440ddbcc
  • Loading branch information
reillyeon authored and Chrome-bot committed Jul 14, 2018
1 parent 4638d8f commit cf8f819
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions webusb/insecure-context.any.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// META: global=sharedworker
'use strict';

test(() => {
assert_false('usb' in navigator);
assert_false('USB' in this);
assert_false('USBAlternateInterface' in this);
assert_false('USBConfiguration' in this);
assert_false('USBConnectionEvent' in this);
assert_false('USBDevice' in this);
assert_false('USBEndpoint' in this);
assert_false('USBInterface' in this);
assert_false('USBInTransferResult' in this);
assert_false('USBOutTransferResult' in this);
assert_false('USBIsochronousInTransferResult' in this);
assert_false('USBIsochronousOutTransferResult' in this);
assert_false('USBIsochronousInTransferPacket' in this);
assert_false('USBIsochronousOutTransferPacket' in this);
}, 'WebUSB is not available in an insecure context');

done();

0 comments on commit cf8f819

Please sign in to comment.