#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "net/disk_cache/simple/simple_index_file.h"
#include <memory>
#include "base/check.h"
#include "base/files/file.h"
#include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h"
#include "base/functional/callback.h"
#include "base/hash/hash.h"
#include "base/location.h"
#include "base/pickle.h"
#include "base/run_loop.h"
#include "base/task/single_thread_task_runner.h"
#include "base/threading/thread.h"
#include "base/time/time.h"
#include "net/base/cache_type.h"
#include "net/base/test_completion_callback.h"
#include "net/disk_cache/backend_cleanup_tracker.h"
#include "net/disk_cache/disk_cache.h"
#include "net/disk_cache/disk_cache_test_util.h"
#include "net/disk_cache/simple/simple_backend_impl.h"
#include "net/disk_cache/simple/simple_backend_version.h"
#include "net/disk_cache/simple/simple_entry_format.h"
#include "net/disk_cache/simple/simple_index.h"
#include "net/disk_cache/simple/simple_util.h"
#include "net/disk_cache/simple/simple_version_upgrade.h"
#include "net/test/gtest_util.h"
#include "net/test/test_with_task_environment.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
IsOk;
Time;
SimpleIndexFile;
SimpleIndex;
namespace disk_cache {
namespace {
uint32_t RoundSize(uint32_t in) { … }
}
TEST(IndexMetadataTest, Basics) { … }
TEST(IndexMetadataTest, Serialize) { … }
class V6IndexMetadataForTest : public SimpleIndexFile::IndexMetadata { … };
TEST(IndexMetadataTest, ReadV6Format) { … }
class V7IndexMetadataForTest : public SimpleIndexFile::IndexMetadata { … };
class V8IndexMetadataForTest : public SimpleIndexFile::IndexMetadata { … };
class WrappedSimpleIndexFile : public SimpleIndexFile { … };
class SimpleIndexFileTest : public net::TestWithTaskEnvironment { … };
TEST_F(SimpleIndexFileTest, Serialize) { … }
TEST_F(SimpleIndexFileTest, SerializeAppCache) { … }
TEST_F(SimpleIndexFileTest, ReadV7Format) { … }
TEST_F(SimpleIndexFileTest, ReadV8Format) { … }
TEST_F(SimpleIndexFileTest, ReadV8FormatAppCache) { … }
TEST_F(SimpleIndexFileTest, LegacyIsIndexFileStale) { … }
TEST_F(SimpleIndexFileTest, WriteThenLoadIndex) { … }
TEST_F(SimpleIndexFileTest, LoadCorruptIndex) { … }
TEST_F(SimpleIndexFileTest, LoadCorruptIndex2) { … }
TEST_F(SimpleIndexFileTest, SimpleCacheUpgrade) { … }
TEST_F(SimpleIndexFileTest, OverwritesStaleTempFile) { … }
}