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 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 // Verify that preventDefault() is called on 'Enter' keydown events that trigger | 314 // 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 | 315 // 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 | 316 // focus (by the overlay closing for instance), will execute in addition to the |
317 // default button. See crbug.com/268336. | 317 // default button. See crbug.com/268336. |
318 TEST_F('OptionsWebUITest', 'EnterPreventsDefault', function() { | 318 TEST_F('OptionsWebUITest', 'EnterPreventsDefault', function() { |
319 var page = HomePageOverlay.getInstance(); | 319 var page = HomePageOverlay.getInstance(); |
320 PageManager.showPageByName(page.name); | 320 PageManager.showPageByName(page.name); |
321 var event = new KeyboardEvent('keydown', { | 321 var event = new KeyboardEvent('keydown', { |
322 'bubbles': true, | 322 'bubbles': true, |
323 'cancelable': true, | 323 'cancelable': true, |
324 'keyIdentifier': 'Enter' | 324 'key': 'Enter' |
325 }); | 325 }); |
326 assertFalse(event.defaultPrevented); | 326 assertFalse(event.defaultPrevented); |
327 page.pageDiv.dispatchEvent(event); | 327 page.pageDiv.dispatchEvent(event); |
328 assertTrue(event.defaultPrevented); | 328 assertTrue(event.defaultPrevented); |
329 testDone(); | 329 testDone(); |
330 }); | 330 }); |
331 | 331 |
332 // Verifies that sending an empty list of indexes to move doesn't crash chrome. | 332 // Verifies that sending an empty list of indexes to move doesn't crash chrome. |
333 TEST_F('OptionsWebUITest', 'emptySelectedIndexesDoesntCrash', function() { | 333 TEST_F('OptionsWebUITest', 'emptySelectedIndexesDoesntCrash', function() { |
334 chrome.send('dragDropStartupPage', [0, []]); | 334 chrome.send('dragDropStartupPage', [0, []]); |
(...skipping 623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
958 __proto__: OptionsWebUIExtendedTest.prototype, | 958 __proto__: OptionsWebUIExtendedTest.prototype, |
959 | 959 |
960 /** @override */ | 960 /** @override */ |
961 browsePreload: 'chrome://settings-frame/nonexistantPage', | 961 browsePreload: 'chrome://settings-frame/nonexistantPage', |
962 }; | 962 }; |
963 | 963 |
964 TEST_F('OptionsWebUIRedirectTest', 'TestURL', function() { | 964 TEST_F('OptionsWebUIRedirectTest', 'TestURL', function() { |
965 assertEquals('chrome://settings-frame/', document.location.href); | 965 assertEquals('chrome://settings-frame/', document.location.href); |
966 this.verifyHistory_([''], testDone); | 966 this.verifyHistory_([''], testDone); |
967 }); | 967 }); |
OLD | NEW |