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 7410b9b02a81c053268c2f0de948c34134293d46..4a9c9fe458830e76d09f0314aa411e8b445a0e21 100644 |
--- a/chrome/test/data/webui/settings/basic_page_browsertest.js |
+++ b/chrome/test/data/webui/settings/basic_page_browsertest.js |
@@ -51,6 +51,27 @@ TEST_F('SettingsBasicPageBrowserTest', 'MAYBE_Load', function() { |
self.verifySubpagesHidden(section); |
} |
}); |
+ |
+ // 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_. |
+ self.getPage('basic').currentRoute = { |
michaelpg
2016/06/06 20:13:03
Since this is a test of the entire page, why not t
|
+ page: 'basic', |
+ section: 'onStartup', |
+ subpage: [], |
+ }; |
+ |
+ return new Promise(function(resolve, reject) { |
+ var intervalId = window.setInterval(function() { |
+ var page = self.getPage('basic'); |
+ if (self.getSection(page, page.currentRoute.section)) { |
michaelpg
2016/06/06 20:13:04
Why not actually *check* page.scroller.scrollTop t
|
+ window.clearInterval(intervalId); |
+ resolve(); |
+ } |
+ }, 55); |
michaelpg
2016/06/06 20:13:03
This is an unnecessary use of setInterval when set
|
+ }.bind(self)); |
+ }); |
}); |
// Run all registered tests. |