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.
6 * TestFixture for browser options WebUI testing.
7 * @extends {testing.Test}
10 function BrowserOptionsWebUITest() {}
12 BrowserOptionsWebUITest
.prototype = {
13 __proto__
: testing
.Test
.prototype,
16 browsePreload
: 'chrome://chrome/settings/',
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');
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'));
33 * TestFixture for the uber page when the browser options page has an overlay.
34 * @extends {testing.Test}
37 function BrowserOptionsOverlayWebUITest() {}
39 BrowserOptionsOverlayWebUITest
.prototype = {
40 __proto__
: testing
.Test
.prototype,
43 browsePreload
: 'chrome://chrome/settings/autofill',
49 TEST_F('BrowserOptionsOverlayWebUITest', 'testNavigationInBackground',
51 assertEquals(this.browsePreload
, document
.location
.href
);
53 if ($('navigation').classList
.contains('background')) {
58 // Wait for the message to be posted to the Uber page.
59 window
.addEventListener('message', function(e
) {
60 if (e
.data
.method
== 'beginInterceptingEvents') {
61 window
.setTimeout(function() {
62 assertTrue($('navigation').classList
.contains('background'));
70 * @extends {testing.Test}
73 function BrowserOptionsFrameWebUITest() {}
75 BrowserOptionsFrameWebUITest
.prototype = {
76 __proto__
: testing
.Test
.prototype,
79 browsePreload
: 'chrome://settings-frame/',
82 TEST_F('BrowserOptionsFrameWebUITest', 'testAdvancedSettingsHiddenByDefault',
84 assertEquals(this.browsePreload
, document
.location
.href
);
85 expectTrue($('advanced-settings').hidden
);
89 * @extends {testing.Test}
92 function AdvancedSettingsWebUITest() {}
94 AdvancedSettingsWebUITest
.prototype = {
95 __proto__
: testing
.Test
.prototype,
98 browsePreload
: 'chrome://settings-frame/autofill',
101 TEST_F('AdvancedSettingsWebUITest', 'testAdvancedSettingsShown', function() {
102 assertEquals(this.browsePreload
, document
.location
.href
);
103 expectFalse($('advanced-settings').hidden
);