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

Unified Diff: third_party/WebKit/LayoutTests/usb/getDevices.html

Issue 1472693004: [Do not commit] Sample USB layout tests with Mojo service mocks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@usb-testing-4
Patch Set: rebase Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/usb/getDevices.html
diff --git a/third_party/WebKit/LayoutTests/usb/getDevices.html b/third_party/WebKit/LayoutTests/usb/getDevices.html
new file mode 100644
index 0000000000000000000000000000000000000000..2091a786a234d96526dd2dc2a33b9e149256e4dd
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/usb/getDevices.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<script src="../resources/mojo-helpers.js"></script>
+<script src="resources/device.mojom.js"></script>
+<script src="resources/device_manager.mojom.js"></script>
+<script src="resources/permission_provider.mojom.js"></script>
+<script src="resources/fake-devices.js"></script>
+<script src="resources/usb-helpers.js"></script>
+<script>
+'use strict';
+
+usb_test(usb => {
+ usb.mockDeviceManager.addMockDevice(FAKE_PRINTER);
+
+ return navigator.usb.getDevices().then(devices => {
+ assert_equals(devices.length, 1);
+ assert_device_info_equals(devices[0], FAKE_PRINTER);
+ });
+}, 'getDevices returns devices exposed by the DeviceManager service.');
+</script>
« no previous file with comments | « third_party/WebKit/LayoutTests/usb/getDevice.html ('k') | third_party/WebKit/LayoutTests/usb/mock-services.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698