| 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();
|
| + });
|
| });
|
| }
|
|
|
|
|