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

Unified Diff: chrome/test/data/webui/settings/basic_page_browsertest.js

Issue 2506793002: MD Settings: Fix Back navigation from section route to BASIC route. (Closed)
Patch Set: address comments Created 4 years, 1 month 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/webui/settings/basic_page_browsertest.js
diff --git a/chrome/test/data/webui/settings/basic_page_browsertest.js b/chrome/test/data/webui/settings/basic_page_browsertest.js
index 621c3632931edb5292a74f14393be2defe177a3e..9fde2be0af3303f876535a5e2aadf5c362832897 100644
--- a/chrome/test/data/webui/settings/basic_page_browsertest.js
+++ b/chrome/test/data/webui/settings/basic_page_browsertest.js
@@ -52,13 +52,15 @@ TEST_F('SettingsBasicPageBrowserTest', 'MAYBE_Load', function() {
}
});
- // This test checks for a regression that occurred with scrollToSection_
- // failing to find its host element.
test('scroll to section', function() {
// Setting the page and section will cause a scrollToSection_.
settings.navigateTo(settings.Route.ON_STARTUP);
+ var page = self.getPage('basic');
+
return new Promise(function(resolve, reject) {
+ // This test checks for a regression that occurred with scrollToSection_
+ // failing to find its host element.
var intervalId = window.setInterval(function() {
var page = self.getPage('basic');
if (self.getSection(page, settings.getCurrentRoute().section)) {
@@ -66,7 +68,18 @@ TEST_F('SettingsBasicPageBrowserTest', 'MAYBE_Load', function() {
resolve();
}
}, 55);
- }.bind(self));
+ }.bind(self)).then(function() {
+ // Should be scrolled to the On Startup section.
+ assertNotEquals(0, page.scroller.scrollTop);
+
+ return new Promise(function(resolve) {
+ listenOnce(window, 'popstate', resolve);
+ settings.navigateToPreviousRoute();
+ });
+ }).then(function() {
+ // Should be at the top of the page after going Back from the section.
+ assertEquals(0, page.scroller.scrollTop);
+ });
});
});
« 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