Upstreaming browser/ui/uikit_ui_util from iOS.
[chromium-blink-merge.git] / extensions / test / data / api_test / usb / device_handling / test.js
blob9bcc2d4132aedc756ffb0bf0ce0e8013d49b983d
1 // Copyright (c) 2012 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 usb = chrome.usb;
7 function getDevices() {
8 usb.getDevices({
9 vendorId: 0,
10 productId: 0
11 }, function(devices) {
12 usb.openDevice(devices[0], function(handle) {
13 usb.closeDevice(handle);
14 chrome.test.succeed();
15 });
16 });
19 function explicitCloseDevice() {
20 usb.findDevices({
21 vendorId: 0,
22 productId: 0
23 }, function(devices) {
24 usb.closeDevice(devices[0]);
25 chrome.test.succeed();
26 });
29 chrome.test.runTests([
30 getDevices, explicitCloseDevice
31 ]);