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

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: Rebasing 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 a56851d0c19ec18c27d3745c8f5f70b6198186ef..2ed53a23477395f3b7bbe4c459249fde93e00c2d 100644
--- a/components/offline_pages/offline_page_metadata_store_impl_unittest.cc
+++ b/components/offline_pages/offline_page_metadata_store_impl_unittest.cc
@@ -179,6 +179,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,
+ 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);
}
@@ -250,6 +252,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,
@@ -312,6 +315,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);
}
@@ -347,12 +352,15 @@ 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);
// Then update some data.
offline_page.file_size = kFileSize + 1;
offline_page.access_count++;
+ offline_page.expiration_time = base::Time::Now();
store->AddOrUpdateOfflinePage(
offline_page,
base::Bind(&OfflinePageMetadataStoreTestBase::UpdateCallback,
@@ -377,6 +385,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);
}
« no previous file with comments | « components/offline_pages/offline_page_item.cc ('k') | components/offline_pages/offline_page_metadata_store_sql.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698