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..986598cef445391f75a08e85c8898defbfa66b54 100644 |
--- a/chrome/browser/resources/settings/bluetooth_page/bluetooth_page.js |
+++ b/chrome/browser/resources/settings/bluetooth_page/bluetooth_page.js |
@@ -17,6 +17,19 @@ |
* @group Chrome Settings Elements |
* @element settings-bluetooth-page |
*/ |
+ |
+/** |
+ * Set this to provide a fake implementation for testing. |
+ * @type {Bluetooth} |
+ */ |
+var bluetoothApiForTest; |
+ |
+/** |
+ * Set this to provide a fake implementation for testing. |
+ * @type {BluetoothPrivate} |
+ */ |
+var bluetoothPrivateApiForTest; |
+ |
Polymer({ |
is: 'settings-bluetooth-page', |
@@ -83,6 +96,13 @@ Polymer({ |
*/ |
bluetoothDeviceRemovedListener_: undefined, |
+ /** @override */ |
+ ready: function() { |
+ if (bluetoothApiForTest) |
+ this.bluetooth = bluetoothApiForTest; |
+ if (bluetoothPrivateApiForTest) |
+ this.bluetoothPrivate = bluetoothPrivateApiForTest; |
+ }, |
/** @override */ |
attached: function() { |
@@ -231,11 +251,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 |