| 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 /** | 5 /** |
| 6 * @fileoverview Suite of tests to ensure that settings subpages exist and | 6 * @fileoverview Suite of tests to ensure that settings subpages exist and |
| 7 * load without errors. Also outputs approximate load times for each subpage. | 7 * load without errors. Also outputs approximate load times for each subpage. |
| 8 */ | 8 */ |
| 9 | 9 |
| 10 GEN_INCLUDE(['settings_page_browsertest.js']); | 10 GEN_INCLUDE(['settings_page_browsertest.js']); |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 Polymer.dom.flush(); | 77 Polymer.dom.flush(); |
| 78 var dtime = window.performance.now() - startTime; | 78 var dtime = window.performance.now() - startTime; |
| 79 console.log('Page: ' + subPage + ' Load time: ' + dtime.toFixed(0) + ' ms'); | 79 console.log('Page: ' + subPage + ' Load time: ' + dtime.toFixed(0) + ' ms'); |
| 80 expectTrue(!!this.getSection(page, subPage)); | 80 expectTrue(!!this.getSection(page, subPage)); |
| 81 // Hide the page so that it doesn't interfere with other subPages. | 81 // Hide the page so that it doesn't interfere with other subPages. |
| 82 page.set('pageVisibility.' + subPage, false); | 82 page.set('pageVisibility.' + subPage, false); |
| 83 Polymer.dom.flush(); | 83 Polymer.dom.flush(); |
| 84 }, | 84 }, |
| 85 | 85 |
| 86 testSubPages: function() { | 86 testSubPages: function() { |
| 87 Polymer.dom.flush(); |
| 87 var page = this.getPage(this.pageId); | 88 var page = this.getPage(this.pageId); |
| 88 this.subPages.forEach(function(subPage) { | 89 this.subPages.forEach(function(subPage) { |
| 89 if (this.includePage(subPage)) | 90 if (this.includePage(subPage)) |
| 90 test(subPage, this.testPage.bind(this, page, subPage)); | 91 test(subPage, this.testPage.bind(this, page, subPage)); |
| 91 }.bind(this)); | 92 }.bind(this)); |
| 92 }, | 93 }, |
| 93 | 94 |
| 94 /** | 95 /** |
| 95 * @param {string} id | 96 * @param {string} id |
| 96 * @return {boolean} | 97 * @return {boolean} |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 __proto__: SettingsSubPageBrowserTest.prototype, | 148 __proto__: SettingsSubPageBrowserTest.prototype, |
| 148 | 149 |
| 149 /** @override */ | 150 /** @override */ |
| 150 browsePreload: 'chrome://md-settings/advanced', | 151 browsePreload: 'chrome://md-settings/advanced', |
| 151 }; | 152 }; |
| 152 | 153 |
| 153 TEST_F('SettingsAdvancedSubPageBrowserTest', 'SubPages', function() { | 154 TEST_F('SettingsAdvancedSubPageBrowserTest', 'SubPages', function() { |
| 154 suite('Advanced', this.testSubPages.bind(this)); | 155 suite('Advanced', this.testSubPages.bind(this)); |
| 155 mocha.run(); | 156 mocha.run(); |
| 156 }); | 157 }); |
| OLD | NEW |