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

Unified Diff: components/update_client/persisted_data_unittest.cc

Issue 1899043002: Implement ping_freshness for update_client. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: Created 4 years, 8 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/update_client/persisted_data.cc ('k') | components/update_client/update_checker.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/update_client/persisted_data_unittest.cc
diff --git a/components/update_client/persisted_data_unittest.cc b/components/update_client/persisted_data_unittest.cc
index d89060f2cda652e50c702d47f83cce97acca2da4..dfe242c2a61f37e466e4341d26cc54fa186d6e49 100644
--- a/components/update_client/persisted_data_unittest.cc
+++ b/components/update_client/persisted_data_unittest.cc
@@ -22,9 +22,15 @@ TEST(PersistedDataTest, Simple) {
metadata->SetDateLastRollCall(items, 3383);
EXPECT_EQ(3383, metadata->GetDateLastRollCall("someappid"));
EXPECT_EQ(-2, metadata->GetDateLastRollCall("someotherappid"));
+ const std::string pf1 = metadata->GetPingFreshness("someappid");
+ EXPECT_FALSE(pf1.empty());
metadata->SetDateLastRollCall(items, 3386);
EXPECT_EQ(3386, metadata->GetDateLastRollCall("someappid"));
EXPECT_EQ(-2, metadata->GetDateLastRollCall("someotherappid"));
+ const std::string pf2 = metadata->GetPingFreshness("someappid");
+ EXPECT_FALSE(pf2.empty());
+ // The following has a 1 / 2^128 chance of being flaky.
+ EXPECT_NE(pf1, pf2);
}
TEST(PersistedDataTest, SharedPref) {
« no previous file with comments | « components/update_client/persisted_data.cc ('k') | components/update_client/update_checker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698