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

Unified Diff: chrome/browser/ui/webui/sync_setup_handler_unittest.cc

Issue 10388169: Merge 137359 - Treat SyncCredentialsLost as an auth error (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1132/src/
Patch Set: Created 8 years, 7 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/webui/sync_setup_handler.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/sync_setup_handler_unittest.cc
===================================================================
--- chrome/browser/ui/webui/sync_setup_handler_unittest.cc (revision 137482)
+++ chrome/browser/ui/webui/sync_setup_handler_unittest.cc (working copy)
@@ -333,8 +333,10 @@
void SetupInitializedProfileSyncService() {
// An initialized ProfileSyncService will have already completed sync setup
// and will have an initialized sync backend.
- EXPECT_CALL(*mock_pss_, AreCredentialsAvailable())
+ EXPECT_CALL(*mock_pss_, IsSyncEnabledAndLoggedIn())
.WillRepeatedly(Return(true));
+ EXPECT_CALL(*mock_pss_, IsSyncTokenAvailable())
+ .WillRepeatedly(Return(true));
EXPECT_CALL(*mock_pss_, HasSyncSetupCompleted())
.WillRepeatedly(Return(true));
EXPECT_CALL(*mock_pss_, GetAuthError()).WillRepeatedly(ReturnRef(error_));
@@ -373,8 +375,10 @@
#if !defined(OS_CHROMEOS)
TEST_F(SyncSetupHandlerTest, DisplayBasicLogin) {
- EXPECT_CALL(*mock_pss_, AreCredentialsAvailable())
+ EXPECT_CALL(*mock_pss_, IsSyncEnabledAndLoggedIn())
.WillRepeatedly(Return(false));
+ EXPECT_CALL(*mock_pss_, IsSyncTokenAvailable())
+ .WillRepeatedly(Return(false));
EXPECT_CALL(*mock_pss_, HasSyncSetupCompleted())
.WillRepeatedly(Return(false));
handler_->OpenSyncSetup(false);
@@ -399,8 +403,10 @@
}
TEST_F(SyncSetupHandlerTest, DisplayForceLogin) {
- EXPECT_CALL(*mock_pss_, AreCredentialsAvailable())
+ EXPECT_CALL(*mock_pss_, IsSyncEnabledAndLoggedIn())
.WillRepeatedly(Return(false));
+ EXPECT_CALL(*mock_pss_, IsSyncTokenAvailable())
+ .WillRepeatedly(Return(false));
EXPECT_CALL(*mock_pss_, HasSyncSetupCompleted())
.WillRepeatedly(Return(true));
// This should display the login UI even though sync setup has already
@@ -427,8 +433,10 @@
}
TEST_F(SyncSetupHandlerTest, HandleGaiaAuthFailure) {
- EXPECT_CALL(*mock_pss_, AreCredentialsAvailable())
+ EXPECT_CALL(*mock_pss_, IsSyncEnabledAndLoggedIn())
.WillRepeatedly(Return(false));
+ EXPECT_CALL(*mock_pss_, IsSyncTokenAvailable())
+ .WillRepeatedly(Return(false));
EXPECT_CALL(*mock_pss_, unrecoverable_error_detected())
.WillRepeatedly(Return(false));
EXPECT_CALL(*mock_pss_, HasSyncSetupCompleted())
@@ -457,8 +465,10 @@
}
TEST_F(SyncSetupHandlerTest, HandleCaptcha) {
- EXPECT_CALL(*mock_pss_, AreCredentialsAvailable())
+ EXPECT_CALL(*mock_pss_, IsSyncEnabledAndLoggedIn())
.WillRepeatedly(Return(false));
+ EXPECT_CALL(*mock_pss_, IsSyncTokenAvailable())
+ .WillRepeatedly(Return(false));
EXPECT_CALL(*mock_pss_, unrecoverable_error_detected())
.WillRepeatedly(Return(false));
EXPECT_CALL(*mock_pss_, HasSyncSetupCompleted())
@@ -488,8 +498,10 @@
}
TEST_F(SyncSetupHandlerTest, HandleFatalError) {
- EXPECT_CALL(*mock_pss_, AreCredentialsAvailable())
+ EXPECT_CALL(*mock_pss_, IsSyncEnabledAndLoggedIn())
.WillRepeatedly(Return(false));
+ EXPECT_CALL(*mock_pss_, IsSyncTokenAvailable())
+ .WillRepeatedly(Return(false));
EXPECT_CALL(*mock_pss_, HasSyncSetupCompleted())
.WillRepeatedly(Return(false));
handler_->ShowFatalError();
@@ -510,8 +522,10 @@
#if !defined(OS_CHROMEOS)
// TODO(kochi): We need equivalent tests for ChromeOS.
TEST_F(SyncSetupHandlerTest, UnrecoverableErrorInitializingSync) {
- EXPECT_CALL(*mock_pss_, AreCredentialsAvailable())
+ EXPECT_CALL(*mock_pss_, IsSyncEnabledAndLoggedIn())
.WillRepeatedly(Return(false));
+ EXPECT_CALL(*mock_pss_, IsSyncTokenAvailable())
+ .WillRepeatedly(Return(false));
EXPECT_CALL(*mock_pss_, HasSyncSetupCompleted())
.WillRepeatedly(Return(false));
// Open the web UI.
@@ -547,8 +561,10 @@
}
TEST_F(SyncSetupHandlerTest, GaiaErrorInitializingSync) {
- EXPECT_CALL(*mock_pss_, AreCredentialsAvailable())
+ EXPECT_CALL(*mock_pss_, IsSyncEnabledAndLoggedIn())
.WillRepeatedly(Return(false));
+ EXPECT_CALL(*mock_pss_, IsSyncTokenAvailable())
+ .WillRepeatedly(Return(false));
EXPECT_CALL(*mock_pss_, HasSyncSetupCompleted())
.WillRepeatedly(Return(false));
// Open the web UI.
@@ -794,8 +810,10 @@
GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS);
SetupInitializedProfileSyncService();
mock_signin_->SetAuthenticatedUsername(kTestUser);
- EXPECT_CALL(*mock_pss_, AreCredentialsAvailable())
+ EXPECT_CALL(*mock_pss_, IsSyncEnabledAndLoggedIn())
.WillRepeatedly(Return(true));
+ EXPECT_CALL(*mock_pss_, IsSyncTokenAvailable())
+ .WillRepeatedly(Return(true));
EXPECT_CALL(*mock_pss_, IsPassphraseRequired())
.WillRepeatedly(Return(false));
EXPECT_CALL(*mock_pss_, IsUsingSecondaryPassphrase())
« no previous file with comments | « chrome/browser/ui/webui/sync_setup_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698