#include "components/offline_pages/core/model/clear_storage_task.h"
#include <memory>
#include <string>
#include <vector>
#include "base/files/file_enumerator.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/functional/bind.h"
#include "base/memory/weak_ptr.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/simple_test_clock.h"
#include "base/time/time.h"
#include "components/offline_pages/core/client_namespace_constants.h"
#include "components/offline_pages/core/model/model_task_test_base.h"
#include "components/offline_pages/core/model/offline_page_test_utils.h"
#include "components/offline_pages/core/offline_page_client_policy.h"
#include "components/offline_pages/core/test_scoped_offline_clock.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace offline_pages {
ClearStorageResult;
StorageStats;
namespace {
const int64_t kTestFileSize = …;
const int64_t kFreeSpaceNormal = …;
enum TestOptions { … };
struct PageSettings { … };
class TestArchiveManager : public ArchiveManager { … };
}
class ClearStorageTaskTest : public ModelTaskTestBase { … };
ClearStorageTaskTest::ClearStorageTaskTest()
: … { … }
ClearStorageTaskTest::~ClearStorageTaskTest() { … }
void ClearStorageTaskTest::SetUp() { … }
void ClearStorageTaskTest::Initialize(
const std::vector<PageSettings>& page_settings,
TestOptions options) { … }
void ClearStorageTaskTest::OnClearStorageDone(size_t cleared_page_count,
ClearStorageResult result) { … }
void ClearStorageTaskTest::AddPages(const PageSettings& setting) { … }
void ClearStorageTaskTest::RunClearStorageTask(const base::Time& start_time) { … }
TEST_F(ClearStorageTaskTest, ClearPagesLessThanLimit) { … }
TEST_F(ClearStorageTaskTest, ClearPagesMoreFreshPages) { … }
TEST_F(ClearStorageTaskTest, TryClearPersistentPages) { … }
TEST_F(ClearStorageTaskTest, TryClearPersistentPagesWithStoragePressure) { … }
TEST_F(ClearStorageTaskTest, ClearMultipleTimes) { … }
}