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

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: Feedback 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
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() {});
dpapad 2015/11/18 21:09:53 Remove this test?
stevenjb 2015/11/18 23:23:29 This will fail if the page generates any asserts o
27
28 test('basic pages', function() {
29 var page = self.getPage('basic');
30 expectTrue(!!self.getSection(page, 'appearance'));
31 expectTrue(!!self.getSection(page, 'on-startup'));
32 expectTrue(!!self.getSection(page, 'search'));
33 if (!cr.isChromeOS) {
34 expectTrue(!!self.getSection(page, 'people'));
35 expectTrue(!!self.getSection(page, 'defaultBrowser'));
36 } else {
37 expectTrue(!!self.getSection(page, 'internet'));
38 expectTrue(!!self.getSection(page, 'users'));
39 }
40 });
41
42 test('advanced pages', function() {
43 var page = self.getPage('advanced');
44 expectTrue(!!self.getSection(page, 'location'));
45 expectTrue(!!self.getSection(page, 'privacy'));
46 expectTrue(!!self.getSection(page, 'passwordsAndForms'));
47 expectTrue(!!self.getSection(page, 'languages'));
48 expectTrue(!!self.getSection(page, 'downloads'));
49 expectTrue(!!self.getSection(page, 'reset'));
50
51 if (cr.isChromeOS) {
52 expectTrue(!!self.getSection(page, 'dateTime'));
53 expectTrue(!!self.getSection(page, 'bluetooth'));
54 expectTrue(!!self.getSection(page, 'a11y'));
55 }
56 });
57 });
58
59 // Run all registered tests.
60 mocha.run();
61 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698