| 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(['options_browsertest_base.js']); | 5 GEN_INCLUDE(['options_browsertest_base.js']); |
| 6 GEN('#include "chrome/browser/ui/webui/options/options_browsertest.h"'); | 6 GEN('#include "chrome/browser/ui/webui/options/options_browsertest.h"'); |
| 7 | 7 |
| 8 /** @const */ var SUPERVISED_USERS_PREF = 'profile.managed_users'; | 8 /** @const */ var SUPERVISED_USERS_PREF = 'profile.managed_users'; |
| 9 | 9 |
| 10 /** | 10 /** |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 testDone(); | 304 testDone(); |
| 305 }, 0); | 305 }, 0); |
| 306 }; | 306 }; |
| 307 this.mockHandler.expects(once()).setBooleanPref( | 307 this.mockHandler.expects(once()).setBooleanPref( |
| 308 eq(['enable_do_not_track', false, 'Options_DoNotTrackCheckbox'])).will( | 308 eq(['enable_do_not_track', false, 'Options_DoNotTrackCheckbox'])).will( |
| 309 callFunction(verifyCorrectEndState)); | 309 callFunction(verifyCorrectEndState)); |
| 310 | 310 |
| 311 dntCheckbox.click(); | 311 dntCheckbox.click(); |
| 312 }); | 312 }); |
| 313 | 313 |
| 314 // Fails on chromeos, http://crbug.com/660867 |
| 314 // Verify that preventDefault() is called on 'Enter' keydown events that trigger | 315 // Verify that preventDefault() is called on 'Enter' keydown events that trigger |
| 315 // the default button. If this doesn't happen, other elements that may get | 316 // the default button. If this doesn't happen, other elements that may get |
| 316 // focus (by the overlay closing for instance), will execute in addition to the | 317 // focus (by the overlay closing for instance), will execute in addition to the |
| 317 // default button. See crbug.com/268336. | 318 // default button. See crbug.com/268336. |
| 318 TEST_F('OptionsWebUITest', 'EnterPreventsDefault', function() { | 319 TEST_F('OptionsWebUITest', 'DISABLED_EnterPreventsDefault', function() { |
| 319 var page = HomePageOverlay.getInstance(); | 320 var page = HomePageOverlay.getInstance(); |
| 320 PageManager.showPageByName(page.name); | 321 PageManager.showPageByName(page.name); |
| 321 var event = new KeyboardEvent('keydown', { | 322 var event = new KeyboardEvent('keydown', { |
| 322 'bubbles': true, | 323 'bubbles': true, |
| 323 'cancelable': true, | 324 'cancelable': true, |
| 324 'key': 'Enter' | 325 'key': 'Enter' |
| 325 }); | 326 }); |
| 326 assertFalse(event.defaultPrevented); | 327 assertFalse(event.defaultPrevented); |
| 327 page.pageDiv.dispatchEvent(event); | 328 page.pageDiv.dispatchEvent(event); |
| 328 assertTrue(event.defaultPrevented); | 329 assertTrue(event.defaultPrevented); |
| (...skipping 629 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 958 __proto__: OptionsWebUIExtendedTest.prototype, | 959 __proto__: OptionsWebUIExtendedTest.prototype, |
| 959 | 960 |
| 960 /** @override */ | 961 /** @override */ |
| 961 browsePreload: 'chrome://settings-frame/nonexistantPage', | 962 browsePreload: 'chrome://settings-frame/nonexistantPage', |
| 962 }; | 963 }; |
| 963 | 964 |
| 964 TEST_F('OptionsWebUIRedirectTest', 'TestURL', function() { | 965 TEST_F('OptionsWebUIRedirectTest', 'TestURL', function() { |
| 965 assertEquals('chrome://settings-frame/', document.location.href); | 966 assertEquals('chrome://settings-frame/', document.location.href); |
| 966 this.verifyHistory_([''], testDone); | 967 this.verifyHistory_([''], testDone); |
| 967 }); | 968 }); |
| OLD | NEW |