OLD | NEW |
---|---|
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 Material Help page tests. */ | 5 /** @fileoverview Material Help page tests. */ |
6 | 6 |
7 GEN_INCLUDE(['settings_page_browsertest.js']); | 7 GEN_INCLUDE(['settings_page_browsertest.js']); |
8 GEN('#include "base/command_line.h"'); | 8 GEN('#include "base/command_line.h"'); |
9 | 9 |
10 /** | 10 /** |
11 * @constructor | 11 * @constructor |
12 * @extends {SettingsPageBrowserTest} | 12 * @extends {SettingsPageBrowserTest} |
13 */ | 13 */ |
14 function SettingsHelpPageBrowserTest() {} | 14 function SettingsHelpPageBrowserTest() {} |
15 | 15 |
16 SettingsHelpPageBrowserTest.prototype = { | 16 SettingsHelpPageBrowserTest.prototype = { |
17 __proto__: SettingsPageBrowserTest.prototype, | 17 __proto__: SettingsPageBrowserTest.prototype, |
18 | 18 |
19 /** @override */ | 19 /** @override */ |
20 browsePreload: 'chrome://help/', | 20 browsePreload: 'chrome://help/', |
21 | 21 |
22 commandLineSwitches: [{switchName: 'enable-features', | 22 commandLineSwitches: [{switchName: 'enable-features', |
23 switchValue: 'MaterialDesignSettings'}], | 23 switchValue: 'MaterialDesignSettings'}], |
24 | 24 |
25 /** @override */ | 25 /** @override */ |
26 extraLibraries: PolymerTest.getLibraries(ROOT_PATH), | 26 extraLibraries: PolymerTest.getLibraries(ROOT_PATH), |
27 | |
28 /** @override */ | |
29 setUp: function() { | |
Dan Beam
2017/03/17 00:30:05
why can't we just make .basicPage null in tests?
dpapad
2017/03/17 20:53:55
Not fully understanding the suggestion. Overriding
| |
30 PolymerTest.prototype.setUp.call(this); | |
31 }, | |
27 }; | 32 }; |
28 | 33 |
29 TEST_F('SettingsHelpPageBrowserTest', 'Load', function() { | 34 TEST_F('SettingsHelpPageBrowserTest', 'Load', function() { |
30 // Assign |self| to |this| instead of binding since 'this' in suite() | 35 // Assign |self| to |this| instead of binding since 'this' in suite() |
31 // and test() will be a Mocha 'Suite' or 'Test' instance. | 36 // and test() will be a Mocha 'Suite' or 'Test' instance. |
32 var self = this; | 37 var self = this; |
33 | 38 |
34 // Register mocha tests. | 39 // Register mocha tests. |
35 suite('Help page', function() { | 40 suite('Help page', function() { |
36 test('about section', function() { | 41 test('about section', function() { |
37 var page = self.getPage('about'); | 42 return self.getPage('about').then(function(page) { |
38 expectTrue(!!self.getSection(page, 'about')); | 43 expectTrue(!!self.getSection(page, 'about')); |
44 }); | |
39 }); | 45 }); |
40 }); | 46 }); |
41 | 47 |
42 // Run all registered tests. | 48 // Run all registered tests. |
43 mocha.run(); | 49 mocha.run(); |
44 }); | 50 }); |
OLD | NEW |