| OLD | NEW |
| (Empty) | |
| 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. |
| 4 |
| 5 function testGetDevicesConcurrently() { |
| 6 chrome.test.assertEq(1, errors.length); |
| 7 |
| 8 var kExpectedError = "Concurrent calls to getDevices are not allowed."; |
| 9 chrome.test.assertEq(kExpectedError, errors[0]); |
| 10 |
| 11 chrome.test.succeed(); |
| 12 } |
| 13 |
| 14 function nop() {} |
| 15 |
| 16 var errors = []; |
| 17 function recordError() { |
| 18 if (chrome.runtime.lastError) { |
| 19 errors.push(chrome.runtime.lastError.message); |
| 20 } |
| 21 } |
| 22 |
| 23 var getDevicesOptions = { deviceCallback:nop, name:'foo' }; |
| 24 chrome.experimental.bluetooth.getDevices(getDevicesOptions, recordError); |
| 25 chrome.experimental.bluetooth.getDevices(getDevicesOptions, recordError); |
| 26 chrome.test.sendMessage('ready', |
| 27 function(message) { |
| 28 chrome.test.runTests([ |
| 29 testGetDevicesConcurrently |
| 30 ]); |
| 31 }); |
| OLD | NEW |