chromium/ui/views/controls/textfield/textfield_model_unittest.cc

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

#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

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) {}

// TODO(xji): temporarily disable in platform Win since the complex script
// characters and Chinese characters are turned into empty square due to font
// regression.
#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) {}

// Tests that clipboard text with leading, trailing and interspersed tabs
// spaces etc is pasted correctly. Leading and trailing tabs should be
// stripped. Text separated by multiple tabs/spaces should be left alone.
// Text with just tabs and spaces should be pasted as one space.
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) {}

}  // namespace views