Chromium Code Reviews| 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..ae601a86f9f363b8b94a5ae231627dec73ac0f2e 100644 |
| --- a/chrome/test/data/webui/settings/basic_page_browsertest.js |
| +++ b/chrome/test/data/webui/settings/basic_page_browsertest.js |
| @@ -51,6 +51,29 @@ 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 = { |
| + page: 'basic', |
| + section: 'onStartup', |
| + subpage: [], |
| + }; |
| + |
| + return new Promise(function(resolve, reject) { |
| + function pollForVisibility() { |
| + var page = self.getPage('basic') |
| + var section = self.getSection(page, page.currentRoute.section); |
| + if (!section) |
| + setTimeout(pollForVisibility, 55); |
| + else |
| + resolve(); |
| + } |
| + pollForVisibility(); |
|
Dan Beam
2016/05/31 22:10:29
arguably:
var intervalId = window.setInterval(fun
dschuyler
2016/05/31 22:25:02
Done.
|
| + }.bind(self)); |
| + }); |
| }); |
| // Run all registered tests. |