#include "components/undo/undo_manager.h"
#include <memory>
#include "base/auto_reset.h"
#include "base/memory/raw_ptr.h"
#include "components/undo/undo_manager_observer.h"
#include "components/undo/undo_operation.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace {
std::vector<UndoOperation*> ConvertToRawPtrVector(
const std::vector<std::unique_ptr<UndoOperation>>& args) { … }
}
class UndoManagerTestApi { … };
std::vector<UndoOperation*> UndoManagerTestApi::GetAllUndoOperations(
const UndoManager& undo_manager) { … }
namespace {
class TestUndoOperation;
class TestUndoService { … };
class TestUndoOperation : public UndoOperation { … };
TestUndoOperation::TestUndoOperation(TestUndoService* undo_service)
: … { … }
TestUndoOperation::~TestUndoOperation() { … }
void TestUndoOperation::Undo() { … }
int TestUndoOperation::GetUndoLabelId() const { … }
int TestUndoOperation::GetRedoLabelId() const { … }
TestUndoService::TestUndoService() : … { … }
TestUndoService::~TestUndoService() { … }
void TestUndoService::Redo() { … }
void TestUndoService::TriggerOperation() { … }
void TestUndoService::RecordUndoCall() { … }
class TestObserver : public UndoManagerObserver { … };
TEST(UndoServiceTest, AddUndoActions) { … }
TEST(UndoServiceTest, UndoMultipleActions) { … }
TEST(UndoServiceTest, RedoAction) { … }
TEST(UndoServiceTest, GroupActions) { … }
TEST(UndoServiceTest, SuspendUndoTracking) { … }
TEST(UndoServiceTest, RedoEmptyAfterNewAction) { … }
TEST(UndoServiceTest, GetAllUndoOperations) { … }
TEST(UndoServiceTest, ObserverCallbacks) { … }
}