| 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 800 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 817 return navigator.usb.getDevices().then(devices => { | 816 return navigator.usb.getDevices().then(devices => { |
| 818 assert_equals(1, devices.length); | 817 assert_equals(1, devices.length); |
| 819 let device = devices[0]; | 818 let device = devices[0]; |
| 820 return device.open().then(() => { | 819 return device.open().then(() => { |
| 821 navigator.usb.test.removeFakeDevice(guid); | 820 navigator.usb.test.removeFakeDevice(guid); |
| 822 return assertRejectsWithNotFoundError(device.reset()); | 821 return assertRejectsWithNotFoundError(device.reset()); |
| 823 }); | 822 }); |
| 824 }); | 823 }); |
| 825 }, 'resetDevice rejects when called on a disconnected device'); | 824 }, 'resetDevice rejects when called on a disconnected device'); |
| 826 </script> | 825 </script> |
| OLD | NEW |