chromium/third_party/blink/renderer/core/editing/ime/input_method_controller_test.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 "third_party/blink/renderer/core/editing/ime/input_method_controller.h"

#include <memory>
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/renderer/core/dom/document.h"
#include "third_party/blink/renderer/core/dom/element.h"
#include "third_party/blink/renderer/core/dom/node_list.h"
#include "third_party/blink/renderer/core/dom/range.h"
#include "third_party/blink/renderer/core/editing/editor.h"
#include "third_party/blink/renderer/core/editing/ephemeral_range.h"
#include "third_party/blink/renderer/core/editing/frame_selection.h"
#include "third_party/blink/renderer/core/editing/markers/document_marker_controller.h"
#include "third_party/blink/renderer/core/editing/selection_template.h"
#include "third_party/blink/renderer/core/editing/testing/editing_test_base.h"
#include "third_party/blink/renderer/core/events/mouse_event.h"
#include "third_party/blink/renderer/core/frame/local_frame.h"
#include "third_party/blink/renderer/core/frame/local_frame_view.h"
#include "third_party/blink/renderer/core/frame/settings.h"
#include "third_party/blink/renderer/core/frame/visual_viewport.h"
#include "third_party/blink/renderer/core/html/forms/html_input_element.h"
#include "third_party/blink/renderer/core/html/forms/html_text_area_element.h"
#include "third_party/blink/renderer/core/layout/layout_theme.h"

ImeTextSpanThickness;
ImeTextSpanUnderlineStyle;

