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

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

Issue 2428773005: bluetooth: Basic browser tests for chrome://bluetooth-internals. (Closed)
Patch Set: Fix formatting 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
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 767c35548d44ab801e0cb45cf37c7cd4e4f24e94..30828ec682c763831120c511d016f25ff484d24e 100644
--- a/chrome/browser/resources/bluetooth_internals/bluetooth_internals.js
+++ b/chrome/browser/resources/bluetooth_internals/bluetooth_internals.js
@@ -7,9 +7,12 @@
* chrome://bluetooth-internals/.
*/
+// Expose for testing.
+var adapterBroker = null;
+var devices = null;
+
cr.define('bluetooth_internals', function() {
function initialize() {
- var adapterBroker = null;
adapter_broker.getAdapterBroker()
.then(function(broker) { adapterBroker = broker; })
.then(function() { return adapterBroker.getInfo(); })
@@ -17,7 +20,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.deviceInfo);
});
@@ -33,6 +36,8 @@ cr.define('bluetooth_internals', function() {
var deviceTable = new device_table.DeviceTable();
deviceTable.setDevices(devices);
+ deviceTable.id = 'device-table';
+
document.body.appendChild(deviceTable);
})
.catch(function(error) { console.error(error); });

Powered by Google App Engine
This is Rietveld 408576698