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

Unified Diff: components/gcm_driver/gcm_driver_desktop_unittest.cc

Issue 617003005: Keep the GCM data intact when the user signs out of the profile (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 | « components/gcm_driver/gcm_driver_desktop.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/gcm_driver/gcm_driver_desktop_unittest.cc
diff --git a/components/gcm_driver/gcm_driver_desktop_unittest.cc b/components/gcm_driver/gcm_driver_desktop_unittest.cc
index 75717bb5efc2ae683c50c78fee353ac1702522c8..148be59a9adf517fee4c00309e09e8eb6800d74b 100644
--- a/components/gcm_driver/gcm_driver_desktop_unittest.cc
+++ b/components/gcm_driver/gcm_driver_desktop_unittest.cc
@@ -273,7 +273,7 @@ void GCMDriverTest::SignIn(const std::string& account_id) {
}
void GCMDriverTest::SignOut() {
- driver_->Purge();
+ driver_->OnSignedOut();
PumpIOLoop();
PumpUILoop();
}
@@ -379,6 +379,18 @@ TEST_F(GCMDriverTest, CreateByFieldTrial) {
PumpIOLoop();
EXPECT_TRUE(driver()->IsConnected());
EXPECT_TRUE(gcm_connection_observer()->connected());
+
+ // Sign-in will not affect GCM state.
+ SignIn(kTestAccountID1);
+ PumpIOLoop();
+ EXPECT_TRUE(driver()->IsStarted());
+ EXPECT_TRUE(driver()->IsConnected());
+
+ // Sign-out will not affect GCM state.
+ SignOut();
+ PumpIOLoop();
+ EXPECT_TRUE(driver()->IsStarted());
+ EXPECT_TRUE(driver()->IsConnected());
}
TEST_F(GCMDriverTest, Shutdown) {
@@ -403,9 +415,9 @@ TEST_F(GCMDriverTest, SignInAndSignOutOnGCMEnabled) {
SignIn(kTestAccountID1);
EXPECT_EQ(FakeGCMClient::STARTED, GetGCMClient()->status());
- // GCMClient should be checked out after sign-out.
+ // GCMClient should be stopped out after sign-out.
SignOut();
- EXPECT_EQ(FakeGCMClient::CHECKED_OUT, GetGCMClient()->status());
+ EXPECT_EQ(FakeGCMClient::STOPPED, GetGCMClient()->status());
}
TEST_F(GCMDriverTest, SignInAndSignOutOnGCMDisabled) {
@@ -420,9 +432,9 @@ TEST_F(GCMDriverTest, SignInAndSignOutOnGCMDisabled) {
SignIn(kTestAccountID1);
EXPECT_EQ(FakeGCMClient::UNINITIALIZED, GetGCMClient()->status());
- // Check-out should still be performed after sign-out.
+ // GCMClient should still be not started after sign-out.
SignOut();
- EXPECT_EQ(FakeGCMClient::CHECKED_OUT, GetGCMClient()->status());
+ EXPECT_EQ(FakeGCMClient::UNINITIALIZED, GetGCMClient()->status());
}
TEST_F(GCMDriverTest, SignOutAndThenSignIn) {
@@ -433,9 +445,9 @@ TEST_F(GCMDriverTest, SignOutAndThenSignIn) {
SignIn(kTestAccountID1);
EXPECT_EQ(FakeGCMClient::STARTED, GetGCMClient()->status());
- // GCMClient should be checked out after sign-out.
+ // GCMClient should be stopped after sign-out.
SignOut();
- EXPECT_EQ(FakeGCMClient::CHECKED_OUT, GetGCMClient()->status());
+ EXPECT_EQ(FakeGCMClient::STOPPED, GetGCMClient()->status());
// Sign-in with a different account.
SignIn(kTestAccountID2);
@@ -479,8 +491,8 @@ TEST_F(GCMDriverTest, DisableAndReenableGCM) {
// Sign out.
SignOut();
- // GCMClient should be checked out.
- EXPECT_EQ(FakeGCMClient::CHECKED_OUT, GetGCMClient()->status());
+ // GCMClient should be stopped.
+ EXPECT_EQ(FakeGCMClient::STOPPED, GetGCMClient()->status());
}
TEST_F(GCMDriverTest, StartOrStopGCMOnDemand) {
« no previous file with comments | « components/gcm_driver/gcm_driver_desktop.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698