#include "chrome/browser/downgrade/snapshot_manager.h"
#include "base/containers/adapters.h"
#include "base/files/file.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h"
#include "base/strings/string_number_conversions.h"
#include "chrome/browser/downgrade/downgrade_utils.h"
#include "chrome/browser/downgrade/snapshot_file_collector.h"
#include "chrome/browser/downgrade/user_data_downgrade.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace downgrade {
namespace {
constexpr base::FilePath::StringPieceType kSomeFolder = …);
constexpr base::FilePath::StringPieceType kSomeFile = …);
constexpr base::FilePath::StringPieceType kSomeFolderFile = …);
constexpr base::FilePath::StringPieceType kSomeSubFolder = …);
constexpr base::FilePath::StringPieceType kSomeSubFile = …);
constexpr base::FilePath::StringPieceType kUserDataFolder = …);
constexpr base::FilePath::StringPieceType kProfileDataFolder = …);
constexpr base::FilePath::StringPieceType kUserDataFile = …);
constexpr base::FilePath::StringPieceType kProfileDataFile = …);
constexpr base::FilePath::StringPieceType kProfileDataJournalFile = …);
constexpr base::FilePath::StringPieceType kProfileDataExtFile = …);
constexpr base::FilePath::StringPieceType kProfileDataExtWalFile = …);
constexpr base::FilePath::StringPieceType kProfileDataExtShmFile = …);
constexpr std::array<base::FilePath::StringPieceType, 3>
kProfileDirectoryBaseNames = …;
class TestFolderAndFiles { … };
}
class TestSnapshotManager : public SnapshotManager { … };
class SnapshotManagerTest : public testing::Test { … };
TEST_F(SnapshotManagerTest, TakeSnapshot) { … }
TEST_F(SnapshotManagerTest, RestoreSnapshotOlderVersionAvailable) { … }
TEST_F(SnapshotManagerTest, RestoreSnapshotTargetVersionAvailable) { … }
TEST_F(SnapshotManagerTest, RestoreSnapshotIgnoresIncompleteSnapshots) { … }
TEST_F(SnapshotManagerTest, PurgeInvalidAndOldSnapshotsKeepsMaxValidSnapshots) { … }
TEST_F(SnapshotManagerTest, PurgeInvalidAndOldSnapshotsKeepsValidSnapshots) { … }
TEST_F(SnapshotManagerTest,
PurgeInvalidAndOldSnapshotsKeepsValidSnapshotsPerMilestone) { … }
}