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

Unified Diff: chrome/test/data/webui/settings/fake_bluetooth_private.js

Issue 1568703002: Add Bluetooth settings dialog tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: .. Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/data/webui/settings/fake_bluetooth.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/webui/settings/fake_bluetooth_private.js
diff --git a/chrome/test/data/webui/settings/fake_bluetooth_private.js b/chrome/test/data/webui/settings/fake_bluetooth_private.js
index 7b91b1d776e7238069cc3f3171036c3d88e7949e..7367da929730a82fec403aa3bdf3a767c6105b86 100644
--- a/chrome/test/data/webui/settings/fake_bluetooth_private.js
+++ b/chrome/test/data/webui/settings/fake_bluetooth_private.js
@@ -14,18 +14,27 @@ cr.define('settings', function() {
*/
function FakeBluetoothPrivate(bluetoothApi) {
/** @private {!Bluetooth} */ this.bluetoothApi_ = bluetoothApi;
+
+ /** @type {!Set<string>} */ this.connectedDevices_ = new Set();
+
+ /** @type {!Object<!chrome.bluetoothPrivate.SetPairingResponseOptions>} */
+ this.pairingResponses_ = {};
}
FakeBluetoothPrivate.prototype = {
/** @override */
setAdapterState: function(state, opt_callback) {
- this.bluetoothApi_.enabled = state.powered;
+ this.bluetoothApi_.adapterState = state;
if (opt_callback)
setTimeout(opt_callback);
},
/** @override */
- setPairingResponse: assertNotReached,
+ setPairingResponse: function(options, opt_callback) {
+ this.pairingResponses_[options.device.address] = options;
+ if (opt_callback)
+ setTimeout(opt_callback);
+ },
/** @override */
disconnectAll: assertNotReached,
@@ -37,7 +46,11 @@ cr.define('settings', function() {
setDiscoveryFilter: assertNotReached,
/** @override */
- connect: assertNotReached,
+ connect: function(address, opt_callback) {
+ this.connectedDevices_.add(address);
+ if (opt_callback)
+ setTimeout(opt_callback);
+ },
/** @override */
pair: assertNotReached,
« no previous file with comments | « chrome/test/data/webui/settings/fake_bluetooth.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698