Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / ui / webui / options / browser_options_browsertest.js
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 browser options WebUI testing.
7  * @extends {testing.Test}
8  * @constructor
9  */
10 function BrowserOptionsWebUITest() {}
11
12 BrowserOptionsWebUITest.prototype = {
13   __proto__: testing.Test.prototype,
14
15   /** @override */
16   browsePreload: 'chrome://chrome/settings/',
17 };
18
19 // Test opening the browser options has correct location.
20 // Times out on Mac debug only. See http://crbug.com/121030
21 GEN('#if defined(OS_MACOSX) && !defined(NDEBUG)');
22 GEN('#define MAYBE_testOpenBrowserOptions ' +
23     'DISABLED_testOpenBrowserOptions');
24 GEN('#else');
25 GEN('#define MAYBE_testOpenBrowserOptions testOpenBrowserOptions');
26 GEN('#endif  // defined(OS_MACOSX)');
27 TEST_F('BrowserOptionsWebUITest', 'MAYBE_testOpenBrowserOptions', function() {
28   assertEquals(this.browsePreload, document.location.href);
29   expectFalse($('navigation').classList.contains('background'));
30 });
31
32 /**
33  * TestFixture for the uber page when the browser options page has an overlay.
34  * @extends {testing.Test}
35  * @constructor
36  */
37 function BrowserOptionsOverlayWebUITest() {}
38
39 BrowserOptionsOverlayWebUITest.prototype = {
40   __proto__: testing.Test.prototype,
41
42   /** @override */
43   browsePreload: 'chrome://chrome/settings/autofill',
44 };
45
46 TEST_F('BrowserOptionsOverlayWebUITest', 'testNavigationInBackground',
47     function() {
48   assertEquals(this.browsePreload, document.location.href);
49   expectTrue($('navigation').classList.contains('background'));
50 });
51
52 /**
53  * @extends {testing.Test}
54  * @constructor
55  */
56 function BrowserOptionsFrameWebUITest() {}
57
58 BrowserOptionsFrameWebUITest.prototype = {
59   __proto__: testing.Test.prototype,
60
61   /** @override */
62   browsePreload: 'chrome://settings-frame/',
63 };
64
65 TEST_F('BrowserOptionsFrameWebUITest', 'testAdvancedSettingsHiddenByDefault',
66     function() {
67   assertEquals(this.browsePreload, document.location.href);
68   expectTrue($('advanced-settings').hidden);
69 });
70
71 /**
72  * @extends {testing.Test}
73  * @constructor
74  */
75 function AdvancedSettingsWebUITest() {}
76
77 AdvancedSettingsWebUITest.prototype = {
78   __proto__: testing.Test.prototype,
79
80   /** @override */
81   browsePreload: 'chrome://settings-frame/autofill',
82 };
83
84 TEST_F('AdvancedSettingsWebUITest', 'testAdvancedSettingsShown', function() {
85   assertEquals(this.browsePreload, document.location.href);
86   expectFalse($('advanced-settings').hidden);
87 });