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

Unified Diff: chrome/test/data/extensions/api_test/bluetooth/test_getdevices_concurrently.js

Issue 10915148: Change getDevices to use a DeviceCallback. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix test breakage Created 8 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/data/extensions/api_test/bluetooth/test_getdevices_concurrently.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
+ ]);
+ });
« no previous file with comments | « chrome/test/data/extensions/api_test/bluetooth/test_getdevices_concurrently.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698