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

Unified Diff: third_party/WebKit/LayoutTests/usb/resources/usb-helpers.js

Issue 1754543003: Add WebUSB layout tests for device disconnection. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addresses rockot@'s nits. Created 4 years, 10 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
« no previous file with comments | « content/renderer/usb/web_usb_device_impl.cc ('k') | third_party/WebKit/LayoutTests/usb/usb.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/usb/resources/usb-helpers.js
diff --git a/third_party/WebKit/LayoutTests/usb/resources/usb-helpers.js b/third_party/WebKit/LayoutTests/usb/resources/usb-helpers.js
index 4ea82a82f85afdf09ba9efc55d07332c696157d0..d11c38eae1ba0c972a94eade04e94e7c22ee853a 100644
--- a/third_party/WebKit/LayoutTests/usb/resources/usb-helpers.js
+++ b/third_party/WebKit/LayoutTests/usb/resources/usb-helpers.js
@@ -371,7 +371,9 @@ function usbMocks(mojo) {
getDevice(guid, pipe) {
let device = this.mockDevices_.get(guid);
- if (device !== undefined) {
+ if (device === undefined) {
+ mojo.core.close(pipe);
+ } else {
var mock = new MockDevice(device.info, pipe);
device.handles.push(mock);
}
« no previous file with comments | « content/renderer/usb/web_usb_device_impl.cc ('k') | third_party/WebKit/LayoutTests/usb/usb.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698