namespace blink {

class InputMethodControllerTest : public EditingTestBase {};

Element* InputMethodControllerTest::InsertHTMLElement(const char* element_code,
                                                      const char* element_id) {}

void InputMethodControllerTest::CreateHTMLWithCompositionInputEventListeners() {}

void InputMethodControllerTest::CreateHTMLWithCompositionEndEventListener(
    const SelectionType type) {}

TEST_F(InputMethodControllerTest, BackspaceFromEndOfInput) {}

TEST_F(InputMethodControllerTest, SetCompositionFromExistingText) {}

TEST_F(InputMethodControllerTest, AddImeTextSpansToExistingText) {}

TEST_F(InputMethodControllerTest, AddGrammarCheckSpans) {}

TEST_F(InputMethodControllerTest, GetImeTextSpans) {}

TEST_F(InputMethodControllerTest, SetCompositionAfterEmoji) {}

TEST_F(InputMethodControllerTest, SetCompositionWithGraphemeCluster) {}

TEST_F(InputMethodControllerTest,
       SetCompositionWithGraphemeClusterAndMultipleNodes) {}

TEST_F(InputMethodControllerTest, SetCompositionKeepingStyle) {}

TEST_F(InputMethodControllerTest, SetCompositionWithEmojiKeepingStyle) {}

TEST_F(InputMethodControllerTest,
       SetCompositionWithTeluguSignVisargaKeepingStyle) {}

TEST_F(InputMethodControllerTest, FinishComposingTextKeepingStyle) {}

TEST_F(InputMethodControllerTest, FinishComposingTextKeepingBackwardSelection) {}

TEST_F(InputMethodControllerTest, CommitTextKeepingStyle) {}

TEST_F(InputMethodControllerTest, InsertTextWithNewLine) {}

TEST_F(InputMethodControllerTest, InsertTextWithNewLineIncrementally) {}

TEST_F(InputMethodControllerTest, SelectionOnConfirmExistingText) {}

TEST_F(InputMethodControllerTest, DeleteBySettingEmptyComposition) {}

TEST_F(InputMethodControllerTest,
       SetCompositionFromExistingTextWithCollapsedWhiteSpace) {}

TEST_F(InputMethodControllerTest,
       SetCompositionFromExistingTextWithInvalidOffsets) {}

TEST_F(InputMethodControllerTest, ConfirmPasswordComposition) {}

TEST_F(InputMethodControllerTest, DeleteSurroundingTextWithEmptyText) {}

TEST_F(InputMethodControllerTest, DeleteSurroundingTextWithRangeSelection) {}

TEST_F(InputMethodControllerTest, DeleteSurroundingTextWithCursorSelection) {}

TEST_F(InputMethodControllerTest,
       DeleteSurroundingTextWithMultiCodeTextOnTheLeft) {}

TEST_F(InputMethodControllerTest,
       DeleteSurroundingTextWithMultiCodeTextOnTheRight) {}

TEST_F(InputMethodControllerTest,
       DeleteSurroundingTextWithMultiCodeTextOnBothSides) {}

// This test comes from http://crbug.com/1024738. It is basically the same to
// composed text (U+0E01 "ka kai" + U+0E49 "mai tho"), but easier to understand.
TEST_F(InputMethodControllerTest, DeleteSurroundingTextForComposedCharacter) {}

TEST_F(InputMethodControllerTest, DeleteSurroundingTextForMultipleNodes) {}

TEST_F(InputMethodControllerTest,
       DeleteSurroundingTextInCodePointsWithMultiCodeTextOnTheLeft) {}

TEST_F(InputMethodControllerTest,
       DeleteSurroundingTextInCodePointsWithMultiCodeTextOnTheRight) {}

TEST_F(InputMethodControllerTest,
       DeleteSurroundingTextInCodePointsWithMultiCodeTextOnBothSides) {}

TEST_F(InputMethodControllerTest, DeleteSurroundingTextInCodePointsWithImage) {}

TEST_F(InputMethodControllerTest,
       DeleteSurroundingTextInCodePointsWithInvalidSurrogatePair) {}

TEST_F(InputMethodControllerTest, ReplaceTextAndDoNotChangeSelection) {}

TEST_F(InputMethodControllerTest,
       ReplaceTextAndMoveCursorAfterTheReplacementText) {}

TEST_F(InputMethodControllerTest, SetCompositionForInputWithNewCaretPositions) {}

TEST_F(InputMethodControllerTest,
       SetCompositionForContentEditableWithNewCaretPositions) {}

TEST_F(InputMethodControllerTest, SetCompositionWithEmptyText) {}

TEST_F(InputMethodControllerTest, InsertLineBreakWhileComposingText) {}

TEST_F(InputMethodControllerTest, InsertLineBreakAfterConfirmingText) {}

TEST_F(InputMethodControllerTest, CompositionInputEventIsComposing) {}

TEST_F(InputMethodControllerTest, CompositionInputEventForReplace) {}

TEST_F(InputMethodControllerTest, CompositionInputEventForConfirm) {}

TEST_F(InputMethodControllerTest, CompositionInputEventForDelete) {}

TEST_F(InputMethodControllerTest, CompositionInputEventForInsert) {}

TEST_F(InputMethodControllerTest, CompositionInputEventForInsertEmptyText) {}

TEST_F(InputMethodControllerTest, CompositionEndEventWithNoSelection) {}

TEST_F(InputMethodControllerTest, FinishCompositionRemovedRange) {}

TEST_F(InputMethodControllerTest, ReflectsSpaceWithoutNbspMangling) {}

TEST_F(InputMethodControllerTest, SetCompositionPlainTextWithIme_Text_Span) {}

TEST_F(InputMethodControllerTest,
       SetCompositionPlainTextWithIme_Text_Span_Interim_Char_Selection) {}

TEST_F(InputMethodControllerTest, CommitPlainTextWithIme_Text_SpanInsert) {}

TEST_F(InputMethodControllerTest, CommitPlainTextWithIme_Text_SpanReplace) {}

TEST_F(InputMethodControllerTest, ImeTextSpanAppearsCorrectlyAfterNewline) {}

TEST_F(InputMethodControllerTest, SelectionWhenFocusChangeFinishesComposition) {}

TEST_F(InputMethodControllerTest, SetEmptyCompositionShouldNotMoveCaret) {}

TEST_F(InputMethodControllerTest, WhitespaceFixup) {}

TEST_F(InputMethodControllerTest, CommitEmptyTextDeletesSelection) {}

static String GetMarkedText(
    DocumentMarkerController& document_marker_controller,
    Node* node,
    int marker_index) {}

TEST_F(InputMethodControllerTest,
       Marker_WhitespaceFixupAroundContentIndependentMarkerNotContainingSpace) {}

TEST_F(InputMethodControllerTest,
       Marker_WhitespaceFixupAroundContentIndependentMarkerBeginningWithSpace) {}

TEST_F(InputMethodControllerTest,
       Marker_WhitespaceFixupAroundContentIndependentMarkerEndingWithSpace) {}

TEST_F(
    InputMethodControllerTest,
    Marker_WhitespaceFixupAroundContentIndependentMarkerBeginningAndEndingWithSpaces) {}

TEST_F(InputMethodControllerTest, ContentDependentMarker_ReplaceStartOfMarker) {}

TEST_F(InputMethodControllerTest,
       ContentIndependentMarker_ReplaceStartOfMarker) {}

TEST_F(InputMethodControllerTest,
       ContentDependentMarker_ReplaceTextContainsStartOfMarker) {}

TEST_F(InputMethodControllerTest,
       ContentIndependentMarker_ReplaceTextContainsStartOfMarker) {}

TEST_F(InputMethodControllerTest, ContentDependentMarker_ReplaceEndOfMarker) {}

TEST_F(InputMethodControllerTest, ContentIndependentMarker_ReplaceEndOfMarker) {}

TEST_F(InputMethodControllerTest,
       ContentDependentMarker_ReplaceTextContainsEndOfMarker) {}

TEST_F(InputMethodControllerTest,
       ContentIndependentMarker_ReplaceTextContainsEndOfMarker) {}

TEST_F(InputMethodControllerTest, ContentDependentMarker_ReplaceEntireMarker) {}

TEST_F(InputMethodControllerTest,
       ContentIndependentMarker_ReplaceEntireMarker) {}

TEST_F(InputMethodControllerTest,
       ContentDependentMarker_ReplaceTextWithMarkerAtBeginning) {}

TEST_F(InputMethodControllerTest,
       ContentIndependentMarker_ReplaceTextWithMarkerAtBeginning) {}

TEST_F(InputMethodControllerTest,
       ContentDependentMarker_ReplaceTextWithMarkerAtEnd) {}

TEST_F(InputMethodControllerTest,
       ContentIndependentMarker_ReplaceTextWithMarkerAtEnd) {}

TEST_F(InputMethodControllerTest, ContentDependentMarker_Deletions) {}

TEST_F(InputMethodControllerTest, ContentIndependentMarker_Deletions) {}

TEST_F(InputMethodControllerTest,
       ContentDependentMarker_DeleteExactlyOnMarker) {}

TEST_F(InputMethodControllerTest,
       ContentIndependentMarker_DeleteExactlyOnMarker) {}

TEST_F(InputMethodControllerTest, ContentDependentMarker_DeleteMiddleOfMarker) {}

TEST_F(InputMethodControllerTest,
       ContentIndependentMarker_DeleteMiddleOfMarker) {}

TEST_F(InputMethodControllerTest,
       ContentDependentMarker_InsertInMarkerInterior) {}

TEST_F(InputMethodControllerTest,
       ContentIndependentMarker_InsertInMarkerInterior) {}

TEST_F(InputMethodControllerTest, ContentDependentMarker_InsertBetweenMarkers) {}

TEST_F(InputMethodControllerTest,
       ContentIndependentMarker_InsertBetweenMarkers) {}

TEST_F(InputMethodControllerTest,
       CommitNotMisspellingSuggestionMarkerWithSpellCheckingDisabled) {}

TEST_F(InputMethodControllerTest,
       CommitMisspellingSuggestionMarkerWithSpellCheckingDisabled) {}

TEST_F(InputMethodControllerTest, RemoveSuggestionMarkerInRangeOnFinish) {}

TEST_F(InputMethodControllerTest, ClearImeTextSpansByType) {}

// For http://crbug.com/712761
TEST_F(InputMethodControllerTest, TextInputTypeAtBeforeEditable) {}

// http://crbug.com/721666
TEST_F(InputMethodControllerTest, MaxLength) {}

TEST_F(InputMethodControllerTest, InputModeOfFocusedElement) {}

TEST_F(InputMethodControllerTest, CompositionUnderlineSpansMultipleNodes) {}

// The following tests are for http://crbug.com/766680.

TEST_F(InputMethodControllerTest, SetCompositionDeletesMarkupBeforeText) {}

TEST_F(InputMethodControllerTest, SetCompositionDeletesMarkupAfterText) {}

TEST_F(InputMethodControllerTest,
       SetCompositionDeletesMarkupBeforeAndAfterText) {}

TEST_F(InputMethodControllerTest,
       SetCompositionWithPartialGraphemeWithCompositionUnderlineDoesntCrash) {}

TEST_F(
    InputMethodControllerTest,
    SetCompositionWithPartialGraphemeWithoutCompositionUnderlineDoesntCrash) {}

TEST_F(InputMethodControllerTest, SetCompositionContainingNewline) {}

TEST_F(InputMethodControllerTest, SetCompositionTamilVirama) {}

TEST_F(InputMethodControllerTest,
       CommitTextWithOpenCompositionAndInputEventHandlerChangingText) {}

TEST_F(InputMethodControllerTest,
       CommitTextWithoutCompositionAndInputEventHandlerChangingSelection) {}

TEST_F(
    InputMethodControllerTest,
    SetCompositionToEmptyStringWithOpenCompositionAndInputEventHandlerChangingText) {}

TEST_F(InputMethodControllerTest,
       SetCompositionWithOpenCompositionAndInputEventHandlerChangingText) {}

TEST_F(InputMethodControllerTest,
       SetCompositionWithOpenCompositionAndInputEventHandlerChangingSelection) {}

TEST_F(InputMethodControllerTest,
       SetCompositionToEmptyStringAndInputEventHandlerChangingSelection) {}

TEST_F(InputMethodControllerTest,
       SetCompositionDeleteSelectionAndInputEventHandlerChangingSelection) {}

TEST_F(InputMethodControllerTest,
       DeleteSelectionAndBeforeInputEventHandlerChangingStyle) {}

TEST_F(InputMethodControllerTest,
       CommitTextWithOpenCompositionAndCompositionEndEventHandlerChangingText) {}

TEST_F(
    InputMethodControllerTest,
    SetCompositionToEmptyStringWithOpenCompositionAndCompositionEndEventHandlerChangingText) {}

TEST_F(
    InputMethodControllerTest,
    SetCompositionToEmptyStringAndCompositionEndEventHandlerChangingSelection) {}

TEST_F(InputMethodControllerTest,
       FinishComposingTextDoNotKeepSelectionAndCompositionEndEventHandler) {}

TEST_F(InputMethodControllerTest,
       FinishComposingTextKeepSelectionAndCompositionEndEventHandler) {}

TEST_F(
    InputMethodControllerTest,
    SetCompositionFromExistingTextAndCompositionStartEventHandlerChangingStyle) {}

TEST_F(InputMethodControllerTest,
       FinishComposingTextTooLongKeepSelectionAndInputEventHandler) {}

TEST_F(InputMethodControllerTest,
       FinishComposingTextTooLongDoNotKeepSelectionAndInputEventHandler) {}

TEST_F(InputMethodControllerTest,
       FinishComposingTextTooLongKeepSelectionAndCompositionEndEventHandler) {}

TEST_F(
    InputMethodControllerTest,
    FinishComposingTextTooLongDoNotKeepSelectionAndCompositionEndEventHandler) {}

TEST_F(InputMethodControllerTest, AutocapitalizeTextInputFlags) {}

TEST_F(InputMethodControllerTest, VerticalTextInputFlags) {}

TEST_F(InputMethodControllerTest, ExecCommandDuringComposition) {}

TEST_F(InputMethodControllerTest, SetCompositionAfterNonEditableElement) {}

TEST_F(InputMethodControllerTest, SetCompositionInTableCell) {}

TEST_F(InputMethodControllerTest, SetCompositionInMyanmar) {}

TEST_F(InputMethodControllerTest, VirtualKeyboardPolicyOfFocusedElement) {}

TEST_F(InputMethodControllerTest, SetCompositionInTibetan) {}

TEST_F(InputMethodControllerTest, SetCompositionInDevanagari) {}

TEST_F(InputMethodControllerTest, SetCompositionTamil) {}

TEST_F(InputMethodControllerTest, EditContextCanvasHasEditableType) {}
}  // namespace blink