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

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

Issue 1466433002: Add Settings bluetooth page test (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make Chrome OS only Created 5 years 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
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
new file mode 100644
index 0000000000000000000000000000000000000000..7b91b1d776e7238069cc3f3171036c3d88e7949e
--- /dev/null
+++ b/chrome/test/data/webui/settings/fake_bluetooth_private.js
@@ -0,0 +1,50 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+/**
+ * @fileoverview Fake implementation of chrome.bluetoothPrivate for testing.
+ */
+cr.define('settings', function() {
+ /**
+ * Fake of the chrome.bluetooth API.
+ * @param {!Bluetooth} bluetoothApi
+ * @constructor
+ * @implements {BluetoothPrivate}
+ */
+ function FakeBluetoothPrivate(bluetoothApi) {
+ /** @private {!Bluetooth} */ this.bluetoothApi_ = bluetoothApi;
+ }
+
+ FakeBluetoothPrivate.prototype = {
+ /** @override */
+ setAdapterState: function(state, opt_callback) {
+ this.bluetoothApi_.enabled = state.powered;
+ if (opt_callback)
+ setTimeout(opt_callback);
+ },
+
+ /** @override */
+ setPairingResponse: assertNotReached,
+
+ /** @override */
+ disconnectAll: assertNotReached,
+
+ /** @override */
+ forgetDevice: assertNotReached,
+
+ /** @override */
+ setDiscoveryFilter: assertNotReached,
+
+ /** @override */
+ connect: assertNotReached,
+
+ /** @override */
+ pair: assertNotReached,
+
+ /** @type {!FakeChromeEvent} */
+ onPairing: new FakeChromeEvent(),
+ };
+
+ return {FakeBluetoothPrivate: FakeBluetoothPrivate};
+});

Powered by Google App Engine
This is Rietveld 408576698