Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(790)

Side by Side Diff: third_party/WebKit/LayoutTests/external/wpt/webusb/usbDevice.https.html

Issue 2789723003: Migrate WebUSB LayoutTests into external/wpt (Closed)
Patch Set: Add README.md and more comments explaining the polyfill Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698