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

Unified Diff: components/offline_pages/offline_page_storage_manager_unittest.cc

Issue 2111653002: [Offline Pages] Adding metadatas for namespace async_loading. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing tests. 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
« no previous file with comments | « components/offline_pages/offline_page_storage_manager.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/offline_pages/offline_page_storage_manager_unittest.cc
diff --git a/components/offline_pages/offline_page_storage_manager_unittest.cc b/components/offline_pages/offline_page_storage_manager_unittest.cc
index 75bda82b8faa57b5fdc1d8ca0983aca4e6454f72..69c132525d96e218c099ea88c60ca2d274042aa7 100644
--- a/components/offline_pages/offline_page_storage_manager_unittest.cc
+++ b/components/offline_pages/offline_page_storage_manager_unittest.cc
@@ -300,6 +300,16 @@ TEST_F(OfflinePageStorageManagerTest, TestClearPagesMoreFreshPages) {
EXPECT_EQ(0, static_cast<int>(model()->GetRemovedPages().size()));
}
+TEST_F(OfflinePageStorageManagerTest, TestDeleteAsyncPages) {
+ Initialize(std::vector<PageSettings>({{kAsyncNamespace, 20, 0}}));
+ clock()->Advance(base::TimeDelta::FromDays(367));
+ TryClearPages();
+ EXPECT_EQ(0, last_cleared_page_count());
+ EXPECT_EQ(1, total_cleared_times());
+ EXPECT_EQ(ClearStorageResult::SUCCESS, last_clear_storage_result());
+ EXPECT_EQ(0, static_cast<int>(model()->GetRemovedPages().size()));
+}
+
TEST_F(OfflinePageStorageManagerTest, TestDeletionFailed) {
Initialize(std::vector<PageSettings>(
{{kBookmarkNamespace, 10, 10}, {kLastNNamespace, 10, 10}}),
@@ -376,8 +386,9 @@ TEST_F(OfflinePageStorageManagerTest, TestTwoStepExpiration) {
}
TEST_F(OfflinePageStorageManagerTest, TestClearMultipleTimes) {
- Initialize(std::vector<PageSettings>(
- {{kBookmarkNamespace, 30, 0}, {kLastNNamespace, 100, 1}}),
+ Initialize(std::vector<PageSettings>({{kBookmarkNamespace, 30, 0},
+ {kLastNNamespace, 100, 1},
+ {kAsyncNamespace, 40, 0}}),
{1000 * (1 << 20), 0});
clock()->Advance(base::TimeDelta::FromMinutes(30));
LifetimePolicy policy =
« no previous file with comments | « components/offline_pages/offline_page_storage_manager.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698