#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "components/sessions/core/command_storage_backend.h"
#include <stddef.h>
#include <limits>
#include <utility>
#include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/memory/scoped_refptr.h"
#include "base/path_service.h"
#include "base/run_loop.h"
#include "base/strings/string_util.h"
#include "base/test/bind.h"
#include "base/test/simple_test_clock.h"
#include "base/test/task_environment.h"
#include "base/time/time.h"
#include "components/sessions/core/command_storage_manager.h"
#include "components/sessions/core/session_constants.h"
#include "components/sessions/core/session_service_commands.h"
#include "testing/gtest/include/gtest/gtest.h"
MakeRefCounted;
namespace sessions {
size_type;
namespace {
SessionCommands;
struct TestData { … };
std::unique_ptr<SessionCommand> CreateCommandFromData(const TestData& data) { … }
}
class CommandStorageBackendTest : public testing::Test { … };
TEST_F(CommandStorageBackendTest, MigrateOther) { … }
TEST_F(CommandStorageBackendTest, SimpleReadWriteEncrypted) { … }
TEST_F(CommandStorageBackendTest, RandomDataEncrypted) { … }
TEST_F(CommandStorageBackendTest, BigDataEncrypted) { … }
TEST_F(CommandStorageBackendTest, MarkerOnlyEncrypted) { … }
TEST_F(CommandStorageBackendTest, TruncateEncrypted) { … }
std::unique_ptr<SessionCommand> CreateCommandWithMaxSize() { … }
TEST_F(CommandStorageBackendTest, MaxSizeTypeEncrypted) { … }
TEST_F(CommandStorageBackendTest, MaxSizeType) { … }
TEST_F(CommandStorageBackendTest, IsValidFileWithInvalidFiles) { … }
TEST_F(CommandStorageBackendTest, IsNotValidFileWithoutMarker) { … }
TEST_F(CommandStorageBackendTest, SimpleReadWriteWithRestoreType) { … }
TEST_F(CommandStorageBackendTest, RandomDataWithRestoreType) { … }
TEST_F(CommandStorageBackendTest, BigDataWithRestoreType) { … }
TEST_F(CommandStorageBackendTest, CommandWithRestoreType) { … }
TEST_F(CommandStorageBackendTest, TruncateWithRestoreType) { … }
TEST_F(CommandStorageBackendTest, TimestampFromPathWithRestoreType) { … }
TEST_F(CommandStorageBackendTest, FilePathFromTimeWithRestoreType) { … }
TEST_F(CommandStorageBackendTest,
DeterminePreviousSessionEmptyWithRestoreType) { … }
TEST_F(CommandStorageBackendTest,
DeterminePreviousSessionSingleWithRestoreType) { … }
TEST_F(CommandStorageBackendTest,
DeterminePreviousSessionMultipleWithRestoreType) { … }
TEST_F(CommandStorageBackendTest,
DeterminePreviousSessionInvalidWithRestoreType) { … }
TEST_F(CommandStorageBackendTest,
MoveCurrentSessionToLastDeletesLastSessionWithRestoreType) { … }
TEST_F(CommandStorageBackendTest, GetSessionFiles) { … }
TEST_F(CommandStorageBackendTest, TimestampSeparatorIsAscii) { … }
TEST_F(CommandStorageBackendTest, GetSessionFilesAreSortedByReverseTimestamp) { … }
TEST_F(CommandStorageBackendTest, UseMarkerWithoutValidMarker) { … }
TEST_F(CommandStorageBackendTest, ReadPreviouslyWrittenData) { … }
TEST_F(CommandStorageBackendTest, NewFileOnTruncate) { … }
TEST_F(CommandStorageBackendTest, AppendCommandsCallbackRunOnError) { … }
TEST_F(CommandStorageBackendTest, RestoresFileWithMarkerAfterFailure) { … }
TEST_F(CommandStorageBackendTest, PathTimeIncreases) { … }
}