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