| 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);
|
| + });
|
| });
|
| });
|
|
|
|
|