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

Side by Side Diff: extensions/test/data/api_test/usb/device_handling/test.js

Issue 1857033002: Include USB device version in chrome.usb.Device fields. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 4 years, 8 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 unified diff | Download patch
« no previous file with comments | « extensions/common/api/usb.idl ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 var usb = chrome.usb; 5 var usb = chrome.usb;
6 6
7 function getDevices() { 7 function getDevices() {
8 usb.getDevices({ 8 usb.getDevices({
9 vendorId: 0, 9 vendorId: 0,
10 productId: 0 10 productId: 0
11 }, function(devices) { 11 }, function(devices) {
12 chrome.test.assertEq(1, devices.length); 12 chrome.test.assertEq(1, devices.length);
13 var device = devices[0]; 13 var device = devices[0];
14 chrome.test.assertEq(0x0100, device.version);
14 chrome.test.assertEq("Test Device", device.productName); 15 chrome.test.assertEq("Test Device", device.productName);
15 chrome.test.assertEq("Test Manufacturer", device.manufacturerName); 16 chrome.test.assertEq("Test Manufacturer", device.manufacturerName);
16 chrome.test.assertEq("ABC123", device.serialNumber); 17 chrome.test.assertEq("ABC123", device.serialNumber);
17 usb.openDevice(device, function(handle) { 18 usb.openDevice(device, function(handle) {
18 chrome.test.assertNoLastError(); 19 chrome.test.assertNoLastError();
19 usb.closeDevice(handle); 20 usb.closeDevice(handle);
20 chrome.test.succeed(); 21 chrome.test.succeed();
21 }); 22 });
22 }); 23 });
23 } 24 }
(...skipping 20 matching lines...) Expand all
44 productId: 0 45 productId: 0
45 }, function(devices) { 46 }, function(devices) {
46 usb.closeDevice(devices[0]); 47 usb.closeDevice(devices[0]);
47 chrome.test.succeed(); 48 chrome.test.succeed();
48 }); 49 });
49 } 50 }
50 51
51 chrome.test.runTests([ 52 chrome.test.runTests([
52 getDevices, getConfigurations, explicitCloseDevice 53 getDevices, getConfigurations, explicitCloseDevice
53 ]); 54 ]);
OLDNEW
« no previous file with comments | « extensions/common/api/usb.idl ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698