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

Side by Side Diff: chrome/browser/sync/profile_sync_service_startup_unittest.cc

Issue 479353003: Add IsAuthenticated() method to SigninManager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comments Created 6 years, 3 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "base/files/file_util.h" 5 #include "base/files/file_util.h"
6 #include "base/memory/scoped_ptr.h" 6 #include "base/memory/scoped_ptr.h"
7 #include "base/prefs/pref_service.h" 7 #include "base/prefs/pref_service.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "chrome/browser/prefs/pref_service_syncable.h" 9 #include "chrome/browser/prefs/pref_service_syncable.h"
10 #include "chrome/browser/signin/fake_profile_oauth2_token_service.h" 10 #include "chrome/browser/signin/fake_profile_oauth2_token_service.h"
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 208
209 static KeyedService* BuildCrosService(content::BrowserContext* context) { 209 static KeyedService* BuildCrosService(content::BrowserContext* context) {
210 Profile* profile = static_cast<Profile*>(context); 210 Profile* profile = static_cast<Profile*>(context);
211 SigninManagerBase* signin = 211 SigninManagerBase* signin =
212 SigninManagerFactory::GetForProfile(profile); 212 SigninManagerFactory::GetForProfile(profile);
213 profile->GetPrefs()->SetString(prefs::kGoogleServicesUsername, 213 profile->GetPrefs()->SetString(prefs::kGoogleServicesUsername,
214 "test_user@gmail.com"); 214 "test_user@gmail.com");
215 signin->SetAuthenticatedUsername("test_user@gmail.com"); 215 signin->SetAuthenticatedUsername("test_user@gmail.com");
216 ProfileOAuth2TokenService* oauth2_token_service = 216 ProfileOAuth2TokenService* oauth2_token_service =
217 ProfileOAuth2TokenServiceFactory::GetForProfile(profile); 217 ProfileOAuth2TokenServiceFactory::GetForProfile(profile);
218 EXPECT_FALSE(signin->GetAuthenticatedUsername().empty()); 218 EXPECT_TRUE(signin->IsAuthenticated());
219 return new TestProfileSyncServiceNoBackup( 219 return new TestProfileSyncServiceNoBackup(
220 scoped_ptr<ProfileSyncComponentsFactory>( 220 scoped_ptr<ProfileSyncComponentsFactory>(
221 new ProfileSyncComponentsFactoryMock()), 221 new ProfileSyncComponentsFactoryMock()),
222 profile, 222 profile,
223 make_scoped_ptr(new SupervisedUserSigninManagerWrapper(profile, 223 make_scoped_ptr(new SupervisedUserSigninManagerWrapper(profile,
224 signin)), 224 signin)),
225 oauth2_token_service, 225 oauth2_token_service,
226 browser_sync::AUTO_START); 226 browser_sync::AUTO_START);
227 } 227 }
228 }; 228 };
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
572 profile_->GetPrefs()->ClearPref(sync_driver::prefs::kSyncHasSetupCompleted); 572 profile_->GetPrefs()->ClearPref(sync_driver::prefs::kSyncHasSetupCompleted);
573 573
574 EXPECT_CALL(observer_, OnStateChanged()).Times(AnyNumber()); 574 EXPECT_CALL(observer_, OnStateChanged()).Times(AnyNumber());
575 sync_->Initialize(); 575 sync_->Initialize();
576 576
577 sync_->SetSetupInProgress(true); 577 sync_->SetSetupInProgress(true);
578 IssueTestTokens(); 578 IssueTestTokens();
579 sync_->SetSetupInProgress(false); 579 sync_->SetSetupInProgress(false);
580 EXPECT_FALSE(sync_->sync_initialized()); 580 EXPECT_FALSE(sync_->sync_initialized());
581 } 581 }
OLDNEW
« no previous file with comments | « chrome/browser/sync/profile_sync_service.cc ('k') | chrome/browser/sync/supervised_user_signin_manager_wrapper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698