OLD | NEW |
---|---|
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 Display: 'display', | 8 Display: 'display', |
9 Keyboard: 'keyboard', | 9 Keyboard: 'keyboard', |
10 Touchpad: 'touchpad', | 10 Touchpad: 'touchpad', |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
108 | 108 |
109 /** @type {!SettingsDevicePage|undefined} */ | 109 /** @type {!SettingsDevicePage|undefined} */ |
110 var devicePage; | 110 var devicePage; |
111 | 111 |
112 /** @type {!FakeSystemDisplay|undefined} */ | 112 /** @type {!FakeSystemDisplay|undefined} */ |
113 var fakeSystemDisplay; | 113 var fakeSystemDisplay; |
114 | 114 |
115 suiteSetup(function() { | 115 suiteSetup(function() { |
116 // Disable animations so sub-pages open within one event loop. | 116 // Disable animations so sub-pages open within one event loop. |
117 testing.Test.disableAnimationsAndTransitions(); | 117 testing.Test.disableAnimationsAndTransitions(); |
118 | |
119 // Update the device page route for navigations. | |
120 settings.navigateTo = function(route) { | |
michaelpg
2016/07/20 19:48:23
Can you provide your own stub instead?
tommycli
2016/07/20 20:33:30
Per offline discussion, we are going to address th
| |
121 devicePage.currentRoute = route; | |
122 }; | |
118 }); | 123 }); |
119 | 124 |
120 setup(function(done) { | 125 setup(function(done) { |
121 fakeSystemDisplay = new settings.FakeSystemDisplay(); | 126 fakeSystemDisplay = new settings.FakeSystemDisplay(); |
122 settings.display.systemDisplayApi = fakeSystemDisplay; | 127 settings.display.systemDisplayApi = fakeSystemDisplay; |
123 | 128 |
124 PolymerTest.clearBody(); | 129 PolymerTest.clearBody(); |
125 devicePage = document.createElement('settings-device-page'); | 130 devicePage = document.createElement('settings-device-page'); |
126 devicePage.currentRoute = {page: 'basic', section: '', subpage: []}; | 131 devicePage.currentRoute = settings.Route.BASIC; |
127 devicePage.prefs = fakePrefs; | 132 devicePage.prefs = fakePrefs; |
128 settings.DevicePageBrowserProxyImpl.instance_ = | 133 settings.DevicePageBrowserProxyImpl.instance_ = |
129 new TestDevicePageBrowserProxy(); | 134 new TestDevicePageBrowserProxy(); |
130 document.body.appendChild(devicePage); | 135 document.body.appendChild(devicePage); |
131 | 136 |
132 // Allow the light DOM to be distributed to settings-animated-pages. | 137 // Allow the light DOM to be distributed to settings-animated-pages. |
133 setTimeout(done); | 138 setTimeout(done); |
134 }); | 139 }); |
135 | 140 |
136 /** @return {!Promise<!Element>} */ | 141 /** @return {!Promise<!Element>} */ |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
397 expectTrue(displayPage.showMirror_(displayPage.displays)); | 402 expectTrue(displayPage.showMirror_(displayPage.displays)); |
398 expectTrue(displayPage.isMirrored_(displayPage.displays)); | 403 expectTrue(displayPage.isMirrored_(displayPage.displays)); |
399 }); | 404 }); |
400 }); | 405 }); |
401 }); | 406 }); |
402 | 407 |
403 return { | 408 return { |
404 TestNames: TestNames | 409 TestNames: TestNames |
405 }; | 410 }; |
406 }); | 411 }); |
OLD | NEW |