| 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 23 matching lines...) Expand all Loading... |
| 34 // This allows us to test loading each subpage independently without other | 34 // This allows us to test loading each subpage independently without other |
| 35 // subpages affecting load times, etc. | 35 // subpages affecting load times, etc. |
| 36 settingsHidePagesByDefaultForTest = true; | 36 settingsHidePagesByDefaultForTest = true; |
| 37 }, | 37 }, |
| 38 | 38 |
| 39 /** @override */ | 39 /** @override */ |
| 40 setUp: function() { | 40 setUp: function() { |
| 41 SettingsPageBrowserTest.prototype.setUp.call(this); | 41 SettingsPageBrowserTest.prototype.setUp.call(this); |
| 42 // Explicitly hide all of the pages (not strictly required but is more | 42 // Explicitly hide all of the pages (not strictly required but is more |
| 43 // clear than relying on undefined -> hidden). | 43 // clear than relying on undefined -> hidden). |
| 44 this.toggleAdvanced(); |
| 44 this.hideSubPages_(); | 45 this.hideSubPages_(); |
| 45 }, | 46 }, |
| 46 | 47 |
| 47 /* | 48 /* |
| 48 * This will hide all subpages in |this.subPages|. Note: any existing subpages | 49 * This will hide all subpages in |this.subPages|. Note: any existing subpages |
| 49 * not listed in |this.subPages| will be shown. | 50 * not listed in |this.subPages| will be shown. |
| 50 */ | 51 */ |
| 51 hideSubPages_: function() { | 52 hideSubPages_: function() { |
| 52 var page = this.getPage(this.pageId); | 53 var page = this.getPage(this.pageId); |
| 53 var visibility = {}; | 54 var visibility = {}; |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 'downloads', | 140 'downloads', |
| 140 'reset', | 141 'reset', |
| 141 'a11y' | 142 'a11y' |
| 142 ]; | 143 ]; |
| 143 | 144 |
| 144 SettingsSubPageBrowserTest.call(this, 'advanced', subPages); | 145 SettingsSubPageBrowserTest.call(this, 'advanced', subPages); |
| 145 }; | 146 }; |
| 146 | 147 |
| 147 SettingsAdvancedSubPageBrowserTest.prototype = { | 148 SettingsAdvancedSubPageBrowserTest.prototype = { |
| 148 __proto__: SettingsSubPageBrowserTest.prototype, | 149 __proto__: SettingsSubPageBrowserTest.prototype, |
| 149 | |
| 150 /** @override */ | |
| 151 browsePreload: 'chrome://md-settings/advanced', | |
| 152 }; | 150 }; |
| 153 | 151 |
| 154 TEST_F('SettingsAdvancedSubPageBrowserTest', 'SubPages', function() { | 152 TEST_F('SettingsAdvancedSubPageBrowserTest', 'SubPages', function() { |
| 155 suite('Advanced', this.testSubPages.bind(this)); | 153 suite('Advanced', this.testSubPages.bind(this)); |
| 156 mocha.run(); | 154 mocha.run(); |
| 157 }); | 155 }); |
| OLD | NEW |