Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / extensions / test / data / api_test / usb / remove_event / background.js
blob6c6bbb53b909e8bb40d15a911ef3d188efbe7325
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 var known_devices = {};
7 chrome.usb.onDeviceRemoved.addListener(function(device) {
8 if (device.device in known_devices) {
9 chrome.test.sendMessage("success");
10 } else {
11 console.error("Unexpected device removed: " + device.device);
12 chrome.test.sendMessage("failure");
14 });
16 chrome.usb.getDevices({}, function(devices) {
17 for (var device of devices) {
18 known_devices[device.device] = device;
20 chrome.test.sendMessage("loaded");
21 });