OLD | NEW |
| (Empty) |
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 GEN_INCLUDE(['options_browsertest_base.js']); | |
6 | |
7 /** | |
8 * TestFixture for browser options WebUI testing. | |
9 * @extends {testing.Test} | |
10 * @constructor | |
11 */ | |
12 function BrowserOptionsWebUITest() {} | |
13 | |
14 BrowserOptionsWebUITest.prototype = { | |
15 __proto__: testing.Test.prototype, | |
16 | |
17 /** @override */ | |
18 browsePreload: 'chrome://chrome/settings/', | |
19 }; | |
20 | |
21 // Test opening the browser options has correct location. | |
22 // Times out on Mac debug only. See http://crbug.com/121030 | |
23 GEN('#if defined(OS_MACOSX) && !defined(NDEBUG)'); | |
24 GEN('#define MAYBE_testOpenBrowserOptions ' + | |
25 'DISABLED_testOpenBrowserOptions'); | |
26 GEN('#else'); | |
27 GEN('#define MAYBE_testOpenBrowserOptions testOpenBrowserOptions'); | |
28 GEN('#endif // defined(OS_MACOSX)'); | |
29 TEST_F('BrowserOptionsWebUITest', 'MAYBE_testOpenBrowserOptions', function() { | |
30 assertEquals(this.browsePreload, document.location.href); | |
31 expectFalse($('navigation').classList.contains('background')); | |
32 }); | |
33 | |
34 /** | |
35 * TestFixture for the uber page when the browser options page has an overlay. | |
36 * @extends {testing.Test} | |
37 * @constructor | |
38 */ | |
39 function BrowserOptionsOverlayWebUITest() {} | |
40 | |
41 BrowserOptionsOverlayWebUITest.prototype = { | |
42 __proto__: testing.Test.prototype, | |
43 | |
44 /** @override */ | |
45 browsePreload: 'chrome://chrome/settings/autofill', | |
46 | |
47 /** @override */ | |
48 isAsync: true, | |
49 }; | |
50 | |
51 TEST_F('BrowserOptionsOverlayWebUITest', 'testNavigationInBackground', | |
52 function() { | |
53 assertEquals(this.browsePreload, document.location.href); | |
54 | |
55 if ($('navigation').classList.contains('background')) { | |
56 testDone(); | |
57 return; | |
58 } | |
59 | |
60 // Wait for the message to be posted to the Uber page. | |
61 window.addEventListener('message', function(e) { | |
62 if (e.data.method == 'beginInterceptingEvents') { | |
63 window.setTimeout(function() { | |
64 assertTrue($('navigation').classList.contains('background')); | |
65 testDone(); | |
66 }); | |
67 } | |
68 }); | |
69 }); | |
70 | |
71 /** | |
72 * @extends {testing.Test} | |
73 * @constructor | |
74 */ | |
75 function BrowserOptionsFrameWebUITest() {} | |
76 | |
77 BrowserOptionsFrameWebUITest.prototype = { | |
78 __proto__: OptionsBrowsertestBase.prototype, | |
79 | |
80 /** @override */ | |
81 browsePreload: 'chrome://settings-frame/', | |
82 | |
83 /** @override */ | |
84 setUp: function() { | |
85 OptionsBrowsertestBase.prototype.setUp.call(this); | |
86 | |
87 // Enable when failure is resolved. | |
88 // AX_TEXT_04: http://crbug.com/570721 | |
89 this.accessibilityAuditConfig.ignoreSelectors( | |
90 'linkWithUnclearPurpose', | |
91 '#sync-overview > A'); | |
92 | |
93 // Enable when failure is resolved. | |
94 // AX_ARIA_10: http://crbug.com/570723 | |
95 this.accessibilityAuditConfig.ignoreSelectors( | |
96 'unsupportedAriaAttribute', | |
97 '#profiles-list'); | |
98 }, | |
99 }; | |
100 | |
101 TEST_F('BrowserOptionsFrameWebUITest', 'testAdvancedSettingsHiddenByDefault', | |
102 function() { | |
103 assertEquals(this.browsePreload, document.location.href); | |
104 expectTrue($('advanced-settings').hidden); | |
105 }); | |
106 | |
107 /** | |
108 * @extends {testing.Test} | |
109 * @constructor | |
110 */ | |
111 function AdvancedSettingsWebUITest() {} | |
112 | |
113 AdvancedSettingsWebUITest.prototype = { | |
114 __proto__: OptionsBrowsertestBase.prototype, | |
115 | |
116 /** @override */ | |
117 browsePreload: 'chrome://settings-frame/autofill', | |
118 }; | |
119 | |
120 // TODO(crbug.com/617066) Flakes on Win. | |
121 GEN('#if defined(OS_WIN)'); | |
122 GEN('#define MAYBE_testAdvancedSettingsShown ' + | |
123 'DISABLED_testAdvancedSettingsShown'); | |
124 GEN('#else'); | |
125 GEN('#define MAYBE_testAdvancedSettingsShown testAdvancedSettingsShown'); | |
126 GEN('#endif'); | |
127 TEST_F('AdvancedSettingsWebUITest', 'MAYBE_testAdvancedSettingsShown', | |
128 function() { | |
129 assertEquals(this.browsePreload, document.location.href); | |
130 expectFalse($('advanced-settings').hidden); | |
131 }); | |
OLD | NEW |