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

Unified Diff: chrome/browser/resources/settings/bluetooth_page/bluetooth_page.js

Issue 1466433002: Add Settings bluetooth page test (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Chrome OS only Take 2 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
« no previous file with comments | « chrome/browser/resources/settings/bluetooth_page/bluetooth_page.html ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/settings/bluetooth_page/bluetooth_page.js
diff --git a/chrome/browser/resources/settings/bluetooth_page/bluetooth_page.js b/chrome/browser/resources/settings/bluetooth_page/bluetooth_page.js
index 6ba77e0252bf4139979e707f05c3c7fac017d46a..9a11f17784a622890f35d397056db0ea2a6f83d4 100644
--- a/chrome/browser/resources/settings/bluetooth_page/bluetooth_page.js
+++ b/chrome/browser/resources/settings/bluetooth_page/bluetooth_page.js
@@ -17,6 +17,21 @@
* @group Chrome Settings Elements
* @element settings-bluetooth-page
*/
+
+var bluetoothPage = bluetoothPage || {
+ /**
+ * Set this to provide a fake implementation for testing.
+ * @type {Bluetooth}
+ */
+ bluetoothApiForTest: null,
+
+ /**
+ * Set this to provide a fake implementation for testing.
+ * @type {BluetoothPrivate}
+ */
+ bluetoothPrivateApiForTest: null,
+};
+
Polymer({
is: 'settings-bluetooth-page',
@@ -83,6 +98,13 @@ Polymer({
*/
bluetoothDeviceRemovedListener_: undefined,
+ /** @override */
+ ready: function() {
+ if (bluetoothPage.bluetoothApiForTest)
+ this.bluetooth = bluetoothPage.bluetoothApiForTest;
+ if (bluetoothPage.bluetoothPrivateApiForTest)
+ this.bluetoothPrivate = bluetoothPage.bluetoothPrivateApiForTest;
+ },
/** @override */
attached: function() {
@@ -231,11 +253,13 @@ Polymer({
},
/**
- * @param {!Array<!chrome.bluetooth.Device>} deviceList
+ * @param {Object} deviceListChanges
* @return {boolean} True if deviceList is not empty.
* @private
*/
- haveDevices_: function(deviceList) { return !!deviceList.length; },
+ haveDevices_: function(deviceListChanges) {
+ return !!this.deviceList.length;
+ },
/**
* @param {number} selectedDevice
« no previous file with comments | « chrome/browser/resources/settings/bluetooth_page/bluetooth_page.html ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698