Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 /** @fileoverview Suite of tests for the Settings basic page. */ | 5 /** @fileoverview Suite of tests for the Settings basic page. */ |
| 6 | 6 |
| 7 GEN_INCLUDE(['settings_page_browsertest.js']); | 7 GEN_INCLUDE(['settings_page_browsertest.js']); |
| 8 | 8 |
| 9 /** | 9 /** |
| 10 * @constructor | 10 * @constructor |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 157 // Should (after some time) be scrolled to the On Startup section. | 157 // Should (after some time) be scrolled to the On Startup section. |
| 158 var intervalId = window.setInterval(function() { | 158 var intervalId = window.setInterval(function() { |
| 159 if (page.scroller.scrollTop != 0) { | 159 if (page.scroller.scrollTop != 0) { |
| 160 window.clearInterval(intervalId); | 160 window.clearInterval(intervalId); |
| 161 resolve(); | 161 resolve(); |
| 162 } | 162 } |
| 163 }, 55); | 163 }, 55); |
| 164 }); | 164 }); |
| 165 }); | 165 }); |
| 166 }); | 166 }); |
| 167 | |
| 168 test('scroll to top before navigating to about', function() { | |
| 169 var page = self.getPage('basic'); | |
| 170 // Set the viewport small to force the scrollbar to appear on ABOUT. | |
| 171 Polymer.dom().querySelector('settings-ui').style.height = '200px'; | |
| 172 | |
| 173 settings.navigateTo(settings.Route.ON_STARTUP); | |
| 174 assertNotEquals(0, page.scroller.scrollTop); | |
| 175 | |
| 176 settings.navigateTo(settings.Route.ABOUT); | |
|
dschuyler
2017/01/17 23:33:38
Could this need a Polymer.dom.flush() or something
tommycli
2017/01/17 23:47:00
Ah, I don't think it actually needs the flush. How
| |
| 177 assertEquals(0, page.scroller.scrollTop); | |
| 178 }); | |
| 167 }); | 179 }); |
| 168 | 180 |
| 169 // Run all registered tests. | 181 // Run all registered tests. |
| 170 mocha.run(); | 182 mocha.run(); |
| 171 }); | 183 }); |
| OLD | NEW |