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