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

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

Issue 10335015: Treat SyncCredentialsLost as an auth error (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: git try 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
diff --git a/chrome/browser/ui/webui/sync_setup_handler_unittest.cc b/chrome/browser/ui/webui/sync_setup_handler_unittest.cc
index c9b3aa3fa6caf6d7e8ec893f9be8c401f2c32065..4392946654b5b7616bf439df1330c9f169fab683 100644
--- a/chrome/browser/ui/webui/sync_setup_handler_unittest.cc
+++ b/chrome/browser/ui/webui/sync_setup_handler_unittest.cc
@@ -333,7 +333,9 @@ class SyncSetupHandlerTest : public testing::Test {
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));
@@ -373,7 +375,9 @@ TEST_F(SyncSetupHandlerTest, Basic) {
#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));
@@ -399,7 +403,9 @@ TEST_F(SyncSetupHandlerTest, DisplayBasicLogin) {
}
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));
@@ -427,7 +433,9 @@ TEST_F(SyncSetupHandlerTest, DisplayForceLogin) {
}
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));
@@ -457,7 +465,9 @@ TEST_F(SyncSetupHandlerTest, HandleGaiaAuthFailure) {
}
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));
@@ -488,7 +498,9 @@ TEST_F(SyncSetupHandlerTest, HandleCaptcha) {
}
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));
@@ -510,7 +522,9 @@ TEST_F(SyncSetupHandlerTest, HandleFatalError) {
#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));
@@ -547,7 +561,9 @@ TEST_F(SyncSetupHandlerTest, UnrecoverableErrorInitializingSync) {
}
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));
@@ -794,7 +810,9 @@ TEST_F(SyncSetupHandlerTest, ShowSyncSetupWithAuthError) {
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));
« 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