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

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: Twifkak's comments 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..43cc1c7b3ae8cc147859c9cf847bd94f6aaae491 100644
--- a/components/precache/core/precache_session_table_unittest.cc
+++ b/components/precache/core/precache_session_table_unittest.cc
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <stdint.h>
+
#include "base/compiler_specific.h"
#include "base/time/time.h"
#include "components/precache/core/precache_session_table.h"
@@ -31,6 +33,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