OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 /** | 5 /** |
6 * @fileoverview Fake implementation of chrome.bluetooth for testing. | 6 * @fileoverview Fake implementation of chrome.bluetooth for testing. |
7 */ | 7 */ |
8 cr.define('settings', function() { | 8 cr.define('settings', function() { |
9 /** | 9 /** |
10 * Fake of the chrome.bluetooth API. | 10 * Fake of the chrome.bluetooth API. |
11 * @constructor | 11 * @constructor |
12 * @implements {Bluetooth} | 12 * @implements {Bluetooth} |
13 */ | 13 */ |
14 function FakeBluetooth() { | 14 function FakeBluetooth() { |
15 /** @type {!chrome.bluettoth.AdapterState} */ this.adapterState = { | 15 /** @type {!chrome.bluetooth.AdapterState} */ this.adapterState = { |
16 address: '00:11:22:33:44:55:66', | 16 address: '00:11:22:33:44:55:66', |
17 name: 'Fake Adapter', | 17 name: 'Fake Adapter', |
18 powered: false, | 18 powered: false, |
19 available: true, | 19 available: true, |
20 discovering: false | 20 discovering: false |
21 }; | 21 }; |
22 | 22 |
23 /** @type {!Array<!chrome.bluetooth.Device>} */ this.devices = []; | 23 /** @type {!Array<!chrome.bluetooth.Device>} */ this.devices = []; |
24 } | 24 } |
25 | 25 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 | 76 |
77 /** @override */ | 77 /** @override */ |
78 onDeviceChanged: new FakeChromeEvent(), | 78 onDeviceChanged: new FakeChromeEvent(), |
79 | 79 |
80 /** @override */ | 80 /** @override */ |
81 onDeviceRemoved: new FakeChromeEvent(), | 81 onDeviceRemoved: new FakeChromeEvent(), |
82 }; | 82 }; |
83 | 83 |
84 return {FakeBluetooth: FakeBluetooth}; | 84 return {FakeBluetooth: FakeBluetooth}; |
85 }); | 85 }); |
OLD | NEW |