| 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 f487105f6a1cf44d5150230de935fe104e605ffa..509ad602cd86e3ca2dd74c659a2a6c154774132f 100644
|
| --- a/third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp
|
| +++ b/third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp
|
| @@ -1272,7 +1272,7 @@ TEST_F(InputMethodControllerTest, CompositionInputEventForInsertEmptyText) {
|
| GetDocument().setTitle(g_empty_string);
|
| GetDocument().UpdateStyleAndLayout();
|
| Controller().CommitText("", underlines, 0);
|
| - EXPECT_STREQ("", GetDocument().title().Utf8().Data());
|
| + EXPECT_STREQ("beforeinput.data:;", GetDocument().title().Utf8().Data());
|
|
|
| GetDocument().setTitle(g_empty_string);
|
| Controller().SetComposition("n", underlines, 1, 1);
|
| @@ -1507,6 +1507,22 @@ TEST_F(InputMethodControllerTest, WhitespaceFixup) {
|
| EXPECT_STREQ(" text ", div->innerHTML().Utf8().Data());
|
| }
|
|
|
| +TEST_F(InputMethodControllerTest, CommitEmptyTextDeletesSelection) {
|
| + HTMLInputElement* input =
|
| + toHTMLInputElement(InsertHTMLElement("<input id='sample'>", "sample"));
|
| +
|
| + input->setValue("Abc Def Ghi");
|
| + GetDocument().UpdateStyleAndLayout();
|
| + Vector<CompositionUnderline> empty_underlines;
|
| + Controller().SetEditableSelectionOffsets(PlainTextRange(4, 8));
|
| + Controller().CommitText(String(""), empty_underlines, 0);
|
| + EXPECT_STREQ("Abc Ghi", input->value().Utf8().Data());
|
| +
|
| + Controller().SetEditableSelectionOffsets(PlainTextRange(4, 7));
|
| + Controller().CommitText(String("1"), empty_underlines, 0);
|
| + EXPECT_STREQ("Abc 1", input->value().Utf8().Data());
|
| +}
|
| +
|
| static String GetMarkedText(
|
| DocumentMarkerController& document_marker_controller,
|
| Node* node,
|
|
|