| Index: chrome/test/data/extensions/api_test/bluetooth/test_getdevices_concurrently.js
|
| diff --git a/chrome/test/data/extensions/api_test/bluetooth/test_getdevices_concurrently.js b/chrome/test/data/extensions/api_test/bluetooth/test_getdevices_concurrently.js
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..3f2d80db01128909fe1f5d443693ba8b36b38aee
|
| --- /dev/null
|
| +++ b/chrome/test/data/extensions/api_test/bluetooth/test_getdevices_concurrently.js
|
| @@ -0,0 +1,31 @@
|
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +function testGetDevicesConcurrently() {
|
| + chrome.test.assertEq(1, errors.length);
|
| +
|
| + var kExpectedError = "Concurrent calls to getDevices are not allowed.";
|
| + chrome.test.assertEq(kExpectedError, errors[0]);
|
| +
|
| + chrome.test.succeed();
|
| +}
|
| +
|
| +function nop() {}
|
| +
|
| +var errors = [];
|
| +function recordError() {
|
| + if (chrome.runtime.lastError) {
|
| + errors.push(chrome.runtime.lastError.message);
|
| + }
|
| +}
|
| +
|
| +var getDevicesOptions = { deviceCallback:nop, name:'foo' };
|
| +chrome.experimental.bluetooth.getDevices(getDevicesOptions, recordError);
|
| +chrome.experimental.bluetooth.getDevices(getDevicesOptions, recordError);
|
| +chrome.test.sendMessage('ready',
|
| + function(message) {
|
| + chrome.test.runTests([
|
| + testGetDevicesConcurrently
|
| + ]);
|
| + });
|
|
|