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

Unified Diff: components/update_client/persisted_data_unittest.cc

Issue 1889263002: Implement ping_freshness for update_client. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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
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..7ea0865ffc8504126b2263c7f8d48e51e251eae3 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"));
+ std::string pf1 = metadata->GetPingFreshness("someappid");
Sorin Jianu 2016/04/15 20:26:53 const?
waffles 2016/04/15 21:54:20 Done.
+ EXPECT_FALSE(pf1.empty());
metadata->SetDateLastRollCall(items, 3386);
EXPECT_EQ(3386, metadata->GetDateLastRollCall("someappid"));
EXPECT_EQ(-2, metadata->GetDateLastRollCall("someotherappid"));
+ 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) {

Powered by Google App Engine
This is Rietveld 408576698