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(); |