#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "net/disk_cache/simple/simple_version_upgrade.h"
#include <stdint.h>
#include <string>
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h"
#include "base/format_macros.h"
#include "base/strings/stringprintf.h"
#include "net/base/net_errors.h"
#include "net/disk_cache/disk_cache.h"
#include "net/disk_cache/simple/simple_backend_version.h"
#include "net/disk_cache/simple/simple_entry_format_history.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace {
const uint64_t kSimpleInitialMagicNumber = …0xfcfb6d1ba7725c30);
const char kFakeIndexFileName[] = …;
const char kIndexDirName[] = …;
const char kIndexFileName[] = …;
bool WriteFakeIndexFileV5(const base::FilePath& cache_path) { … }
TEST(SimpleVersionUpgradeTest, FailsToMigrateBackwards) { … }
TEST(SimpleVersionUpgradeTest, ExperimentBacktoDefault) { … }
TEST(SimpleVersionUpgradeTest, FakeIndexVersionGetsUpdated) { … }
TEST(SimpleVersionUpgradeTest, UpgradeV5V6IndexMustDisappear) { … }
TEST(SimpleVersionUpgradeTest, DeleteAllIndexFilesWhenCacheIsEmpty) { … }
TEST(SimpleVersionUpgradeTest, DoesNotDeleteIndexFilesWhenCacheIsNotEmpty) { … }
}