Index: chrome/browser/services/gcm/gcm_profile_service_unittest.cc |
diff --git a/chrome/browser/services/gcm/gcm_profile_service_unittest.cc b/chrome/browser/services/gcm/gcm_profile_service_unittest.cc |
index 2b1e5014642e4cb160de5395474d9526bbf58e12..3d77031d2a30d9821412203258727f4d6a94cb27 100644 |
--- a/chrome/browser/services/gcm/gcm_profile_service_unittest.cc |
+++ b/chrome/browser/services/gcm/gcm_profile_service_unittest.cc |
@@ -61,6 +61,7 @@ class GCMProfileServiceTest : public testing::Test { |
void CreateGCMProfileService(); |
void SignIn(); |
+ void SignOut(); |
void RegisterAndWaitForCompletion(const std::vector<std::string>& sender_ids); |
void UnregisterAndWaitForCompletion(); |
@@ -141,6 +142,13 @@ void GCMProfileServiceTest::SignIn() { |
base::RunLoop().RunUntilIdle(); |
} |
+void GCMProfileServiceTest::SignOut() { |
+ FakeSigninManager* signin_manager = static_cast<FakeSigninManager*>( |
+ SigninManagerFactory::GetInstance()->GetForProfile(profile_.get())); |
+ signin_manager->SignOut(signin_metrics::SIGNOUT_TEST); |
+ base::RunLoop().RunUntilIdle(); |
+} |
+ |
void GCMProfileServiceTest::RegisterAndWaitForCompletion( |
const std::vector<std::string>& sender_ids) { |
base::RunLoop run_loop; |
@@ -218,6 +226,18 @@ TEST_F(GCMProfileServiceTest, CreateGCMProfileServiceAfterSignIn) { |
EXPECT_TRUE(driver()->IsStarted()); |
} |
+TEST_F(GCMProfileServiceTest, SignInAgain) { |
+ CreateGCMProfileService(); |
+ SignIn(); |
+ EXPECT_TRUE(driver()->IsStarted()); |
+ |
+ SignOut(); |
+ EXPECT_FALSE(driver()->IsStarted()); |
+ |
+ SignIn(); |
+ EXPECT_TRUE(driver()->IsStarted()); |
+} |
+ |
TEST_F(GCMProfileServiceTest, RegisterAndUnregister) { |
CreateGCMProfileService(); |
SignIn(); |