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 GEN('#include "chrome/browser/ui/webui/options/options_browsertest.h"'); | 5 GEN('#include "chrome/browser/ui/webui/options/options_browsertest.h"'); |
6 | 6 |
7 /** @const */ var SUPERVISED_USERS_PREF = 'profile.managed_users'; | 7 /** @const */ var SUPERVISED_USERS_PREF = 'profile.managed_users'; |
8 | 8 |
9 /** | 9 /** |
10 * Wait for the method specified by |methodName|, on the |object| object, to be | 10 * Wait for the method specified by |methodName|, on the |object| object, to be |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 // Crashes on Mac only. See http://crbug.com/79181 | 92 // Crashes on Mac only. See http://crbug.com/79181 |
93 GEN('#if defined(OS_MACOSX)'); | 93 GEN('#if defined(OS_MACOSX)'); |
94 GEN('#define MAYBE_testSetBooleanPrefTriggers ' + | 94 GEN('#define MAYBE_testSetBooleanPrefTriggers ' + |
95 'DISABLED_testSetBooleanPrefTriggers'); | 95 'DISABLED_testSetBooleanPrefTriggers'); |
96 GEN('#else'); | 96 GEN('#else'); |
97 GEN('#define MAYBE_testSetBooleanPrefTriggers testSetBooleanPrefTriggers'); | 97 GEN('#define MAYBE_testSetBooleanPrefTriggers testSetBooleanPrefTriggers'); |
98 GEN('#endif // defined(OS_MACOSX)'); | 98 GEN('#endif // defined(OS_MACOSX)'); |
99 | 99 |
100 TEST_F('OptionsWebUITest', 'MAYBE_testSetBooleanPrefTriggers', function() { | 100 TEST_F('OptionsWebUITest', 'MAYBE_testSetBooleanPrefTriggers', function() { |
101 // TODO(dtseng): make generic to click all buttons. | 101 // TODO(dtseng): make generic to click all buttons. |
102 var showHomeButton = $('show-home-button'); | 102 var showHomeButton = |
| 103 document.querySelector('input[pref="browser.show_home_button"]'); |
103 var trueListValue = [ | 104 var trueListValue = [ |
104 'browser.show_home_button', | 105 'browser.show_home_button', |
105 true, | 106 true, |
106 'Options_Homepage_HomeButton', | 107 'Options_Homepage_HomeButton', |
107 ]; | 108 ]; |
108 // Note: this expectation is checked in testing::Test::tearDown. | 109 // Note: this expectation is checked in testing::Test::tearDown. |
109 this.mockHandler.expects(once()).setBooleanPref(trueListValue); | 110 this.mockHandler.expects(once()).setBooleanPref(trueListValue); |
110 | 111 |
111 // Cause the handler to be called. | 112 // Cause the handler to be called. |
112 showHomeButton.click(); | 113 showHomeButton.click(); |
(...skipping 720 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
833 __proto__: OptionsWebUIExtendedTest.prototype, | 834 __proto__: OptionsWebUIExtendedTest.prototype, |
834 | 835 |
835 /** @override */ | 836 /** @override */ |
836 browsePreload: 'chrome://settings-frame/nonexistantPage', | 837 browsePreload: 'chrome://settings-frame/nonexistantPage', |
837 }; | 838 }; |
838 | 839 |
839 TEST_F('OptionsWebUIRedirectTest', 'TestURL', function() { | 840 TEST_F('OptionsWebUIRedirectTest', 'TestURL', function() { |
840 assertEquals('chrome://settings-frame/', document.location.href); | 841 assertEquals('chrome://settings-frame/', document.location.href); |
841 this.verifyHistory_([''], testDone); | 842 this.verifyHistory_([''], testDone); |
842 }); | 843 }); |
OLD | NEW |