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 | 7 |
8 test(t => { | 8 test(t => { |
9 let data_view = new DataView(Uint8Array.from([1, 2, 3, 4]).buffer); | 9 let data_view = new DataView(Uint8Array.from([1, 2, 3, 4]).buffer); |
10 let packet_data_view = new DataView(data_view.buffer); | 10 let packet_data_view = new DataView(data_view.buffer); |
11 let packets = [ | 11 let packets = [ |
12 new USBIsochronousInTransferPacket('ok', packet_data_view), | 12 new USBIsochronousInTransferPacket('ok', packet_data_view), |
13 new USBIsochronousInTransferPacket('stall') | 13 new USBIsochronousInTransferPacket('stall') |
(...skipping 19 matching lines...) Expand all Loading... |
33 assert_equals(result.packets[0].status, 'stall'); | 33 assert_equals(result.packets[0].status, 'stall'); |
34 assert_equals(result.packets[0].data, null); | 34 assert_equals(result.packets[0].data, null); |
35 assert_equals(result.packets[1].status, 'stall'); | 35 assert_equals(result.packets[1].status, 'stall'); |
36 assert_equals(result.packets[1].data, null); | 36 assert_equals(result.packets[1].data, null); |
37 }, 'Can construct a USBIsochronousInTransferResult without a DataView'); | 37 }, 'Can construct a USBIsochronousInTransferResult without a DataView'); |
38 | 38 |
39 test(t => { | 39 test(t => { |
40 assert_throws(TypeError(), () => new USBIsochronousInTransferResult()); | 40 assert_throws(TypeError(), () => new USBIsochronousInTransferResult()); |
41 }, 'Cannot construct a USBIsochronousInTransferResult without packets'); | 41 }, 'Cannot construct a USBIsochronousInTransferResult without packets'); |
42 </script> | 42 </script> |
OLD | NEW |