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

Unified Diff: components/gcm_driver/gcm_driver_desktop_unittest.cc

Issue 848503002: [GCM] Remove GCMDriver::Purge and GCMClient::CheckOut (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 e33364dec156066728a37be3410f472428cc2095..d4f22041b8cf75cc7540ca9db372c80459c22408 100644
--- a/components/gcm_driver/gcm_driver_desktop_unittest.cc
+++ b/components/gcm_driver/gcm_driver_desktop_unittest.cc
@@ -364,7 +364,7 @@ TEST_F(GCMDriverTest, DisableAndReenableGCM) {
PumpUILoop();
// GCMClient should be started.
- EXPECT_EQ(FakeGCMClient::STARTED, GetGCMClient()->status());
+ EXPECT_TRUE(driver()->IsStarted());
// Disables the GCM.
driver()->Disable();
@@ -372,7 +372,7 @@ TEST_F(GCMDriverTest, DisableAndReenableGCM) {
PumpUILoop();
// GCMClient should be stopped.
- EXPECT_EQ(FakeGCMClient::STOPPED, GetGCMClient()->status());
+ EXPECT_FALSE(driver()->IsStarted());
// Enables the GCM.
driver()->Enable();
@@ -380,18 +380,7 @@ TEST_F(GCMDriverTest, DisableAndReenableGCM) {
PumpUILoop();
// GCMClient should be started.
- EXPECT_EQ(FakeGCMClient::STARTED, GetGCMClient()->status());
-
- // Disables the GCM.
- driver()->Disable();
- PumpIOLoop();
- PumpUILoop();
-
- // GCMClient should be stopped.
- EXPECT_EQ(FakeGCMClient::STOPPED, GetGCMClient()->status());
-
- // GCMClient should be stopped.
- EXPECT_EQ(FakeGCMClient::STOPPED, GetGCMClient()->status());
+ EXPECT_TRUE(driver()->IsStarted());
}
TEST_F(GCMDriverTest, StartOrStopGCMOnDemand) {
@@ -399,38 +388,35 @@ TEST_F(GCMDriverTest, StartOrStopGCMOnDemand) {
PumpIOLoop();
PumpUILoop();
- // GCMClient is not started.
- EXPECT_EQ(FakeGCMClient::UNINITIALIZED, GetGCMClient()->status());
-
// GCMClient is started after an app handler has been added.
driver()->AddAppHandler(kTestAppID1, gcm_app_handler());
PumpIOLoop();
PumpUILoop();
- EXPECT_EQ(FakeGCMClient::STARTED, GetGCMClient()->status());
+ EXPECT_TRUE(driver()->IsStarted());
// Add another app handler.
driver()->AddAppHandler(kTestAppID2, gcm_app_handler());
PumpIOLoop();
PumpUILoop();
- EXPECT_EQ(FakeGCMClient::STARTED, GetGCMClient()->status());
+ EXPECT_TRUE(driver()->IsStarted());
// GCMClient remains active after one app handler is gone.
driver()->RemoveAppHandler(kTestAppID1);
PumpIOLoop();
PumpUILoop();
- EXPECT_EQ(FakeGCMClient::STARTED, GetGCMClient()->status());
+ EXPECT_TRUE(driver()->IsStarted());
// GCMClient should be stopped after the last app handler is gone.
driver()->RemoveAppHandler(kTestAppID2);
PumpIOLoop();
PumpUILoop();
- EXPECT_EQ(FakeGCMClient::STOPPED, GetGCMClient()->status());
+ EXPECT_FALSE(driver()->IsStarted());
// GCMClient is restarted after an app handler has been added.
driver()->AddAppHandler(kTestAppID2, gcm_app_handler());
PumpIOLoop();
PumpUILoop();
- EXPECT_EQ(FakeGCMClient::STARTED, GetGCMClient()->status());
+ EXPECT_TRUE(driver()->IsStarted());
}
TEST_F(GCMDriverTest, RegisterFailed) {
« 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