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 src="resources/fake-devices.js"></script> | 4 <script src="resources/fake-devices.js"></script> |
5 <script src="resources/usb-helpers.js"></script> | 5 <script src="resources/usb-helpers.js"></script> |
6 <script src="resources/webusb-test.js"></script> | |
7 <script> | 6 <script> |
8 'use strict'; | 7 'use strict'; |
9 | 8 |
10 function assertRejectsWithNotFoundError(promise) { | 9 function assertRejectsWithNotFoundError(promise) { |
11 return assertRejectsWithError(promise, 'NotFoundError'); | 10 return assertRejectsWithError(promise, 'NotFoundError'); |
12 } | 11 } |
13 | 12 |
14 function assertRejectsWithNotOpenError(promise) { | 13 function assertRejectsWithNotOpenError(promise) { |
15 return assertRejectsWithError( | 14 return assertRejectsWithError( |
16 promise, 'InvalidStateError', 'The device must be opened first.') | 15 promise, 'InvalidStateError', 'The device must be opened first.') |
(...skipping 629 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
646 }, 'can reset the device'); | 645 }, 'can reset the device'); |
647 | 646 |
648 usb_test(() => { | 647 usb_test(() => { |
649 return getFakeDevice().then(({ device, fakeDevice }) => { | 648 return getFakeDevice().then(({ device, fakeDevice }) => { |
650 return device.open() | 649 return device.open() |
651 .then(() => waitForDisconnect(fakeDevice)) | 650 .then(() => waitForDisconnect(fakeDevice)) |
652 .then(() => assertRejectsWithNotFoundError(device.reset())); | 651 .then(() => assertRejectsWithNotFoundError(device.reset())); |
653 }); | 652 }); |
654 }, 'resetDevice rejects when called on a disconnected device'); | 653 }, 'resetDevice rejects when called on a disconnected device'); |
655 </script> | 654 </script> |
OLD | NEW |