1 // Copyright (c) 2015 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.
7 var genericTransfer = {
13 var controlTransfer = {
16 "requestType": "standard",
17 "recipient": "device",
25 "transferInfo": genericTransfer,
28 var errorTimeout = 'Transfer timeout must be greater than or equal to 0.';
30 function createInvalidTransferTest(usbFunction, transferInfo) {
32 usb.findDevices({vendorId: 0, productId: 0}, function(devices) {
33 var device = devices[0];
34 usbFunction(device, transferInfo, chrome.test.callbackFail(errorTimeout));
40 createInvalidTransferTest(usb.bulkTransfer, genericTransfer),
41 createInvalidTransferTest(usb.controlTransfer, controlTransfer),
42 createInvalidTransferTest(usb.interruptTransfer, genericTransfer),
43 createInvalidTransferTest(usb.isochronousTransfer, isoTransfer),
46 chrome.test.runTests(tests);