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

Unified Diff: chrome/test/data/extensions/api_test/bluetooth_private/pair/test.js

Issue 1419023004: Add bluetoothPrivate.connect (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@issue_543294_bluetooth_options_2b_props
Patch Set: Rebase Created 5 years, 1 month 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
Index: chrome/test/data/extensions/api_test/bluetooth_private/pair/test.js
diff --git a/chrome/test/data/extensions/api_test/bluetooth_private/pair/test.js b/chrome/test/data/extensions/api_test/bluetooth_private/pair/test.js
index 959959e097b67e23501cc0e99fc35b99a44bbc15..d501f27a5a0df1129d335e8163992325bc0a7d8a 100644
--- a/chrome/test/data/extensions/api_test/bluetooth_private/pair/test.js
+++ b/chrome/test/data/extensions/api_test/bluetooth_private/pair/test.js
@@ -3,21 +3,28 @@
// found in the LICENSE file.
var deviceAddress = '11:12:13:14:15:16';
+var errorPairingNotEnabled = 'Pairing not enabled';
function testPair() {
- chrome.bluetoothPrivate.onPairing.addListener(function(pairingEvent) {
- chrome.test.assertEq('confirmPasskey', pairingEvent.pairing);
- chrome.bluetoothPrivate.setPairingResponse({
+ chrome.bluetoothPrivate.pair(deviceAddress, function() {
+ chrome.test.assertEq(
+ errorPairingNotEnabled, chrome.runtime.lastError.message);
+
+ // onPairing listener must be provided for pair to succeed.
+ chrome.bluetoothPrivate.onPairing.addListener(function(pairingEvent) {
+ chrome.test.assertEq('confirmPasskey', pairingEvent.pairing);
+ chrome.bluetoothPrivate.setPairingResponse({
device: pairingEvent.device,
response: 'confirm',
- }, function() {
- chrome.test.assertNoLastError();
+ }, function() {
+ chrome.test.assertNoLastError();
+ });
});
- });
- chrome.bluetoothPrivate.pair(deviceAddress, function() {
- chrome.test.assertNoLastError();
- chrome.test.succeed();
+ chrome.bluetoothPrivate.pair(deviceAddress, function() {
+ chrome.test.assertNoLastError();
+ chrome.test.succeed();
+ });
});
}

Powered by Google App Engine
This is Rietveld 408576698