OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <script src="../resources/testharness.js"></script> | 2 <script src="/resources/testharness.js"></script> |
3 <script src="../resources/testharnessreport.js"></script> | 3 <script src="/resources/testharnessreport.js"></script> |
4 <script> | 4 <script> |
5 'use strict'; | 5 'use strict'; |
6 | 6 |
7 test(t => { | 7 test(t => { |
8 let packet = new USBIsochronousOutTransferPacket('ok', 42); | 8 let packet = new USBIsochronousOutTransferPacket('ok', 42); |
9 assert_equals(packet.status, 'ok'); | 9 assert_equals(packet.status, 'ok'); |
10 assert_equals(packet.bytesWritten, 42); | 10 assert_equals(packet.bytesWritten, 42); |
11 | 11 |
12 packet = new USBIsochronousOutTransferPacket('stall'); | 12 packet = new USBIsochronousOutTransferPacket('stall'); |
13 assert_equals(packet.status, 'stall'); | 13 assert_equals(packet.status, 'stall'); |
14 assert_equals(packet.bytesWritten, 0); | 14 assert_equals(packet.bytesWritten, 0); |
15 }, 'Can construct USBIsochronousOutTransferPacket'); | 15 }, 'Can construct USBIsochronousOutTransferPacket'); |
16 | 16 |
17 test(t => { | 17 test(t => { |
18 assert_throws(TypeError(), () => { | 18 assert_throws(TypeError(), () => { |
19 new USBIsochronousOutTransferPacket('invalid_status'); | 19 new USBIsochronousOutTransferPacket('invalid_status'); |
20 }); | 20 }); |
21 }, 'Cannot construct USBIsochronousOutTransferPacket with an invalid status'); | 21 }, 'Cannot construct USBIsochronousOutTransferPacket with an invalid status'); |
22 | 22 |
23 test(t => { | 23 test(t => { |
24 assert_throws(TypeError(), () => new USBIsochronousOutTransferPacket()); | 24 assert_throws(TypeError(), () => new USBIsochronousOutTransferPacket()); |
25 }, 'Cannot construct USBIsochronousOutTransferPacket without a status'); | 25 }, 'Cannot construct USBIsochronousOutTransferPacket without a status'); |
26 </script> | 26 </script> |
OLD | NEW |