| 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
|
|
|