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

Side by Side Diff: chrome/test/data/webui/settings/fake_bluetooth.js

Issue 2655043005: MD Settings: Bluetooth: Move device list to subpage (Closed)
Patch Set: Fix clang, ES6 Created 3 years, 10 months 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 unified diff | Download patch
OLDNEW
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 29 matching lines...) Expand all
40 for (var d of this.devices) 40 for (var d of this.devices)
41 this.onDeviceRemoved.callListeners(d); 41 this.onDeviceRemoved.callListeners(d);
42 this.devices = devices; 42 this.devices = devices;
43 for (var d of this.devices) 43 for (var d of this.devices)
44 this.onDeviceAdded.callListeners(d); 44 this.onDeviceAdded.callListeners(d);
45 }, 45 },
46 46
47 // Bluetooth overrides. 47 // Bluetooth overrides.
48 /** @override */ 48 /** @override */
49 getAdapterState: function(callback) { 49 getAdapterState: function(callback) {
50 setTimeout(function() { 50 callback(this.adapterState);
51 callback(this.adapterState);
52 }.bind(this));
53 }, 51 },
54 52
55 /** @override */ 53 /** @override */
56 getDevice: assertNotReached, 54 getDevice: assertNotReached,
57 55
58 /** @override */ 56 /** @override */
59 getDevices: function(callback) { 57 getDevices: function(callback) {
60 setTimeout(function() { 58 callback(this.devices);
61 callback(this.devices);
62 }.bind(this));
63 }, 59 },
64 60
65 /** @override */ 61 /** @override */
66 startDiscovery: function(callback) { 62 startDiscovery: function(callback) {
67 callback(); 63 callback();
68 }, 64 },
69 65
70 /** @override */ 66 /** @override */
71 stopDiscovery: assertNotReached, 67 stopDiscovery: assertNotReached,
72 68
73 /** @override */ 69 /** @override */
74 onAdapterStateChanged: new FakeChromeEvent(), 70 onAdapterStateChanged: new FakeChromeEvent(),
75 71
76 /** @override */ 72 /** @override */
77 onDeviceAdded: new FakeChromeEvent(), 73 onDeviceAdded: new FakeChromeEvent(),
78 74
79 /** @override */ 75 /** @override */
80 onDeviceChanged: new FakeChromeEvent(), 76 onDeviceChanged: new FakeChromeEvent(),
81 77
82 /** @override */ 78 /** @override */
83 onDeviceRemoved: new FakeChromeEvent(), 79 onDeviceRemoved: new FakeChromeEvent(),
84 }; 80 };
85 81
86 return {FakeBluetooth: FakeBluetooth}; 82 return {FakeBluetooth: FakeBluetooth};
87 }); 83 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698