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

Side by Side Diff: chrome/browser/resources/bluetooth_internals/bluetooth_internals.js

Issue 2563113002: bluetooth: Add tests for Sidebar in bluetooth internals browser test suite. (Closed)
Patch Set: Change to Array#some Created 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/test/data/webui/bluetooth_internals_browsertest.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * Javascript for bluetooth_internals.html, served from 6 * Javascript for bluetooth_internals.html, served from
7 * chrome://bluetooth-internals/. 7 * chrome://bluetooth-internals/.
8 */ 8 */
9 9
10 // Expose for testing. 10 // Expose for testing.
11 var adapterBroker = null; 11 var adapterBroker = null;
12 var devices = null; 12 var devices = null;
13 var sidebarObj = null;
13 14
14 cr.define('bluetooth_internals', function() { 15 cr.define('bluetooth_internals', function() {
15 /** @const */ var DevicesPage = devices_page.DevicesPage; 16 /** @const */ var DevicesPage = devices_page.DevicesPage;
16 /** @const */ var PageManager = cr.ui.pageManager.PageManager; 17 /** @const */ var PageManager = cr.ui.pageManager.PageManager;
17 18
18 /** 19 /**
19 * Observer for page changes. Used to update page title header. 20 * Observer for page changes. Used to update page title header.
20 * @extends {cr.ui.pageManager.PageManager.Observer} 21 * @extends {cr.ui.pageManager.PageManager.Observer}
21 */ 22 */
22 var PageObserver = function() {}; 23 var PageObserver = function() {};
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 }).catch(function(error) { 103 }).catch(function(error) {
103 devices.updateConnectionStatus( 104 devices.updateConnectionStatus(
104 address, 105 address,
105 device_collection.ConnectionStatus.DISCONNECTED, 106 device_collection.ConnectionStatus.DISCONNECTED,
106 error); 107 error);
107 }); 108 });
108 }); 109 });
109 } 110 }
110 111
111 function setupPages() { 112 function setupPages() {
112 var sidebar = new window.sidebar.Sidebar($('sidebar')); 113 sidebarObj = new window.sidebar.Sidebar($('sidebar'));
113 $('menu-btn').addEventListener('click', function() { sidebar.open(); }); 114 $('menu-btn').addEventListener('click', function() { sidebarObj.open(); });
114 PageManager.addObserver(sidebar); 115 PageManager.addObserver(sidebarObj);
115 PageManager.addObserver(new PageObserver()); 116 PageManager.addObserver(new PageObserver());
116 117
117 devicesPage = new DevicesPage(); 118 devicesPage = new DevicesPage();
118 PageManager.register(devicesPage); 119 PageManager.register(devicesPage);
119 120
120 // Set up hash-based navigation. 121 // Set up hash-based navigation.
121 window.addEventListener('hashchange', function() { 122 window.addEventListener('hashchange', function() {
122 PageManager.showPageByName(window.location.hash.substr(1)); 123 PageManager.showPageByName(window.location.hash.substr(1));
123 }); 124 });
124 125
(...skipping 17 matching lines...) Expand all
142 .catch(function(error) { console.error(error); }); 143 .catch(function(error) { console.error(error); });
143 } 144 }
144 145
145 return { 146 return {
146 initializeViews: initializeViews 147 initializeViews: initializeViews
147 }; 148 };
148 }); 149 });
149 150
150 document.addEventListener( 151 document.addEventListener(
151 'DOMContentLoaded', bluetooth_internals.initializeViews); 152 'DOMContentLoaded', bluetooth_internals.initializeViews);
OLDNEW
« no previous file with comments | « no previous file | chrome/test/data/webui/bluetooth_internals_browsertest.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698