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

Side by Side Diff: chrome/test/data/webui/settings/device_page_tests.js

Issue 2156413002: Settings Router Refactor: Migrate to settings.Route.navigateTo calls. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge origin/master Created 4 years, 4 months 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
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 cr.define('device_page_tests', function() { 5 cr.define('device_page_tests', function() {
6 /** @enum {string} */ 6 /** @enum {string} */
7 var TestNames = { 7 var TestNames = {
8 DevicePage: 'device page', 8 DevicePage: 'device page',
9 Display: 'display', 9 Display: 'display',
10 Keyboard: 'keyboard', 10 Keyboard: 'keyboard',
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 suite('SettingsDevicePage', function() { 135 suite('SettingsDevicePage', function() {
136 /** @type {!SettingsDevicePage|undefined} */ 136 /** @type {!SettingsDevicePage|undefined} */
137 var devicePage; 137 var devicePage;
138 138
139 /** @type {!FakeSystemDisplay|undefined} */ 139 /** @type {!FakeSystemDisplay|undefined} */
140 var fakeSystemDisplay; 140 var fakeSystemDisplay;
141 141
142 suiteSetup(function() { 142 suiteSetup(function() {
143 // Disable animations so sub-pages open within one event loop. 143 // Disable animations so sub-pages open within one event loop.
144 testing.Test.disableAnimationsAndTransitions(); 144 testing.Test.disableAnimationsAndTransitions();
145
146 // Update the device page route for navigations.
147 settings.navigateTo = function(route) {
148 devicePage.currentRoute = route;
149 };
145 }); 150 });
146 151
147 setup(function(done) { 152 setup(function(done) {
148 fakeSystemDisplay = new settings.FakeSystemDisplay(); 153 fakeSystemDisplay = new settings.FakeSystemDisplay();
149 settings.display.systemDisplayApi = fakeSystemDisplay; 154 settings.display.systemDisplayApi = fakeSystemDisplay;
150 155
151 PolymerTest.clearBody(); 156 PolymerTest.clearBody();
152 devicePage = document.createElement('settings-device-page'); 157 devicePage = document.createElement('settings-device-page');
153 devicePage.currentRoute = {page: 'basic', section: '', subpage: []}; 158 devicePage.currentRoute = settings.Route.BASIC;
154 devicePage.prefs = getFakePrefs(); 159 devicePage.prefs = getFakePrefs();
155 settings.DevicePageBrowserProxyImpl.instance_ = 160 settings.DevicePageBrowserProxyImpl.instance_ =
156 new TestDevicePageBrowserProxy(); 161 new TestDevicePageBrowserProxy();
157 162
158 // settings-animated-pages expects a parent with data-page set. 163 // settings-animated-pages expects a parent with data-page set.
159 var basicPage = document.createElement('div'); 164 var basicPage = document.createElement('div');
160 basicPage.dataset.page = 'basic'; 165 basicPage.dataset.page = 'basic';
161 basicPage.appendChild(devicePage); 166 basicPage.appendChild(devicePage);
162 document.body.appendChild(basicPage); 167 document.body.appendChild(basicPage);
163 168
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after
513 expectTrue(displayPage.showMirror_(displayPage.displays)); 518 expectTrue(displayPage.showMirror_(displayPage.displays));
514 expectTrue(displayPage.isMirrored_(displayPage.displays)); 519 expectTrue(displayPage.isMirrored_(displayPage.displays));
515 }); 520 });
516 }); 521 });
517 }); 522 });
518 523
519 return { 524 return {
520 TestNames: TestNames 525 TestNames: TestNames
521 }; 526 };
522 }); 527 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698