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

Unified Diff: components/precache/core/precache_session_table_unittest.cc

Issue 2123813002: Report Precache.TimeSinceLastPrecache (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: MaybePostFlush Created 4 years, 5 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/precache/core/precache_session_table_unittest.cc
diff --git a/components/precache/core/precache_session_table_unittest.cc b/components/precache/core/precache_session_table_unittest.cc
index c0d37d502730e7523d430121f2d58e97e72e934b..c15030127934604cdad63c2f46d0a27b29e02bf2 100644
--- a/components/precache/core/precache_session_table_unittest.cc
+++ b/components/precache/core/precache_session_table_unittest.cc
@@ -31,6 +31,18 @@ class PrecacheSessionTableTest : public testing::Test {
std::unique_ptr<sql::Connection> db_;
};
+TEST_F(PrecacheSessionTableTest, LastPrecacheTimestamp) {
+ const base::Time sometime = base::Time::FromDoubleT(42);
+
+ precache_session_table_->SetLastPrecacheTimestamp(sometime);
+
+ EXPECT_EQ(sometime, precache_session_table_->GetLastPrecacheTimestamp());
+
+ precache_session_table_->DeleteLastPrecacheTimestamp();
+
+ EXPECT_EQ(base::Time(), precache_session_table_->GetLastPrecacheTimestamp());
+}
+
TEST_F(PrecacheSessionTableTest, SaveAndGetUnfinishedWork) {
std::unique_ptr<PrecacheUnfinishedWork> unfinished_work(
new PrecacheUnfinishedWork());

Powered by Google App Engine
This is Rietveld 408576698