OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 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 /** |
| 6 * @fileoverview Fake implementation of chrome.bluetoothPrivate for testing. |
| 7 */ |
| 8 cr.define('settings', function() { |
| 9 /** |
| 10 * Fake of the chrome.bluetooth API. |
| 11 * @param {!Bluetooth} bluetoothApi |
| 12 * @constructor |
| 13 * @implements {BluetoothPrivate} |
| 14 */ |
| 15 function FakeBluetoothPrivate(bluetoothApi) { |
| 16 /** @private {!Bluetooth} */ this.bluetoothApi_ = bluetoothApi; |
| 17 } |
| 18 |
| 19 FakeBluetoothPrivate.prototype = { |
| 20 /** @override */ |
| 21 setAdapterState: function(state, opt_callback) { |
| 22 this.bluetoothApi_.enabled = state.powered; |
| 23 if (opt_callback) |
| 24 setTimeout(opt_callback); |
| 25 }, |
| 26 |
| 27 /** @override */ |
| 28 setPairingResponse: assertNotReached, |
| 29 |
| 30 /** @override */ |
| 31 disconnectAll: assertNotReached, |
| 32 |
| 33 /** @override */ |
| 34 forgetDevice: assertNotReached, |
| 35 |
| 36 /** @override */ |
| 37 setDiscoveryFilter: assertNotReached, |
| 38 |
| 39 /** @override */ |
| 40 connect: assertNotReached, |
| 41 |
| 42 /** @override */ |
| 43 pair: assertNotReached, |
| 44 |
| 45 /** @type {!FakeChromeEvent} */ |
| 46 onPairing: new FakeChromeEvent(), |
| 47 }; |
| 48 |
| 49 return {FakeBluetoothPrivate: FakeBluetoothPrivate}; |
| 50 }); |
OLD | NEW |