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

Unified Diff: components/offline_pages/offline_page_model_unittest.cc

Issue 1378883002: [Offline pages] Selecting pages for clean up (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Further simplifying the string Created 5 years, 2 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
« no previous file with comments | « components/offline_pages/offline_page_model.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/offline_pages/offline_page_model_unittest.cc
diff --git a/components/offline_pages/offline_page_model_unittest.cc b/components/offline_pages/offline_page_model_unittest.cc
index 0aa80ab94e56b7ff34c0a57bd046c4454d0a2880..7c35ea8e4d3cf5996c9fd9438a7bd7e7ba1cdfb9 100644
--- a/components/offline_pages/offline_page_model_unittest.cc
+++ b/components/offline_pages/offline_page_model_unittest.cc
@@ -714,10 +714,11 @@ TEST_F(OfflinePageModelTest, GetPageByOfflineURL) {
// clean up, hence the numbers in time delta.
TEST_F(OfflinePageModelTest, GetPagesToCleanUp) {
base::Time now = base::Time::Now();
+ base::Time forty_days_ago = now - base::TimeDelta::FromDays(40);
OfflinePageItem page_1(
GURL(kTestUrl), kTestPageBookmarkId1,
base::FilePath(FILE_PATH_LITERAL("/test/location/page1.mhtml")),
- kTestFileSize, now - base::TimeDelta::FromDays(40));
+ kTestFileSize, forty_days_ago);
GetStore()->AddOrUpdateOfflinePage(
page_1,
base::Bind(&OfflinePageModelTest::OnStoreUpdateDone, AsWeakPtr()));
@@ -726,7 +727,8 @@ TEST_F(OfflinePageModelTest, GetPagesToCleanUp) {
OfflinePageItem page_2(
GURL(kTestUrl2), kTestPageBookmarkId2,
base::FilePath(FILE_PATH_LITERAL("/test/location/page2.mhtml")),
- kTestFileSize, now - base::TimeDelta::FromDays(31));
+ kTestFileSize, forty_days_ago);
+ page_2.last_access_time = now - base::TimeDelta::FromDays(31);
GetStore()->AddOrUpdateOfflinePage(
page_2,
base::Bind(&OfflinePageModelTest::OnStoreUpdateDone, AsWeakPtr()));
@@ -735,7 +737,8 @@ TEST_F(OfflinePageModelTest, GetPagesToCleanUp) {
OfflinePageItem page_3(
GURL("http://test.xyz"), 42,
base::FilePath(FILE_PATH_LITERAL("/test/location/page3.mhtml")),
- kTestFileSize, now - base::TimeDelta::FromDays(29));
+ kTestFileSize, forty_days_ago);
+ page_3.last_access_time = now - base::TimeDelta::FromDays(29);
GetStore()->AddOrUpdateOfflinePage(
page_3,
base::Bind(&OfflinePageModelTest::OnStoreUpdateDone, AsWeakPtr()));
« no previous file with comments | « components/offline_pages/offline_page_model.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698