chromium/net/disk_cache/simple/simple_version_upgrade_unittest.cc

// Copyright 2013 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/40284755): Remove this and spanify to fix the errors.
#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 {

// Same as |disk_cache::kSimpleInitialMagicNumber|.
const uint64_t kSimpleInitialMagicNumber =0xfcfb6d1ba7725c30);

// The "fake index" file that cache backends use to distinguish whether the
// cache belongs to one backend or another.
const char kFakeIndexFileName[] =;

// Same as |SimpleIndexFile::kIndexDirectory|.
const char kIndexDirName[] =;

// Same as |SimpleIndexFile::kIndexFileName|.
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) {}

}  // namespace