diff options
Diffstat (limited to 'testing/web-platform/tests/webusb/usbIsochronousOutTransferPacket.https.any.js')
-rw-r--r-- | testing/web-platform/tests/webusb/usbIsochronousOutTransferPacket.https.any.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/testing/web-platform/tests/webusb/usbIsochronousOutTransferPacket.https.any.js b/testing/web-platform/tests/webusb/usbIsochronousOutTransferPacket.https.any.js new file mode 100644 index 0000000000..2747a6fa0a --- /dev/null +++ b/testing/web-platform/tests/webusb/usbIsochronousOutTransferPacket.https.any.js @@ -0,0 +1,21 @@ +'use strict'; + +test(t => { + let packet = new USBIsochronousOutTransferPacket('ok', 42); + assert_equals(packet.status, 'ok'); + assert_equals(packet.bytesWritten, 42); + + packet = new USBIsochronousOutTransferPacket('stall'); + assert_equals(packet.status, 'stall'); + assert_equals(packet.bytesWritten, 0); +}, 'Can construct USBIsochronousOutTransferPacket'); + +test(t => { + assert_throws_js(TypeError, () => { + new USBIsochronousOutTransferPacket('invalid_status'); + }); +}, 'Cannot construct USBIsochronousOutTransferPacket with an invalid status'); + +test(t => { + assert_throws_js(TypeError, () => new USBIsochronousOutTransferPacket()); +}, 'Cannot construct USBIsochronousOutTransferPacket without a status'); |