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