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

Unified Diff: google_apis/gcm/engine/gcm_store_impl_unittest.cc

Issue 681453004: [GCM] Adding last token fetching time handling (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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: google_apis/gcm/engine/gcm_store_impl_unittest.cc
diff --git a/google_apis/gcm/engine/gcm_store_impl_unittest.cc b/google_apis/gcm/engine/gcm_store_impl_unittest.cc
index 939ef80c9ec647e8364c85f738040616b2c87c61..6323331e8e7e8b25a7e992879d693969c2efb728 100644
--- a/google_apis/gcm/engine/gcm_store_impl_unittest.cc
+++ b/google_apis/gcm/engine/gcm_store_impl_unittest.cc
@@ -643,6 +643,26 @@ TEST_F(GCMStoreImplTest, ReloadAfterClose) {
PumpLoop();
}
+TEST_F(GCMStoreImplTest, LastTokenFetchingTime) {
+ scoped_ptr<GCMStore> gcm_store(BuildGCMStore());
+ scoped_ptr<GCMStore::LoadResult> load_result;
+ gcm_store->Load(base::Bind(
+ &GCMStoreImplTest::LoadCallback, base::Unretained(this), &load_result));
Nicolas Zea 2014/10/27 21:54:55 verify the initial value is unset?
fgorski 2014/10/27 23:46:27 Done.
+ PumpLoop();
+
+ base::Time last_token_fetching_time = base::Time::Now();
+ gcm_store->SetLastTokenFetchingTime(
+ last_token_fetching_time,
+ base::Bind(&GCMStoreImplTest::UpdateCallback, base::Unretained(this)));
+ PumpLoop();
+
+ gcm_store = BuildGCMStore().Pass();
+ gcm_store->Load(base::Bind(
+ &GCMStoreImplTest::LoadCallback, base::Unretained(this), &load_result));
+ PumpLoop();
+ ASSERT_EQ(last_token_fetching_time, load_result->last_token_fetching_time);
+}
+
} // namespace
} // namespace gcm
« google_apis/gcm/engine/gcm_store_impl.h ('K') | « google_apis/gcm/engine/gcm_store_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698