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

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

Issue 162233002: [GCM] Remove all persisted data and close connections when signing out of a profile (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Patch Created 6 years, 10 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/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 821f60b2330b955595e1f1eea612f29dda7d1ef6..e093716222e2cec6a889f0007d63e0a27be72557 100644
--- a/chrome/browser/services/gcm/gcm_profile_service_unittest.cc
+++ b/chrome/browser/services/gcm/gcm_profile_service_unittest.cc
@@ -813,6 +813,25 @@ TEST_F(GCMProfileServiceSingleProfileTest,
EXPECT_EQ(GCMClient::SUCCESS, consumer()->registration_result());
}
+TEST_F(GCMProfileServiceSingleProfileTest,
+ PersistedRegistrationInfoRemoveAfterSignOut) {
+ std::vector<std::string> sender_ids;
+ sender_ids.push_back("sender1");
+ consumer()->Register(kTestingAppId, sender_ids);
+ WaitUntilCompleted();
+
+ // The app id and registration info should be persisted.
+ EXPECT_TRUE(profile()->GetPrefs()->HasPrefPath(prefs::kGCMApps));
+ EXPECT_TRUE(consumer()->HasPersistedRegistrationInfo(kTestingAppId));
+
+ consumer()->SignOut();
+ PumpUILoop();
+
+ // The app id and persisted registration info should be removed.
+ EXPECT_FALSE(profile()->GetPrefs()->HasPrefPath(prefs::kGCMApps));
+ EXPECT_FALSE(consumer()->HasPersistedRegistrationInfo(kTestingAppId));
+}
+
TEST_F(GCMProfileServiceSingleProfileTest, RegisterAfterSignOut) {
// This will trigger check-out.
consumer()->SignOut();

Powered by Google App Engine
This is Rietveld 408576698