Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(294)

Side by Side Diff: chrome/test/data/webui/settings/main_page_browsertest.js

Issue 1457543004: Add Mocha based tests for Settings pages (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/chrome_tests.gypi ('k') | chrome/test/data/webui/settings/settings_page_browsertest.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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 });
OLDNEW
« no previous file with comments | « chrome/chrome_tests.gypi ('k') | chrome/test/data/webui/settings/settings_page_browsertest.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698