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

Unified Diff: components/gcm_driver/gcm_driver_desktop_unittest.cc

Issue 562423002: Clear GCM data when the user clears cookies and other site data (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments 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 cec87efab94d97f113a47c54d7ceb6cf29928143..ad95f8689a5ee805626cd455ead15ce370e0be5f 100644
--- a/components/gcm_driver/gcm_driver_desktop_unittest.cc
+++ b/components/gcm_driver/gcm_driver_desktop_unittest.cc
@@ -258,7 +258,7 @@ void GCMDriverTest::SignIn(const std::string& account_id) {
}
void GCMDriverTest::SignOut() {
- driver_->Purge();
+ driver_->OnSignedOut();
PumpIOLoop();
PumpUILoop();
}
@@ -350,6 +350,7 @@ TEST_F(GCMDriverTest, Create) {
}
TEST_F(GCMDriverTest, CreateByFieldTrial) {
+ // Turn on the signal to drop sign-in enforcement.
ASSERT_TRUE(base::FieldTrialList::CreateFieldTrial("GCM", "Enabled"));
// Create GCMDriver first. GCM is not started.
@@ -364,6 +365,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) {
« 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