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 Prototype for Settings page tests. */ | 5 /** @fileoverview Prototype for Settings page tests. */ |
6 | 6 |
7 /** @const {string} Path to root from chrome/test/data/webui/settings/. */ | 7 /** @const {string} Path to root from chrome/test/data/webui/settings/. */ |
8 var ROOT_PATH = '../../../../../'; | 8 var ROOT_PATH = '../../../../../'; |
9 | 9 |
10 // Polymer BrowserTest fixture. | 10 // Polymer BrowserTest fixture. |
(...skipping 11 matching lines...) Expand all Loading... |
22 | 22 |
23 /** @override */ | 23 /** @override */ |
24 browsePreload: 'chrome://md-settings/', | 24 browsePreload: 'chrome://md-settings/', |
25 | 25 |
26 /** @override */ | 26 /** @override */ |
27 extraLibraries: PolymerTest.getLibraries(ROOT_PATH), | 27 extraLibraries: PolymerTest.getLibraries(ROOT_PATH), |
28 | 28 |
29 /** @override */ | 29 /** @override */ |
30 runAccessibilityChecks: false, | 30 runAccessibilityChecks: false, |
31 | 31 |
| 32 /** @override */ |
| 33 setUp: function() { |
| 34 suiteSetup(function() { |
| 35 return CrSettingsPrefs.initialized; |
| 36 }); |
| 37 }, |
| 38 |
32 /** | 39 /** |
33 * @param {string} type The settings page type, e.g. 'advanced' or 'basic'. | 40 * @param {string} type The settings page type, e.g. 'advanced' or 'basic'. |
34 * @return {Node} The DOM node for the page. | 41 * @return {Node} The DOM node for the page. |
35 */ | 42 */ |
36 getPage: function(type) { | 43 getPage: function(type) { |
37 var settings = document.querySelector('cr-settings'); | 44 var settings = document.querySelector('cr-settings'); |
38 assertTrue(!!settings); | 45 assertTrue(!!settings); |
39 var settingsUi = settings.shadowRoot.querySelector('settings-ui'); | 46 var settingsUi = settings.shadowRoot.querySelector('settings-ui'); |
40 assertTrue(!!settingsUi); | 47 assertTrue(!!settingsUi); |
41 var settingsMain = settingsUi.shadowRoot.querySelector('settings-main'); | 48 var settingsMain = settingsUi.shadowRoot.querySelector('settings-main'); |
(...skipping 18 matching lines...) Expand all Loading... |
60 assertGT(len, 0); | 67 assertGT(len, 0); |
61 for (var i = 0; i < len; ++i) { | 68 for (var i = 0; i < len; ++i) { |
62 var s = sections[i]; | 69 var s = sections[i]; |
63 if (s.section == section) | 70 if (s.section == section) |
64 return s; | 71 return s; |
65 } | 72 } |
66 assertNotReached('Section not found: ' + section + ' in ' + page); | 73 assertNotReached('Section not found: ' + section + ' in ' + page); |
67 return undefined; | 74 return undefined; |
68 }, | 75 }, |
69 }; | 76 }; |
OLD | NEW |