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

Unified Diff: extensions/test/data/api_test/usb/remove_event/background.js

Issue 800963005: Add browser tests for USB device add/remove events. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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: extensions/test/data/api_test/usb/remove_event/background.js
diff --git a/extensions/test/data/api_test/hid/remove_event/background.js b/extensions/test/data/api_test/usb/remove_event/background.js
similarity index 58%
copy from extensions/test/data/api_test/hid/remove_event/background.js
copy to extensions/test/data/api_test/usb/remove_event/background.js
index ea71668471e665c52e1350c51d52ac45ee69ad1a..22021ed4ec16e5d2b7be42beaac44629c183e983 100644
--- a/extensions/test/data/api_test/hid/remove_event/background.js
+++ b/extensions/test/data/api_test/usb/remove_event/background.js
@@ -4,18 +4,18 @@
var known_devices = {};
-chrome.hid.onDeviceRemoved.addListener(function (deviceId) {
- if (deviceId in known_devices) {
+chrome.usb.onDeviceRemoved.addListener(function (device) {
Yoyo Zhou 2015/01/21 06:57:43 ditto in this file
Reilly Grant (use Gerrit) 2015/01/22 00:45:01 Done.
+ if (device.device in known_devices) {
chrome.test.sendMessage("success");
} else {
- console.error("Unexpected device removed: " + device.deviceId);
+ console.error("Unexpected device removed: " + device.device);
chrome.test.sendMessage("failure");
}
});
-chrome.hid.getDevices({}, function (devices) {
+chrome.usb.getDevices({}, function (devices) {
for (var device of devices) {
- known_devices[device.deviceId] = device;
+ known_devices[device.device] = device;
}
chrome.test.sendMessage("loaded");
});

Powered by Google App Engine
This is Rietveld 408576698