OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 /** | 5 /** |
6 * TestFixture for extension settings WebUI testing. | 6 * TestFixture for extension settings WebUI testing. |
7 * @extends {testing.Test} | 7 * @extends {testing.Test} |
8 * @constructor | 8 * @constructor |
9 */ | 9 */ |
10 function HelpPageWebUITest() {} | 10 function HelpPageWebUITest() {} |
11 | 11 |
12 HelpPageWebUITest.prototype = { | 12 HelpPageWebUITest.prototype = { |
13 __proto__: testing.Test.prototype, | 13 __proto__: testing.Test.prototype, |
14 | 14 |
15 browsePreload: 'chrome://help-frame/', | 15 browsePreload: 'chrome://help-frame/', |
16 }; | 16 }; |
17 | 17 |
18 // Test opening extension settings has correct location. | 18 // Test opening extension settings has correct location. |
19 TEST_F('HelpPageWebUITest', 'testOpenHelpPage', function() { | 19 TEST_F('HelpPageWebUITest', 'testOpenHelpPage', function() { |
20 assertEquals(this.browsePreload, document.location.href); | 20 assertEquals(this.browsePreload, document.location.href); |
21 }); | 21 }); |
22 | |
23 GEN('#if defined(OS_LINUX) || defined(GOOGLE_CHROME_BUILD)'); | |
24 | |
25 // Test that repeated calls to setUpdateStatus work. | |
26 TEST_F('HelpPageWebUITest', 'testUpdateState', function() { | |
27 expectTrue($('update-status-container').hidden); | |
28 | |
29 help.HelpPage.setUpdateStatus('disabled', ''); | |
30 expectTrue($('relaunch').hidden); | |
31 expectTrue($('update-status-container').hidden); | |
32 | |
33 help.HelpPage.setUpdateStatus('nearly_updated', ''); | |
34 expectTrue(!$('relaunch').hidden); | |
35 expectTrue(!$('update-status-container').hidden); | |
36 | |
37 help.HelpPage.setUpdateStatus('disabled', ''); | |
38 expectTrue($('relaunch').hidden); | |
39 expectTrue($('update-status-container').hidden); | |
40 }); | |
41 | |
42 GEN('#endif'); | |
OLD | NEW |