| 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 cfce7ed4321ce2a651f7a175a04aecf55e470121..e851100e2666b8eb85cb95f3528b5257a1a067b1 100644
|
| --- a/third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp
|
| +++ b/third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp
|
| @@ -115,6 +115,30 @@ TEST_F(InputMethodControllerTest, SetCompositionFromExistingText)
|
| PlainTextRange plainTextRange(PlainTextRange::create(*div, *range));
|
| EXPECT_EQ(0u, plainTextRange.start());
|
| EXPECT_EQ(5u, plainTextRange.end());
|
| +
|
| + controller().setComposition(String("hellobar"), underlines, 8, 8);
|
| + range = controller().compositionRange();
|
| + EXPECT_EQ(0, range->startOffset());
|
| + EXPECT_EQ(8, range->endOffset());
|
| +}
|
| +
|
| +TEST_F(InputMethodControllerTest, SetCompositionKeepingStyle)
|
| +{
|
| + // 0xac00 = "가", 0xb098="나", 0xb2e4 = "다", 0xb77c = "라"
|
| + Element* div = insertHTMLElement(
|
| + "<div id='sample' contenteditable='true'><b>가나</b>다라</div>", "sample");
|
| +
|
| + Vector<CompositionUnderline> underlines;
|
| + underlines.append(CompositionUnderline(0, 4, Color(255, 0, 0), false, 0));
|
| + controller().setCompositionFromExistingText(underlines, 0, 4);
|
| +
|
| + // 0xEAB080 = "가", 0xEB8298="나", 0xEB8BA4 = "다", 0xEB9E8C = "람"
|
| + controller().setComposition(String::fromUTF8("\xea\xb0\x80\xeb\x82\x98\xeb\x8b\xa4\xeb\x9e\x8c"), underlines, 4, 4);
|
| + EXPECT_STREQ("<b>가나</b>다람", div->innerHTML().utf8().data());
|
| +
|
| + // 0xeb9dbc = "라"
|
| + controller().setComposition(String::fromUTF8("\xea\xb0\x80\xeb\x82\x98\xeb\x8b\xa4\xeb\x9d\xbc"), underlines, 4, 4);
|
| + EXPECT_STREQ("<b>가나</b>다라", div->innerHTML().utf8().data());
|
| }
|
|
|
| TEST_F(InputMethodControllerTest, SelectionOnConfirmExistingText)
|
| @@ -485,7 +509,7 @@ TEST_F(InputMethodControllerTest, CompositionInputEventData)
|
|
|
| document().setTitle(emptyString());
|
| controller().setComposition("ni", underlines, 0, 1);
|
| - EXPECT_STREQ("beforeinput.data:ni;input.data:ni;", document().title().utf8().data());
|
| + EXPECT_STREQ("beforeinput.data:i;input.data:i;", document().title().utf8().data());
|
|
|
| document().setTitle(emptyString());
|
| controller().finishComposingText(InputMethodController::KeepSelection);
|
|
|