summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/webusb/usbIsochronousOutTransferPacket.https.any.js
blob: 2747a6fa0a480f98f632c20dbd8e2d772cddd648 (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(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');