| 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. |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 getDevice: assertNotReached, | 56 getDevice: assertNotReached, |
| 57 | 57 |
| 58 /** @override */ | 58 /** @override */ |
| 59 getDevices: function(callback) { | 59 getDevices: function(callback) { |
| 60 setTimeout(function() { | 60 setTimeout(function() { |
| 61 callback(this.devices); | 61 callback(this.devices); |
| 62 }.bind(this)); | 62 }.bind(this)); |
| 63 }, | 63 }, |
| 64 | 64 |
| 65 /** @override */ | 65 /** @override */ |
| 66 startDiscovery: assertNotReached, | 66 startDiscovery: function(callback) { |
| 67 callback(); |
| 68 }, |
| 67 | 69 |
| 68 /** @override */ | 70 /** @override */ |
| 69 stopDiscovery: assertNotReached, | 71 stopDiscovery: assertNotReached, |
| 70 | 72 |
| 71 /** @override */ | 73 /** @override */ |
| 72 onAdapterStateChanged: new FakeChromeEvent(), | 74 onAdapterStateChanged: new FakeChromeEvent(), |
| 73 | 75 |
| 74 /** @override */ | 76 /** @override */ |
| 75 onDeviceAdded: new FakeChromeEvent(), | 77 onDeviceAdded: new FakeChromeEvent(), |
| 76 | 78 |
| 77 /** @override */ | 79 /** @override */ |
| 78 onDeviceChanged: new FakeChromeEvent(), | 80 onDeviceChanged: new FakeChromeEvent(), |
| 79 | 81 |
| 80 /** @override */ | 82 /** @override */ |
| 81 onDeviceRemoved: new FakeChromeEvent(), | 83 onDeviceRemoved: new FakeChromeEvent(), |
| 82 }; | 84 }; |
| 83 | 85 |
| 84 return {FakeBluetooth: FakeBluetooth}; | 86 return {FakeBluetooth: FakeBluetooth}; |
| 85 }); | 87 }); |
| OLD | NEW |