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

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

Issue 16316004: Separate usb device handle from usb device. (deprecate) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix the threading mess Created 7 years, 5 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 | Annotate | Revision Log
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 var tests = [ 7 var tests = [
8 function zeroLengthTransfer() { 8 function zeroLengthTransfer() {
9 usb.findDevices({vendorId: 0, productId: 0}, function(devices) { 9 usb.getDevices({vendorId: 0, productId: 0}, function(devices) {
10 var device = devices[0]; 10 usb.openDevice(devices[0], function(device) {
11 var transfer = new Object(); 11 var transfer = new Object();
12 transfer.direction = "out"; 12 transfer.direction = "out";
13 transfer.endpoint = 1; 13 transfer.endpoint = 1;
14 transfer.data = new ArrayBuffer(0); 14 transfer.data = new ArrayBuffer(0);
15 usb.bulkTransfer(device, transfer, function (result) { 15 usb.bulkTransfer(device, transfer, function(result) {
16 chrome.test.succeed(); 16 chrome.test.succeed();
17 });
17 }); 18 });
18 }); 19 });
19 }, 20 }
20 ]; 21 ];
21 22
22 chrome.test.runTests(tests); 23 chrome.test.runTests(tests);
OLDNEW
« no previous file with comments | « chrome/test/data/extensions/api_test/usb/transfer_failure/test.js ('k') | third_party/libusb/README.chromium » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698