OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 /** @fileoverview Suite of tests for the Settings main page. */ |
| 6 |
| 7 GEN_INCLUDE(['settings_page_browsertest.js']); |
| 8 |
| 9 /** |
| 10 * @constructor |
| 11 * @extends {SettingsPageBrowserTest} |
| 12 */ |
| 13 function SettingsMainPageBrowserTest() {} |
| 14 |
| 15 SettingsMainPageBrowserTest.prototype = { |
| 16 __proto__: SettingsPageBrowserTest.prototype |
| 17 }; |
| 18 |
| 19 TEST_F('SettingsMainPageBrowserTest', 'Main', function() { |
| 20 // Assign |self| to |this| instead of binding since 'this' in suite() |
| 21 // and test() will be a Mocha 'Suite' or 'Test' instance. |
| 22 var self = this; |
| 23 |
| 24 // Register mocha tests. |
| 25 suite('SettingsPage', function() { |
| 26 test('load page', function() { |
| 27 // This will fail if there are any asserts or errors in the Settings page. |
| 28 }); |
| 29 |
| 30 test('basic pages', function() { |
| 31 var page = self.getPage('basic'); |
| 32 expectTrue(!!self.getSection(page, 'appearance')); |
| 33 expectTrue(!!self.getSection(page, 'on-startup')); |
| 34 expectTrue(!!self.getSection(page, 'search')); |
| 35 if (!cr.isChromeOS) { |
| 36 expectTrue(!!self.getSection(page, 'people')); |
| 37 expectTrue(!!self.getSection(page, 'defaultBrowser')); |
| 38 } else { |
| 39 expectTrue(!!self.getSection(page, 'internet')); |
| 40 expectTrue(!!self.getSection(page, 'users')); |
| 41 } |
| 42 }); |
| 43 |
| 44 test('advanced pages', function() { |
| 45 var page = self.getPage('advanced'); |
| 46 expectTrue(!!self.getSection(page, 'location')); |
| 47 expectTrue(!!self.getSection(page, 'privacy')); |
| 48 expectTrue(!!self.getSection(page, 'passwordsAndForms')); |
| 49 expectTrue(!!self.getSection(page, 'languages')); |
| 50 expectTrue(!!self.getSection(page, 'downloads')); |
| 51 expectTrue(!!self.getSection(page, 'reset')); |
| 52 |
| 53 if (cr.isChromeOS) { |
| 54 expectTrue(!!self.getSection(page, 'dateTime')); |
| 55 expectTrue(!!self.getSection(page, 'bluetooth')); |
| 56 expectTrue(!!self.getSection(page, 'a11y')); |
| 57 } |
| 58 }); |
| 59 }); |
| 60 |
| 61 // Run all registered tests. |
| 62 mocha.run(); |
| 63 }); |
OLD | NEW |