Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 44 sections.push('defaultBrowser'); | 44 sections.push('defaultBrowser'); |
| 45 else | 45 else |
| 46 sections = sections.concat(['internet', 'device']); | 46 sections = sections.concat(['internet', 'device']); |
| 47 | 47 |
| 48 for (var i = 0; i < sections.length; i++) { | 48 for (var i = 0; i < sections.length; i++) { |
| 49 var section = self.getSection(page, sections[i]); | 49 var section = self.getSection(page, sections[i]); |
| 50 expectTrue(!!section); | 50 expectTrue(!!section); |
| 51 self.verifySubpagesHidden(section); | 51 self.verifySubpagesHidden(section); |
| 52 } | 52 } |
| 53 }); | 53 }); |
| 54 | |
| 55 // This test checks for a regression that occurred with scrollToSection_ | |
| 56 // failing to find its host element. | |
| 57 test('scroll to section', function() { | |
| 58 // Setting the page and section will cause a scrollToSection_. | |
| 59 self.getPage('basic').currentRoute = { | |
| 60 page: 'basic', | |
| 61 section: 'onStartup', | |
| 62 subpage: [], | |
| 63 }; | |
| 64 | |
| 65 return new Promise(function(resolve, reject) { | |
| 66 // This timeout should be longer than the one in main_page_behavior, | |
|
Dan Beam
2016/05/31 21:27:20
can you just make scrollToSection_ return a Promis
dschuyler
2016/05/31 22:02:15
In the 'or something' category I made the check in
| |
| 67 // scrollToSection_(). It may be removed if/when that timeout is | |
| 68 // removed. | |
| 69 setTimeout(resolve, 200); | |
| 70 }); | |
| 71 }); | |
| 54 }); | 72 }); |
| 55 | 73 |
| 56 // Run all registered tests. | 74 // Run all registered tests. |
| 57 mocha.run(); | 75 mocha.run(); |
| 58 }); | 76 }); |
| OLD | NEW |