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

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

Issue 2582643002: MD Settings: Fix scrolling when navigating Forwards from BASIC page. (Closed)
Patch Set: change code 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 | « 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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 // Should be scrolled to the On Startup section. 120 // Should be scrolled to the On Startup section.
121 assertNotEquals(0, page.scroller.scrollTop); 121 assertNotEquals(0, page.scroller.scrollTop);
122 122
123 return new Promise(function(resolve) { 123 return new Promise(function(resolve) {
124 listenOnce(window, 'popstate', resolve); 124 listenOnce(window, 'popstate', resolve);
125 settings.navigateToPreviousRoute(); 125 settings.navigateToPreviousRoute();
126 }); 126 });
127 }).then(function() { 127 }).then(function() {
128 // Should be at the top of the page after going Back from the section. 128 // Should be at the top of the page after going Back from the section.
129 assertEquals(0, page.scroller.scrollTop); 129 assertEquals(0, page.scroller.scrollTop);
130
131 return new Promise(function(resolve) {
132 listenOnce(window, 'popstate', resolve);
133 window.history.forward();
134 });
135 }).then(function() {
136 // Should scroll when navigating forwards from the BASIC page.
137 assertNotEquals(0, page.scroller.scrollTop);
130 }); 138 });
131 }); 139 });
132 140
133 test('scroll to section after exiting search', function() { 141 test('scroll to section after exiting search', function() {
134 var searchManager = new TestSearchManager(); 142 var searchManager = new TestSearchManager();
135 settings.setSearchManagerForTesting(searchManager); 143 settings.setSearchManagerForTesting(searchManager);
136 144
137 settings.navigateTo(settings.Route.BASIC, 145 settings.navigateTo(settings.Route.BASIC,
138 new URLSearchParams(`search=foobar`), 146 new URLSearchParams(`search=foobar`),
139 /* removeSearch */ false); 147 /* removeSearch */ false);
(...skipping 14 matching lines...) Expand all
154 } 162 }
155 }, 55); 163 }, 55);
156 }); 164 });
157 }); 165 });
158 }); 166 });
159 }); 167 });
160 168
161 // Run all registered tests. 169 // Run all registered tests.
162 mocha.run(); 170 mocha.run();
163 }); 171 });
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