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 28 matching lines...) Expand all Loading... |
39 * TestFixture for OptionsPage WebUI testing. | 39 * TestFixture for OptionsPage WebUI testing. |
40 * @extends {testing.Test} | 40 * @extends {testing.Test} |
41 * @constructor | 41 * @constructor |
42 */ | 42 */ |
43 function OptionsWebUITest() {} | 43 function OptionsWebUITest() {} |
44 | 44 |
45 OptionsWebUITest.prototype = { | 45 OptionsWebUITest.prototype = { |
46 __proto__: testing.Test.prototype, | 46 __proto__: testing.Test.prototype, |
47 | 47 |
48 /** @override */ | 48 /** @override */ |
49 runAccessibilityChecks: true, | |
50 | |
51 /** @override */ | |
52 accessibilityIssuesAreErrors: true, | 49 accessibilityIssuesAreErrors: true, |
53 | 50 |
54 /** @override */ | 51 /** @override */ |
55 setUp: function() { | 52 setUp: function() { |
56 // user-image-stream is a streaming video element used for capturing a | 53 // user-image-stream is a streaming video element used for capturing a |
57 // user image during OOBE. | 54 // user image during OOBE. |
58 this.accessibilityAuditConfig.ignoreSelectors('videoWithoutCaptions', | 55 this.accessibilityAuditConfig.ignoreSelectors('videoWithoutCaptions', |
59 '.user-image-stream'); | 56 '.user-image-stream'); |
60 }, | 57 }, |
61 | 58 |
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 | 373 |
377 testGenPreamble: function() { | 374 testGenPreamble: function() { |
378 // Start with no supervised users managed by this profile. | 375 // Start with no supervised users managed by this profile. |
379 GEN(' ClearPref("' + SUPERVISED_USERS_PREF + '");'); | 376 GEN(' ClearPref("' + SUPERVISED_USERS_PREF + '");'); |
380 }, | 377 }, |
381 | 378 |
382 /** @override */ | 379 /** @override */ |
383 isAsync: true, | 380 isAsync: true, |
384 | 381 |
385 /** @override */ | 382 /** @override */ |
386 runAccessibilityChecks: true, | |
387 | |
388 /** @override */ | |
389 accessibilityIssuesAreErrors: true, | |
390 | |
391 /** @override */ | |
392 setUp: function() { | 383 setUp: function() { |
393 // user-image-stream is a streaming video element used for capturing a | 384 // user-image-stream is a streaming video element used for capturing a |
394 // user image during OOBE. | 385 // user image during OOBE. |
395 this.accessibilityAuditConfig.ignoreSelectors('videoWithoutCaptions', | 386 this.accessibilityAuditConfig.ignoreSelectors('videoWithoutCaptions', |
396 '.user-image-stream'); | 387 '.user-image-stream'); |
397 }, | 388 }, |
398 | 389 |
399 /** | 390 /** |
400 * Asserts that two non-nested arrays are equal. The arrays must contain only | 391 * Asserts that two non-nested arrays are equal. The arrays must contain only |
401 * plain data types, no nested arrays or other objects. | 392 * plain data types, no nested arrays or other objects. |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
710 this.verifyOpenPages_(['settings', 'search', 'languages'], 'languages#2'); | 701 this.verifyOpenPages_(['settings', 'search', 'languages'], 'languages#2'); |
711 this.verifyHistory_( | 702 this.verifyHistory_( |
712 ['', 'search#1', 'languages#2', 'addLanguage#3', 'languages#2'], | 703 ['', 'search#1', 'languages#2', 'addLanguage#3', 'languages#2'], |
713 function() { | 704 function() { |
714 // Close the layer-1 overlay. | 705 // Close the layer-1 overlay. |
715 PageManager.closeOverlay(); | 706 PageManager.closeOverlay(); |
716 this.verifyOpenPages_(['settings', 'search'], 'search#1'); | 707 this.verifyOpenPages_(['settings', 'search'], 'search#1'); |
717 this.verifyHistory_( | 708 this.verifyHistory_( |
718 ['', 'search#1', 'languages#2', 'addLanguage#3', 'languages#2', | 709 ['', 'search#1', 'languages#2', 'addLanguage#3', 'languages#2', |
719 'search#1'], | 710 'search#1'], |
720 function() { | 711 testDone); |
721 document.addEventListener('webkitTransitionEnd', function f(e) { | |
722 document.removeEventListener('webkitTransitionEnd', f); | |
723 testDone(); | |
724 }); | |
725 }); | |
726 }.bind(this)); | 712 }.bind(this)); |
727 }.bind(this)); | 713 }.bind(this)); |
728 }); | 714 }); |
729 | 715 |
730 // Test that closing an overlay that did not push history when opening does not | 716 // Test that closing an overlay that did not push history when opening does not |
731 // again push history. | 717 // again push history. |
732 TEST_F('OptionsWebUIExtendedTest', 'CloseOverlayNoHistory', function() { | 718 TEST_F('OptionsWebUIExtendedTest', 'CloseOverlayNoHistory', function() { |
733 // Open the do not track confirmation prompt. | 719 // Open the do not track confirmation prompt. |
734 PageManager.showPageByName('doNotTrackConfirm', false); | 720 PageManager.showPageByName('doNotTrackConfirm', false); |
735 | 721 |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
887 __proto__: OptionsWebUIExtendedTest.prototype, | 873 __proto__: OptionsWebUIExtendedTest.prototype, |
888 | 874 |
889 /** @override */ | 875 /** @override */ |
890 browsePreload: 'chrome://settings-frame/nonexistantPage', | 876 browsePreload: 'chrome://settings-frame/nonexistantPage', |
891 }; | 877 }; |
892 | 878 |
893 TEST_F('OptionsWebUIRedirectTest', 'TestURL', function() { | 879 TEST_F('OptionsWebUIRedirectTest', 'TestURL', function() { |
894 assertEquals('chrome://settings-frame/', document.location.href); | 880 assertEquals('chrome://settings-frame/', document.location.href); |
895 this.verifyHistory_([''], testDone); | 881 this.verifyHistory_([''], testDone); |
896 }); | 882 }); |
OLD | NEW |