Chromium Code Reviews| 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 // Polymer BrowserTest fixture. | |
|
michaelpg
2015/11/18 02:00:32
// SettingsPageBrowserTest. (or no comment)
stevenjb
2015/11/18 20:02:33
Done.
| |
| 8 GEN_INCLUDE(['settings_page_browsertest.js']); | |
| 9 | |
| 10 /** | |
| 11 * @constructor | |
| 12 * @extends {PolymerTest} | |
|
michaelpg
2015/11/18 02:00:32
{SettingsPageBrowserTest}
stevenjb
2015/11/18 20:02:33
Done.
| |
| 13 */ | |
| 14 function SettingsMainPageBrowserTest() {} | |
| 15 | |
| 16 SettingsMainPageBrowserTest.prototype = { | |
| 17 __proto__: SettingsPageBrowserTest.prototype, | |
| 18 | |
| 19 registerTests: function() { | |
| 20 var self = this; | |
| 21 suite('SettingsPage', function() { | |
| 22 test('load page', function() {}); | |
| 23 | |
| 24 test('basic pages', function() { | |
| 25 var page = self.getPage('basic'); | |
| 26 expectTrue(!!self.getSection(page, 'appearance')); | |
| 27 expectTrue(!!self.getSection(page, 'on-startup')); | |
| 28 expectTrue(!!self.getSection(page, 'search')); | |
| 29 if (!cr.isChromeOS) { | |
| 30 expectTrue(!!self.getSection(page, 'people')); | |
| 31 expectTrue(!!self.getSection(page, 'defaultBrowser')); | |
| 32 } else { | |
| 33 expectTrue(!!self.getSection(page, 'internet')); | |
| 34 expectTrue(!!self.getSection(page, 'users')); | |
| 35 } | |
| 36 }); | |
|
dpapad
2015/11/18 01:44:54
Nit: How about avoiding "var self = this" by just
michaelpg
2015/11/18 02:00:32
Not binding was my suggestion. First of all it's a
stevenjb
2015/11/18 20:02:33
Added a comment.
dpapad
2015/11/18 21:09:53
Thanks for the information. Did not know that "thi
| |
| 37 | |
| 38 test('advanced pages', function() { | |
| 39 var page = self.getPage('advanced'); | |
| 40 expectTrue(!!self.getSection(page, 'location')); | |
| 41 expectTrue(!!self.getSection(page, 'privacy')); | |
| 42 expectTrue(!!self.getSection(page, 'passwordsAndForms')); | |
| 43 expectTrue(!!self.getSection(page, 'languages')); | |
| 44 expectTrue(!!self.getSection(page, 'downloads')); | |
| 45 expectTrue(!!self.getSection(page, 'reset')); | |
| 46 | |
| 47 if (cr.isChromeOS) { | |
| 48 expectTrue(!!self.getSection(page, 'dateTime')); | |
| 49 expectTrue(!!self.getSection(page, 'bluetooth')); | |
| 50 expectTrue(!!self.getSection(page, 'a11y')); | |
| 51 } | |
| 52 }); | |
| 53 }); | |
| 54 } | |
| 55 }; | |
| 56 | |
| 57 TEST_F('SettingsMainPageBrowserTest', 'Main', function() { | |
| 58 // Register mocha tests. | |
| 59 this.registerTests(); | |
|
michaelpg
2015/11/18 02:00:32
I don't see much of a reason to register these tes
stevenjb
2015/11/18 20:02:33
Done.
| |
| 60 | |
| 61 // Run all registered tests. | |
| 62 mocha.run(); | |
| 63 }); | |
| OLD | NEW |