Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(477)

Side by Side Diff: chrome/browser/resources/sync_setup_overlay.js

Issue 8503003: Seed test for SyncUI: sign in successfully with mocks. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added comments and moved gaia login to test. Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 cr.define('options', function() { 5 cr.define('options', function() {
6 const OptionsPage = options.OptionsPage; 6 const OptionsPage = options.OptionsPage;
7 7
8 // Variable to track if a captcha challenge was issued. If this gets set to 8 // Variable to track if a captcha challenge was issued. If this gets set to
9 // true, it stays that way until we are told about successful login from 9 // true, it stays that way until we are told about successful login from
10 // the browser. This means subsequent errors (like invalid password) are 10 // the browser. This means subsequent errors (like invalid password) are
(...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after
554 loginSetFocus_: function() { 554 loginSetFocus_: function() {
555 var email = $('gaia-email'); 555 var email = $('gaia-email');
556 var passwd = $('gaia-passwd'); 556 var passwd = $('gaia-passwd');
557 if (email && (email.value == null || email.value == "")) { 557 if (email && (email.value == null || email.value == "")) {
558 email.focus(); 558 email.focus();
559 } else if (passwd) { 559 } else if (passwd) {
560 passwd.focus(); 560 passwd.focus();
561 } 561 }
562 }, 562 },
563 563
564 /**
565 * Get the login email text input DOM element.
James Hawkins 2011/11/10 00:24:43 @private, here and elsewhere.
Sheridan Rawlins 2011/11/10 02:02:12 Done.
566 * @return {DOMElement} The login email text input.
567 */
568 getLoginEmail_: function() {
569 return $('gaia-email');
570 },
571
572 /**
573 * Get the login password text input DOM element.
574 * @return {DOMElement} The login password text input.
575 */
576 getLoginPasswd_: function() {
577 return $('gaia-passwd');
578 },
579
580 /**
581 * Get the sign in button DOM element.
582 * @return {DOMElement} The sign in button.
583 */
584 getSignInButton_: function() {
585 return $('sign-in');
586 },
587
564 showAccessCodeRequired_: function() { 588 showAccessCodeRequired_: function() {
565 $('password-row').hidden = true; 589 $('password-row').hidden = true;
566 $('email-row').hidden = true; 590 $('email-row').hidden = true;
567 591
568 $('access-code-input-row').hidden = false; 592 $('access-code-input-row').hidden = false;
569 $('access-code').disabled = false; 593 $('access-code').disabled = false;
570 }, 594 },
571 595
572 showCaptcha_: function(args) { 596 showCaptcha_: function(args) {
573 this.captchaChallengeActive_ = true; 597 this.captchaChallengeActive_ = true;
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
812 /** 836 /**
813 * Hides the outer elements of the login UI. This is used by the sync promo 837 * Hides the outer elements of the login UI. This is used by the sync promo
814 * to customize the look of the login box. 838 * to customize the look of the login box.
815 */ 839 */
816 hideOuterLoginUI_: function() { 840 hideOuterLoginUI_: function() {
817 $('sync-setup-overlay-title').hidden = true; 841 $('sync-setup-overlay-title').hidden = true;
818 $('sync-setup-cancel').hidden = true; 842 $('sync-setup-cancel').hidden = true;
819 } 843 }
820 }; 844 };
821 845
846 // These get methods should only be called by the WebUI tests.
847 SyncSetupOverlay.getLoginEmail = function() {
848 return SyncSetupOverlay.getInstance().getLoginEmail_();
849 };
850
851 SyncSetupOverlay.getLoginPasswd = function() {
852 return SyncSetupOverlay.getInstance().getLoginPasswd_();
853 };
854
855 SyncSetupOverlay.getSignInButton = function() {
856 return SyncSetupOverlay.getInstance().getSignInButton_();
857 };
858
859 // These methods are for general consumption.
822 SyncSetupOverlay.showErrorUI = function() { 860 SyncSetupOverlay.showErrorUI = function() {
823 SyncSetupOverlay.getInstance().showErrorUI_(); 861 SyncSetupOverlay.getInstance().showErrorUI_();
824 }; 862 };
825 863
826 SyncSetupOverlay.showSetupUI = function() { 864 SyncSetupOverlay.showSetupUI = function() {
827 SyncSetupOverlay.getInstance().showSetupUI_(); 865 SyncSetupOverlay.getInstance().showSetupUI_();
828 }; 866 };
829 867
830 SyncSetupOverlay.showSyncSetupPage = function(page, args) { 868 SyncSetupOverlay.showSyncSetupPage = function(page, args) {
831 SyncSetupOverlay.getInstance().showSyncSetupPage_(page, args); 869 SyncSetupOverlay.getInstance().showSyncSetupPage_(page, args);
832 }; 870 };
833 871
834 SyncSetupOverlay.showSuccessAndClose = function() { 872 SyncSetupOverlay.showSuccessAndClose = function() {
835 SyncSetupOverlay.getInstance().showSuccessAndClose_(); 873 SyncSetupOverlay.getInstance().showSuccessAndClose_();
836 }; 874 };
837 875
838 SyncSetupOverlay.showSuccessAndSettingUp = function() { 876 SyncSetupOverlay.showSuccessAndSettingUp = function() {
839 SyncSetupOverlay.getInstance().showSuccessAndSettingUp_(); 877 SyncSetupOverlay.getInstance().showSuccessAndSettingUp_();
840 }; 878 };
841 879
842 SyncSetupOverlay.showStopSyncingUI = function() { 880 SyncSetupOverlay.showStopSyncingUI = function() {
843 SyncSetupOverlay.getInstance().showStopSyncingUI_(); 881 SyncSetupOverlay.getInstance().showStopSyncingUI_();
844 }; 882 };
845 883
846 // Export 884 // Export
847 return { 885 return {
848 SyncSetupOverlay: SyncSetupOverlay 886 SyncSetupOverlay: SyncSetupOverlay
849 }; 887 };
850 }); 888 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698