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

Unified Diff: components/offline_pages/offline_page_metadata_store_impl_unittest.cc

Issue 1993953002: [Offline pages] Adding expiration capability to OfflinePageModel (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 7 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/offline_pages/offline_page_metadata_store_impl_unittest.cc
diff --git a/components/offline_pages/offline_page_metadata_store_impl_unittest.cc b/components/offline_pages/offline_page_metadata_store_impl_unittest.cc
index 58118b4a45692f07e4e97bffd4d183a1dfee6e36..516bba748d3c7783db2568aa9db5c461f1569f60 100644
--- a/components/offline_pages/offline_page_metadata_store_impl_unittest.cc
+++ b/components/offline_pages/offline_page_metadata_store_impl_unittest.cc
@@ -194,6 +194,8 @@ TYPED_TEST(OfflinePageMetadataStoreTest, AddOfflinePage) {
EXPECT_EQ(offline_page.creation_time, this->offline_pages_[0].creation_time);
EXPECT_EQ(offline_page.last_access_time,
this->offline_pages_[0].last_access_time);
+ EXPECT_EQ(offline_page.expiration_time,
jianli 2016/05/19 20:39:54 Please set an expiration time before calling AddOr
fgorski 2016/05/20 17:54:23 I am testing for that below, in a different test.
+ this->offline_pages_[0].expiration_time);
EXPECT_EQ(offline_page.access_count, this->offline_pages_[0].access_count);
EXPECT_EQ(offline_page.client_id, this->offline_pages_[0].client_id);
}
@@ -265,6 +267,7 @@ TYPED_TEST(OfflinePageMetadataStoreTest, AddRemoveMultipleOfflinePages) {
OfflinePageItem offline_page_2(GURL("https://other.page.com"), 5678LL,
kTestClientId2, file_path_2, 12345,
base::Time::Now());
+ offline_page_2.expiration_time = base::Time::Now();
store->AddOrUpdateOfflinePage(
offline_page_1,
base::Bind(&OfflinePageMetadataStoreTestBase::UpdateCallback,
@@ -327,6 +330,8 @@ TYPED_TEST(OfflinePageMetadataStoreTest, AddRemoveMultipleOfflinePages) {
this->offline_pages_[0].creation_time);
EXPECT_EQ(offline_page_2.last_access_time,
this->offline_pages_[0].last_access_time);
+ EXPECT_EQ(offline_page_2.expiration_time,
+ this->offline_pages_[0].expiration_time);
EXPECT_EQ(offline_page_2.access_count, this->offline_pages_[0].access_count);
EXPECT_EQ(offline_page_2.client_id, this->offline_pages_[0].client_id);
}
@@ -362,6 +367,8 @@ TYPED_TEST(OfflinePageMetadataStoreTest, UpdateOfflinePage) {
EXPECT_EQ(offline_page.creation_time, this->offline_pages_[0].creation_time);
EXPECT_EQ(offline_page.last_access_time,
this->offline_pages_[0].last_access_time);
+ EXPECT_EQ(offline_page.expiration_time,
+ this->offline_pages_[0].expiration_time);
EXPECT_EQ(offline_page.access_count, this->offline_pages_[0].access_count);
EXPECT_EQ(offline_page.client_id, this->offline_pages_[0].client_id);
@@ -392,6 +399,8 @@ TYPED_TEST(OfflinePageMetadataStoreTest, UpdateOfflinePage) {
EXPECT_EQ(offline_page.creation_time, this->offline_pages_[0].creation_time);
EXPECT_EQ(offline_page.last_access_time,
this->offline_pages_[0].last_access_time);
+ EXPECT_EQ(offline_page.expiration_time,
+ this->offline_pages_[0].expiration_time);
EXPECT_EQ(offline_page.access_count, this->offline_pages_[0].access_count);
EXPECT_EQ(offline_page.client_id, this->offline_pages_[0].client_id);
}
@@ -471,6 +480,8 @@ TEST_F(OfflinePageMetadataStoreImplTest, LoadCorruptedStore) {
EXPECT_EQ(offline_page.creation_time, this->offline_pages_[0].creation_time);
EXPECT_EQ(offline_page.last_access_time,
this->offline_pages_[0].last_access_time);
+ EXPECT_EQ(offline_page.expiration_time,
+ this->offline_pages_[0].expiration_time);
EXPECT_EQ(offline_page.access_count, this->offline_pages_[0].access_count);
}

Powered by Google App Engine
This is Rietveld 408576698