| Index: third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp
|
| diff --git a/third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp b/third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp
|
| index 437d2a0aa0765006a04a411dd164cf36052051d4..f9502ff3eb02b63581dbe0c1a107db6f26a00fae 100644
|
| --- a/third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp
|
| +++ b/third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp
|
| @@ -1062,4 +1062,25 @@ TEST_F(InputMethodControllerTest, CompositionEndEventWithNoSelection) {
|
| EXPECT_TRUE(controller().getSelectionOffsets().isNull());
|
| }
|
|
|
| +TEST_F(InputMethodControllerTest, FinishCompositionRemovedRange) {
|
| + Element* inputA =
|
| + insertHTMLElement("<input id='a' /><br><input type='tel' id='b' />", "a");
|
| +
|
| + EXPECT_EQ(WebTextInputTypeText, controller().textInputType());
|
| +
|
| + // The test requires non-empty composition.
|
| + controller().setComposition("hello", Vector<CompositionUnderline>(), 5, 5);
|
| + EXPECT_EQ(WebTextInputTypeText, controller().textInputType());
|
| +
|
| + // Remove element 'a'.
|
| + inputA->setOuterHTML("", ASSERT_NO_EXCEPTION);
|
| + EXPECT_EQ(WebTextInputTypeNone, controller().textInputType());
|
| +
|
| + document().getElementById("b")->focus();
|
| + EXPECT_EQ(WebTextInputTypeTelephone, controller().textInputType());
|
| +
|
| + controller().finishComposingText(InputMethodController::KeepSelection);
|
| + EXPECT_EQ(WebTextInputTypeTelephone, controller().textInputType());
|
| +}
|
| +
|
| } // namespace blink
|
|
|