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

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: Made some utility methods to make mockHandler and mockGlobals generation simpler. 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 getLoginEmail_: function() {
James Hawkins 2011/11/09 17:15:56 Document these methods.
Sheridan Rawlins 2011/11/09 23:51:00 Done.
565 return $('gaia-email');
James Hawkins 2011/11/09 17:15:56 Two space indentation, here and elsewhere.
Sheridan Rawlins 2011/11/09 23:51:00 Done.
566 },
567
568 getLoginPasswd_: function() {
569 return $('gaia-passwd');
570 },
571
572 getSignInButton_: function() {
573 return $('sign-in');
574 },
575
564 showAccessCodeRequired_: function() { 576 showAccessCodeRequired_: function() {
565 $('password-row').hidden = true; 577 $('password-row').hidden = true;
566 $('email-row').hidden = true; 578 $('email-row').hidden = true;
567 579
568 $('access-code-input-row').hidden = false; 580 $('access-code-input-row').hidden = false;
569 $('access-code').disabled = false; 581 $('access-code').disabled = false;
570 }, 582 },
571 583
572 showCaptcha_: function(args) { 584 showCaptcha_: function(args) {
573 this.captchaChallengeActive_ = true; 585 this.captchaChallengeActive_ = true;
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
812 /** 824 /**
813 * Hides the outer elements of the login UI. This is used by the sync promo 825 * Hides the outer elements of the login UI. This is used by the sync promo
814 * to customize the look of the login box. 826 * to customize the look of the login box.
815 */ 827 */
816 hideOuterLoginUI_: function() { 828 hideOuterLoginUI_: function() {
817 $('sync-setup-overlay-title').hidden = true; 829 $('sync-setup-overlay-title').hidden = true;
818 $('sync-setup-cancel').hidden = true; 830 $('sync-setup-cancel').hidden = true;
819 } 831 }
820 }; 832 };
821 833
834 SyncSetupOverlay.getLoginEmail = function() {
James Hawkins 2011/11/09 17:15:56 Document that these should only be called by the t
Sheridan Rawlins 2011/11/09 23:51:00 Done.
835 return SyncSetupOverlay.getInstance().getLoginEmail_();
836 };
837
838 SyncSetupOverlay.getLoginPasswd = function() {
839 return SyncSetupOverlay.getInstance().getLoginPasswd_();
840 };
841
842 SyncSetupOverlay.getSignInButton = function() {
843 return SyncSetupOverlay.getInstance().getSignInButton_();
844 };
845
822 SyncSetupOverlay.showErrorUI = function() { 846 SyncSetupOverlay.showErrorUI = function() {
823 SyncSetupOverlay.getInstance().showErrorUI_(); 847 SyncSetupOverlay.getInstance().showErrorUI_();
824 }; 848 };
825 849
826 SyncSetupOverlay.showSetupUI = function() { 850 SyncSetupOverlay.showSetupUI = function() {
827 SyncSetupOverlay.getInstance().showSetupUI_(); 851 SyncSetupOverlay.getInstance().showSetupUI_();
828 }; 852 };
829 853
830 SyncSetupOverlay.showSyncSetupPage = function(page, args) { 854 SyncSetupOverlay.showSyncSetupPage = function(page, args) {
831 SyncSetupOverlay.getInstance().showSyncSetupPage_(page, args); 855 SyncSetupOverlay.getInstance().showSyncSetupPage_(page, args);
832 }; 856 };
833 857
834 SyncSetupOverlay.showSuccessAndClose = function() { 858 SyncSetupOverlay.showSuccessAndClose = function() {
835 SyncSetupOverlay.getInstance().showSuccessAndClose_(); 859 SyncSetupOverlay.getInstance().showSuccessAndClose_();
836 }; 860 };
837 861
838 SyncSetupOverlay.showSuccessAndSettingUp = function() { 862 SyncSetupOverlay.showSuccessAndSettingUp = function() {
839 SyncSetupOverlay.getInstance().showSuccessAndSettingUp_(); 863 SyncSetupOverlay.getInstance().showSuccessAndSettingUp_();
840 }; 864 };
841 865
842 SyncSetupOverlay.showStopSyncingUI = function() { 866 SyncSetupOverlay.showStopSyncingUI = function() {
843 SyncSetupOverlay.getInstance().showStopSyncingUI_(); 867 SyncSetupOverlay.getInstance().showStopSyncingUI_();
844 }; 868 };
845 869
846 // Export 870 // Export
847 return { 871 return {
848 SyncSetupOverlay: SyncSetupOverlay 872 SyncSetupOverlay: SyncSetupOverlay
849 }; 873 };
850 }); 874 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698