| 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 487ec7c886edcf44a53ac3fe54ea6214c5d952b3..106b8accaecba1c089f187bc5c12753109d12a26 100644
|
| --- a/third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp
|
| +++ b/third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp
|
| @@ -183,6 +183,26 @@ TEST_F(InputMethodControllerTest, SetCompositionFromExistingText) {
|
| EXPECT_EQ(5u, plainTextRange.end());
|
| }
|
|
|
| +TEST_F(InputMethodControllerTest, SetCompositionAfterEmoji) {
|
| + // "trophy" = U+1F3C6 = 0xF0 0x9F 0x8F 0x86 (UTF8).
|
| + Element* div = insertHTMLElement(
|
| + "<div id='sample' contenteditable>🏆</div>", "sample");
|
| +
|
| + Vector<CompositionUnderline> underlines;
|
| + underlines.push_back(CompositionUnderline(0, 2, Color(255, 0, 0), false, 0));
|
| +
|
| + document().updateStyleAndLayout();
|
| + controller().setEditableSelectionOffsets(PlainTextRange(2, 2));
|
| + EXPECT_EQ(2, frame().selection().start().computeOffsetInContainerNode());
|
| + EXPECT_EQ(2, frame().selection().end().computeOffsetInContainerNode());
|
| +
|
| + controller().setComposition(String("a"), underlines, 1, 1);
|
| + EXPECT_STREQ("\xF0\x9F\x8F\x86\x61", div->innerText().utf8().data());
|
| +
|
| + controller().setComposition(String("ab"), underlines, 2, 2);
|
| + EXPECT_STREQ("\xF0\x9F\x8F\x86\x61\x62", div->innerText().utf8().data());
|
| +}
|
| +
|
| TEST_F(InputMethodControllerTest, SetCompositionKeepingStyle) {
|
| Element* div = insertHTMLElement(
|
| "<div id='sample' "
|
|
|