#include "net/disk_cache/simple/simple_index.h"
#include <algorithm>
#include <functional>
#include <memory>
#include <utility>
#include "base/files/scoped_temp_dir.h"
#include "base/functional/bind.h"
#include "base/hash/hash.h"
#include "base/memory/raw_ptr.h"
#include "base/pickle.h"
#include "base/strings/stringprintf.h"
#include "base/task/task_runner.h"
#include "base/test/mock_entropy_provider.h"
#include "base/threading/platform_thread.h"
#include "base/time/time.h"
#include "net/base/cache_type.h"
#include "net/disk_cache/backend_cleanup_tracker.h"
#include "net/disk_cache/disk_cache.h"
#include "net/disk_cache/simple/simple_index_delegate.h"
#include "net/disk_cache/simple/simple_index_file.h"
#include "net/disk_cache/simple/simple_test_util.h"
#include "net/disk_cache/simple/simple_util.h"
#include "net/test/test_with_task_environment.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace disk_cache {
namespace {
const base::Time kTestLastUsedTime = …;
const uint32_t kTestEntrySize = …;
const uint8_t kTestEntryMemoryData = …;
uint32_t RoundSize(uint32_t in) { … }
}
class EntryMetadataTest : public testing::Test { … };
class MockSimpleIndexFile final : public SimpleIndexFile { … };
class SimpleIndexTest : public net::TestWithTaskEnvironment,
public SimpleIndexDelegate { … };
class SimpleIndexAppCacheTest : public SimpleIndexTest { … };
class SimpleIndexCodeCacheTest : public SimpleIndexTest { … };
TEST_F(EntryMetadataTest, Basics) { … }
TEST_F(EntryMetadataTest, SaturatedLastUsedTime) { … }
TEST_F(EntryMetadataTest, Serialize) { … }
TEST_F(SimpleIndexTest, IndexSizeCorrectOnMerge) { … }
TEST_F(SimpleIndexTest, BasicInsertRemove) { … }
TEST_F(SimpleIndexTest, Has) { … }
TEST_F(SimpleIndexTest, UseIfExists) { … }
TEST_F(SimpleIndexTest, UpdateEntrySize) { … }
TEST_F(SimpleIndexTest, GetEntryCount) { … }
TEST_F(SimpleIndexTest, BasicInit) { … }
TEST_F(SimpleIndexTest, RemoveBeforeInit) { … }
TEST_F(SimpleIndexTest, InsertBeforeInit) { … }
TEST_F(SimpleIndexTest, InsertRemoveBeforeInit) { … }
TEST_F(SimpleIndexTest, RemoveInsertBeforeInit) { … }
TEST_F(SimpleIndexTest, AllInitConflicts) { … }
TEST_F(SimpleIndexTest, BasicEviction) { … }
TEST_F(SimpleIndexTest, EvictBySize) { … }
TEST_F(SimpleIndexCodeCacheTest, DisableEvictBySize) { … }
TEST_F(SimpleIndexTest, EvictBySize2) { … }
TEST_F(SimpleIndexTest, DiskWriteQueued) { … }
TEST_F(SimpleIndexTest, DiskWriteExecuted) { … }
TEST_F(SimpleIndexTest, DiskWritePostponed) { … }
TEST_F(SimpleIndexAppCacheTest, DiskWriteQueued) { … }
}