| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "components/offline_pages/offline_page_storage_manager.h" | 5 #include "components/offline_pages/core/offline_page_storage_manager.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 #include <map> | 8 #include <map> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/bind.h" | 11 #include "base/bind.h" |
| 12 #include "base/files/file_path.h" | 12 #include "base/files/file_path.h" |
| 13 #include "base/test/simple_test_clock.h" | 13 #include "base/test/simple_test_clock.h" |
| 14 #include "base/time/time.h" | 14 #include "base/time/time.h" |
| 15 #include "components/offline_pages/archive_manager.h" | 15 #include "components/offline_pages/core/archive_manager.h" |
| 16 #include "components/offline_pages/client_namespace_constants.h" | 16 #include "components/offline_pages/core/client_namespace_constants.h" |
| 17 #include "components/offline_pages/client_policy_controller.h" | 17 #include "components/offline_pages/core/client_policy_controller.h" |
| 18 #include "components/offline_pages/offline_page_item.h" | 18 #include "components/offline_pages/core/offline_page_item.h" |
| 19 #include "components/offline_pages/offline_page_model_impl.h" | 19 #include "components/offline_pages/core/offline_page_model_impl.h" |
| 20 #include "components/offline_pages/offline_page_types.h" | 20 #include "components/offline_pages/core/offline_page_types.h" |
| 21 #include "testing/gtest/include/gtest/gtest.h" | 21 #include "testing/gtest/include/gtest/gtest.h" |
| 22 | 22 |
| 23 using LifetimePolicy = offline_pages::LifetimePolicy; | 23 using LifetimePolicy = offline_pages::LifetimePolicy; |
| 24 using ClearStorageResult = | 24 using ClearStorageResult = |
| 25 offline_pages::OfflinePageStorageManager::ClearStorageResult; | 25 offline_pages::OfflinePageStorageManager::ClearStorageResult; |
| 26 using StorageStats = offline_pages::ArchiveManager::StorageStats; | 26 using StorageStats = offline_pages::ArchiveManager::StorageStats; |
| 27 | 27 |
| 28 namespace offline_pages { | 28 namespace offline_pages { |
| 29 | 29 |
| 30 namespace { | 30 namespace { |
| (...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 TryClearPages(); | 385 TryClearPages(); |
| 386 EXPECT_EQ(0, model()->GetTotalSize()); | 386 EXPECT_EQ(0, model()->GetTotalSize()); |
| 387 EXPECT_EQ(5, total_cleared_times()); | 387 EXPECT_EQ(5, total_cleared_times()); |
| 388 EXPECT_EQ(ClearStorageResult::SUCCESS, last_clear_storage_result()); | 388 EXPECT_EQ(ClearStorageResult::SUCCESS, last_clear_storage_result()); |
| 389 // Number of removed pages should be all the pages initially created plus 400 | 389 // Number of removed pages should be all the pages initially created plus 400 |
| 390 // more pages added above for bookmark namespace. | 390 // more pages added above for bookmark namespace. |
| 391 EXPECT_EQ(171 + 400, static_cast<int>(model()->GetRemovedPages().size())); | 391 EXPECT_EQ(171 + 400, static_cast<int>(model()->GetRemovedPages().size())); |
| 392 } | 392 } |
| 393 | 393 |
| 394 } // namespace offline_pages | 394 } // namespace offline_pages |
| OLD | NEW |