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

Unified Diff: chrome/browser/resources/bluetooth_internals/bluetooth_internals.js

Issue 2428773005: bluetooth: Basic browser tests for chrome://bluetooth-internals. (Closed)
Patch Set: Merge upstream Created 4 years, 1 month 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 | « no previous file | chrome/browser/resources/bluetooth_internals/interfaces.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/bluetooth_internals/bluetooth_internals.js
diff --git a/chrome/browser/resources/bluetooth_internals/bluetooth_internals.js b/chrome/browser/resources/bluetooth_internals/bluetooth_internals.js
index 5059c3ece81068daacbf4feaf00a18ca5a0af98a..2826f2e4ad0ae6a37db2da5922cda04d730efbc4 100644
--- a/chrome/browser/resources/bluetooth_internals/bluetooth_internals.js
+++ b/chrome/browser/resources/bluetooth_internals/bluetooth_internals.js
@@ -7,13 +7,16 @@
* chrome://bluetooth-internals/.
*/
+// Expose for testing.
+var adapterBroker = null;
+var devices = null;
+
cr.define('bluetooth_internals', function() {
/** @type {!Map<string, !interfaces.BluetoothDevice.Device.proxyClass>} */
var deviceAddressToProxy = new Map();
function initializeViews() {
- var adapterBroker = null;
adapter_broker.getAdapterBroker()
.then(function(broker) { adapterBroker = broker; })
.then(function() { return adapterBroker.getInfo(); })
@@ -21,7 +24,7 @@ cr.define('bluetooth_internals', function() {
.then(function() { return adapterBroker.getDevices(); })
.then(function(response) {
// Hook up device collection events.
- var devices = new device_collection.DeviceCollection([]);
+ devices = new device_collection.DeviceCollection([]);
adapterBroker.addEventListener('deviceadded', function(event) {
devices.addOrUpdate(event.detail.deviceInfo);
});
@@ -80,6 +83,8 @@ cr.define('bluetooth_internals', function() {
});
deviceTable.setDevices(devices);
+ deviceTable.id = 'device-table';
+
document.body.appendChild(deviceTable);
})
.catch(function(error) { console.error(error); });
@@ -88,7 +93,6 @@ cr.define('bluetooth_internals', function() {
return {
initializeViews: initializeViews
};
-
});
document.addEventListener(
« no previous file with comments | « no previous file | chrome/browser/resources/bluetooth_internals/interfaces.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698