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

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

Issue 15580002: Make use of InvalidationService (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix PushMessagingApiTests Created 7 years, 6 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 d3d88d21bbeb4ed2491d7e08fcb48cadaaeb57c1..79ca25b025375b7d7451599891429d8340f2efc5 100644
--- a/chrome/browser/sync/profile_sync_service_startup_unittest.cc
+++ b/chrome/browser/sync/profile_sync_service_startup_unittest.cc
@@ -159,7 +159,7 @@ class ProfileSyncServiceStartupCrosTest : public ProfileSyncServiceStartupTest {
SigninManagerBase* signin =
SigninManagerFactory::GetForProfile(profile);
profile->GetPrefs()->SetString(prefs::kGoogleServicesUsername,
- "test_user");
+ "test_user@gmail.com");
signin->Initialize(profile, NULL);
EXPECT_FALSE(signin->GetAuthenticatedUsername().empty());
return new TestProfileSyncService(
@@ -207,9 +207,9 @@ TEST_F(ProfileSyncServiceStartupTest, StartFirstTime) {
// Simulate successful signin as test_user.
profile_->GetPrefs()->SetString(prefs::kGoogleServicesUsername,
- "test_user");
- sync_->signin()->SetAuthenticatedUsername("test_user");
- GoogleServiceSigninSuccessDetails details("test_user", "");
+ "test_user@gmail.com");
+ sync_->signin()->SetAuthenticatedUsername("test_user@gmail.com");
+ GoogleServiceSigninSuccessDetails details("test_user@gmail.com", "");
content::NotificationService::current()->Notify(
chrome::NOTIFICATION_GOOGLE_SIGNIN_SUCCESSFUL,
content::Source<Profile>(profile_.get()),
@@ -261,9 +261,9 @@ TEST_F(ProfileSyncServiceStartupTest, StartNoCredentials) {
// Simulate successful signin as test_user.
profile_->GetPrefs()->SetString(prefs::kGoogleServicesUsername,
- "test_user");
- sync_->signin()->SetAuthenticatedUsername("test_user");
- GoogleServiceSigninSuccessDetails details("test_user", "");
+ "test_user@gmail.com");
+ sync_->signin()->SetAuthenticatedUsername("test_user@gmail.com");
+ GoogleServiceSigninSuccessDetails details("test_user@gmail.com", "");
content::NotificationService::current()->Notify(
chrome::NOTIFICATION_GOOGLE_SIGNIN_SUCCESSFUL,
content::Source<Profile>(profile_.get()),
@@ -278,7 +278,7 @@ TEST_F(ProfileSyncServiceStartupTest, StartNoCredentials) {
TEST_F(ProfileSyncServiceStartupTest, StartInvalidCredentials) {
profile_->GetPrefs()->SetString(prefs::kGoogleServicesUsername,
- "test_user");
+ "test_user@gmail.com");
SigninManagerFactory::GetForProfile(
profile_.get())->Initialize(profile_.get(), NULL);
CreateSyncService();
@@ -309,7 +309,8 @@ TEST_F(ProfileSyncServiceStartupTest, StartInvalidCredentials) {
sync_->SetSetupInProgress(true);
// Simulate successful signin.
- GoogleServiceSigninSuccessDetails details("test_user", std::string());
+ GoogleServiceSigninSuccessDetails details("test_user@gmail.com",
+ std::string());
content::NotificationService::current()->Notify(
chrome::NOTIFICATION_GOOGLE_SIGNIN_SUCCESSFUL,
content::Source<Profile>(profile_.get()),
@@ -362,7 +363,8 @@ TEST_F(ProfileSyncServiceStartupCrosTest, StartFirstTime) {
TEST_F(ProfileSyncServiceStartupTest, StartNormal) {
// Pre load the tokens
- profile_->GetPrefs()->SetString(prefs::kGoogleServicesUsername, "test_user");
+ profile_->GetPrefs()->SetString(prefs::kGoogleServicesUsername,
+ "test_user@gmail.com");
SigninManagerFactory::GetForProfile(profile_.get())->Initialize(
profile_.get(), NULL);
CreateSyncService();
@@ -393,7 +395,8 @@ TEST_F(ProfileSyncServiceStartupTest, StartRecoverDatatypePrefs) {
}
// Pre load the tokens
- profile_->GetPrefs()->SetString(prefs::kGoogleServicesUsername, "test_user");
+ profile_->GetPrefs()->SetString(prefs::kGoogleServicesUsername,
+ "test_user@gmail.com");
SigninManagerFactory::GetForProfile(profile_.get())->Initialize(
profile_.get(), NULL);
CreateSyncService();
@@ -420,7 +423,8 @@ TEST_F(ProfileSyncServiceStartupTest, StartDontRecoverDatatypePrefs) {
profile_->GetPrefs()->SetBoolean(prefs::kSyncKeepEverythingSynced, false);
// Pre load the tokens
- profile_->GetPrefs()->SetString(prefs::kGoogleServicesUsername, "test_user");
+ profile_->GetPrefs()->SetString(prefs::kGoogleServicesUsername,
+ "test_user@gmail.com");
SigninManagerFactory::GetForProfile(profile_.get())->Initialize(
profile_.get(), NULL);
CreateSyncService();
@@ -440,7 +444,8 @@ TEST_F(ProfileSyncServiceStartupTest, StartDontRecoverDatatypePrefs) {
TEST_F(ProfileSyncServiceStartupTest, ManagedStartup) {
// Service should not be started by Initialize() since it's managed.
- profile_->GetPrefs()->SetString(prefs::kGoogleServicesUsername, "test_user");
+ profile_->GetPrefs()->SetString(prefs::kGoogleServicesUsername,
+ "test_user@gmail.com");
SigninManagerFactory::GetForProfile(profile_.get())->Initialize(
profile_.get(), NULL);
CreateSyncService();
@@ -457,7 +462,8 @@ TEST_F(ProfileSyncServiceStartupTest, ManagedStartup) {
}
TEST_F(ProfileSyncServiceStartupTest, SwitchManaged) {
- profile_->GetPrefs()->SetString(prefs::kGoogleServicesUsername, "test_user");
+ profile_->GetPrefs()->SetString(prefs::kGoogleServicesUsername,
+ "test_user@gmail.com");
SigninManagerFactory::GetForProfile(profile_.get())->Initialize(
profile_.get(), NULL);
CreateSyncService();
@@ -486,7 +492,8 @@ TEST_F(ProfileSyncServiceStartupTest, SwitchManaged) {
}
TEST_F(ProfileSyncServiceStartupTest, StartFailure) {
- profile_->GetPrefs()->SetString(prefs::kGoogleServicesUsername, "test_user");
+ profile_->GetPrefs()->SetString(prefs::kGoogleServicesUsername,
+ "test_user@gmail.com");
SigninManagerFactory::GetForProfile(profile_.get())->Initialize(
profile_.get(), NULL);
CreateSyncService();
@@ -516,7 +523,8 @@ TEST_F(ProfileSyncServiceStartupTest, StartFailure) {
TEST_F(ProfileSyncServiceStartupTest, StartDownloadFailed) {
// Pre load the tokens
- profile_->GetPrefs()->SetString(prefs::kGoogleServicesUsername, "test_user");
+ profile_->GetPrefs()->SetString(prefs::kGoogleServicesUsername,
+ "test_user@gmail.com");
SigninManagerFactory::GetForProfile(profile_.get())->Initialize(
profile_.get(), NULL);
CreateSyncService();

Powered by Google App Engine
This is Rietveld 408576698