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

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

Issue 2627403003: MD Settings: Scroll to top when navigating to About page. (Closed)
Patch Set: fix Created 3 years, 11 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
« no previous file with comments | « chrome/browser/resources/settings/settings_page/main_page_behavior.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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);
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 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/settings/settings_page/main_page_behavior.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698