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

Unified Diff: chrome/browser/services/gcm/gcm_profile_service_unittest.cc

Issue 535393002: Clear GCMProfileService::account_id_ when signing out (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/services/gcm/gcm_profile_service.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « chrome/browser/services/gcm/gcm_profile_service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698