#include "ui/views/controls/textfield/textfield_model.h"
#include <stddef.h>
#include <memory>
#include <string>
#include <vector>
#include "base/auto_reset.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/base/clipboard/clipboard.h"
#include "ui/base/clipboard/scoped_clipboard_writer.h"
#include "ui/gfx/range/range.h"
#include "ui/gfx/render_text.h"
#include "ui/views/controls/textfield/textfield.h"
#include "ui/views/test/test_views_delegate.h"
#include "ui/views/test/views_test_base.h"
namespace {
struct WordAndCursor { … };
}
namespace views {
class TextfieldModelTest : public ViewsTestBase,
public TextfieldModel::Delegate { … };
TEST_F(TextfieldModelTest, EditString) { … }
TEST_F(TextfieldModelTest, EditString_SimpleRTL) { … }
TEST_F(TextfieldModelTest, EditString_ComplexScript) { … }
TEST_F(TextfieldModelTest, EmptyString) { … }
TEST_F(TextfieldModelTest, Selection) { … }
TEST_F(TextfieldModelTest, Selection_BidiWithNonSpacingMarks) { … }
TEST_F(TextfieldModelTest, SelectionAndEdit) { … }
TEST_F(TextfieldModelTest, SelectionAndEdit_WithSecondarySelection) { … }
TEST_F(TextfieldModelTest, Word) { … }
TEST_F(TextfieldModelTest, SetText) { … }
TEST_F(TextfieldModelTest, Clipboard) { … }
TEST_F(TextfieldModelTest, Clipboard_WithSecondarySelections) { … }
static void SelectWordTestVerifier(
const TextfieldModel& model,
const std::u16string& expected_selected_string,
size_t expected_cursor_pos) { … }
TEST_F(TextfieldModelTest, SelectWordTest) { … }
#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
TEST_F(TextfieldModelTest, SelectWordTest_MixScripts) { … }
#endif
TEST_F(TextfieldModelTest, RangeTest) { … }
TEST_F(TextfieldModelTest, SelectRangeTest) { … }
TEST_F(TextfieldModelTest, SelectionTest) { … }
TEST_F(TextfieldModelTest, SelectSelectionModelTest) { … }
TEST_F(TextfieldModelTest, CompositionTextTest) { … }
TEST_F(TextfieldModelTest, UndoRedo_BasicTest) { … }
TEST_F(TextfieldModelTest, UndoRedo_SetText) { … }
TEST_F(TextfieldModelTest, UndoRedo_BackspaceThenSetText) { … }
TEST_F(TextfieldModelTest, UndoRedo_CutCopyPasteTest) { … }
TEST_F(TextfieldModelTest, UndoRedo_CursorTest) { … }
TEST_F(TextfieldModelTest, Undo_SelectionTest) { … }
void RunInsertReplaceTest(TextfieldModel* model) { … }
void RunOverwriteReplaceTest(TextfieldModel* model) { … }
TEST_F(TextfieldModelTest, UndoRedo_ReplaceTest) { … }
TEST_F(TextfieldModelTest, UndoRedo_CompositionText) { … }
TEST_F(TextfieldModelTest, UndoRedo_TypingWithSecondarySelections) { … }
TEST_F(TextfieldModelTest, UndoRedo_MergingEditsWithSecondarySelections) { … }
TEST_F(TextfieldModelTest, Clipboard_WhiteSpaceStringTest) { … }
TEST_F(TextfieldModelTest, Transpose) { … }
TEST_F(TextfieldModelTest, Yank) { … }
TEST_F(TextfieldModelTest, SetCompositionFromExistingText) { … }
TEST_F(TextfieldModelTest, SetCompositionFromExistingText_Empty) { … }
TEST_F(TextfieldModelTest, SetCompositionFromExistingText_OutOfBounds) { … }
}