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

Unified Diff: chrome/browser/sync/profile_sync_service_startup_unittest.cc

Issue 13197004: Draft: InvalidationService (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Passes tests Created 7 years, 8 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
Index: chrome/browser/sync/profile_sync_service_startup_unittest.cc
diff --git a/chrome/browser/sync/profile_sync_service_startup_unittest.cc b/chrome/browser/sync/profile_sync_service_startup_unittest.cc
index 1a00308bd8c8646ccfe111bf261ba9c0f61b46ad..2b8fd24e51cf1ff7048ad2a48e4674dfe3b30af4 100644
--- a/chrome/browser/sync/profile_sync_service_startup_unittest.cc
+++ b/chrome/browser/sync/profile_sync_service_startup_unittest.cc
@@ -103,7 +103,7 @@ class ProfileSyncServiceStartupTest : public testing::Test {
SigninManager* signin = static_cast<SigninManager*>(
SigninManagerFactory::GetInstance()->SetTestingFactoryAndUse(
profile, FakeSigninManager::Build));
- signin->SetAuthenticatedUsername("test_user");
+ signin->SetAuthenticatedUsername("test_user@gmail.com");
return new TestProfileSyncService(
new ProfileSyncComponentsFactoryMock(),
profile,
@@ -142,7 +142,7 @@ class ProfileSyncServiceStartupCrosTest : public ProfileSyncServiceStartupTest {
public:
static ProfileKeyedService* BuildCrosService(Profile* profile) {
SigninManager* signin = SigninManagerFactory::GetForProfile(profile);
- signin->SetAuthenticatedUsername("test_user");
+ signin->SetAuthenticatedUsername("test_user@gmail.com");
return new TestProfileSyncService(
new ProfileSyncComponentsFactoryMock(),
profile,
@@ -189,7 +189,7 @@ TEST_F(ProfileSyncServiceStartupTest, StartFirstTime) {
// Create some tokens in the token service; the service will startup when
// it is notified that tokens are available.
sync_->SetSetupInProgress(true);
- sync_->signin()->StartSignIn("test_user", "", "", "");
+ sync_->signin()->StartSignIn("test_user@gmail.com", "", "", "");
TokenServiceFactory::GetForProfile(profile_.get())->IssueAuthTokenForTest(
GaiaConstants::kSyncService, "sync_token");
TokenServiceFactory::GetForProfile(profile_.get())->IssueAuthTokenForTest(
@@ -235,7 +235,7 @@ TEST_F(ProfileSyncServiceStartupTest, StartNoCredentials) {
EXPECT_CALL(observer_, OnStateChanged()).Times(AnyNumber());
sync_->SetSetupInProgress(true);
- sync_->signin()->StartSignIn("test_user", "", "", "");
+ sync_->signin()->StartSignIn("test_user@gmail.com", "", "", "");
// NOTE: Unlike StartFirstTime, this test does not issue any auth tokens.
token_service->LoadTokensFromDB();
sync_->SetSetupInProgress(false);
@@ -269,7 +269,7 @@ TEST_F(ProfileSyncServiceStartupTest, StartInvalidCredentials) {
EXPECT_CALL(*data_type_manager, Stop()).Times(1);
EXPECT_CALL(observer_, OnStateChanged()).Times(AnyNumber());
sync_->SetSetupInProgress(true);
- sync_->signin()->StartSignIn("test_user", "", "", "");
+ sync_->signin()->StartSignIn("test_user@gmail.com", "", "", "");
token_service->IssueAuthTokenForTest(
GaiaConstants::kSyncService, "sync_token");
sync_->SetSetupInProgress(false);
@@ -327,7 +327,9 @@ TEST_F(ProfileSyncServiceStartupTest, StartNormal) {
// Pre load the tokens
TokenServiceFactory::GetForProfile(profile_.get())->IssueAuthTokenForTest(
GaiaConstants::kSyncService, "sync_token");
- profile_->GetPrefs()->SetString(prefs::kGoogleServicesUsername, "test_user");
+ profile_->GetPrefs()->SetString(
+ prefs::kGoogleServicesUsername,
+ "test_user@gmail.com");
sync_->Initialize();
}
@@ -355,7 +357,9 @@ TEST_F(ProfileSyncServiceStartupTest, StartRecoverDatatypePrefs) {
// Pre load the tokens
TokenServiceFactory::GetForProfile(profile_.get())->IssueAuthTokenForTest(
GaiaConstants::kSyncService, "sync_token");
- profile_->GetPrefs()->SetString(prefs::kGoogleServicesUsername, "test_user");
+ profile_->GetPrefs()->SetString(
+ prefs::kGoogleServicesUsername,
+ "test_user@gmail.com");
sync_->Initialize();
EXPECT_TRUE(profile_->GetPrefs()->GetBoolean(
@@ -380,7 +384,9 @@ TEST_F(ProfileSyncServiceStartupTest, StartDontRecoverDatatypePrefs) {
// Pre load the tokens
TokenServiceFactory::GetForProfile(profile_.get())->IssueAuthTokenForTest(
GaiaConstants::kSyncService, "sync_token");
- profile_->GetPrefs()->SetString(prefs::kGoogleServicesUsername, "test_user");
+ profile_->GetPrefs()->SetString(
+ prefs::kGoogleServicesUsername,
+ "test_user@gmail.com");
sync_->Initialize();
EXPECT_FALSE(profile_->GetPrefs()->GetBoolean(
@@ -398,7 +404,9 @@ TEST_F(ProfileSyncServiceStartupTest, ManagedStartup) {
// Service should not be started by Initialize() since it's managed.
TokenServiceFactory::GetForProfile(profile_.get())->IssueAuthTokenForTest(
GaiaConstants::kSyncService, "sync_token");
- profile_->GetPrefs()->SetString(prefs::kGoogleServicesUsername, "test_user");
+ profile_->GetPrefs()->SetString(
+ prefs::kGoogleServicesUsername,
+ "test_user@gmail.com");
sync_->Initialize();
}
@@ -409,7 +417,9 @@ TEST_F(ProfileSyncServiceStartupTest, SwitchManaged) {
TokenServiceFactory::GetForProfile(profile_.get())->IssueAuthTokenForTest(
GaiaConstants::kSyncService, "sync_token");
- profile_->GetPrefs()->SetString(prefs::kGoogleServicesUsername, "test_user");
+ profile_->GetPrefs()->SetString(
+ prefs::kGoogleServicesUsername,
+ "test_user@gmail.com");
sync_->Initialize();
// The service should stop when switching to managed mode.
@@ -452,7 +462,9 @@ TEST_F(ProfileSyncServiceStartupTest, StartFailure) {
TokenServiceFactory::GetForProfile(profile_.get())->IssueAuthTokenForTest(
GaiaConstants::kSyncService, "sync_token");
- profile_->GetPrefs()->SetString(prefs::kGoogleServicesUsername, "test_user");
+ profile_->GetPrefs()->SetString(
+ prefs::kGoogleServicesUsername,
+ "test_user@gmail.com");
sync_->Initialize();
EXPECT_TRUE(sync_->HasUnrecoverableError());
}

Powered by Google App Engine
This is Rietveld 408576698