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

Unified Diff: chrome/browser/signin/signin_tracker_unittest.cc

Issue 16173006: No longer trigger signin errors on connection_failed for sync. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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/signin/signin_tracker.cc ('k') | chrome/browser/ui/webui/sync_setup_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/signin/signin_tracker_unittest.cc
diff --git a/chrome/browser/signin/signin_tracker_unittest.cc b/chrome/browser/signin/signin_tracker_unittest.cc
index 5f174a7b496af6c5712b0681d02bef4df36d1663..41e4093365ffdd9118454cd5a9b72a86a228e3b3 100644
--- a/chrome/browser/signin/signin_tracker_unittest.cc
+++ b/chrome/browser/signin/signin_tracker_unittest.cc
@@ -363,10 +363,21 @@ TEST_F(SigninTrackerTest, SigninFailedGoogleServiceAuthError) {
TEST_F(SigninTrackerTest, SigninFailedWhenInitializing) {
tracker_.reset();
- // SigninFailed() should be called.
+ // SigninFailed() should be called because we are not signed in.
GoogleServiceAuthError error(GoogleServiceAuthError::REQUEST_CANCELED);
EXPECT_CALL(observer_, SigninFailed(error));
tracker_.reset(new SigninTracker(profile_.get(), &observer_,
SigninTracker::SERVICES_INITIALIZING));
tracker_->OnStateChanged();
}
+
+TEST_F(SigninTrackerTest, ConnectionErrorWhenInitializing) {
+ // SigninFailed() should not be called for a CONNECTION_FAILED error.
+ GoogleServiceAuthError error(GoogleServiceAuthError::CONNECTION_FAILED);
+ ExpectSignedInSyncService(mock_pss_, mock_token_service_, error);
+ mock_signin_manager_->SetAuthenticatedUsername("username@gmail.com");
+ EXPECT_CALL(observer_, SigninFailed(_)).Times(0);
+ tracker_.reset(new SigninTracker(profile_.get(), &observer_,
+ SigninTracker::SERVICES_INITIALIZING));
+ tracker_->OnStateChanged();
+}
« no previous file with comments | « chrome/browser/signin/signin_tracker.cc ('k') | chrome/browser/ui/webui/sync_setup_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698