Index: Source/web/tests/WebViewTest.cpp |
diff --git a/Source/web/tests/WebViewTest.cpp b/Source/web/tests/WebViewTest.cpp |
index ea64a12c23f7a46f91be07b99d073bc78023291c..c5195b43a810ea5b3368f6037a2a913e02dea6f5 100644 |
--- a/Source/web/tests/WebViewTest.cpp |
+++ b/Source/web/tests/WebViewTest.cpp |
@@ -1044,6 +1044,21 @@ TEST_F(WebViewTest, SetCompositionFromExistingTextInTextArea) |
EXPECT_EQ(-1, info.compositionEnd); |
} |
+TEST_F(WebViewTest, SetCompositionFromExistingTextInRichText) |
+{ |
+ URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c_str()), WebString::fromUTF8("content_editable_rich_text.html")); |
+ WebView* webView = m_webViewHelper.initializeAndLoad(m_baseURL + "content_editable_rich_text.html"); |
+ webView->setInitialFocus(false); |
+ WebVector<WebCompositionUnderline> underlines(static_cast<size_t>(1)); |
+ underlines[0] = WebCompositionUnderline(0, 4, 0, false, 0); |
+ WebLocalFrameImpl* frame = toWebLocalFrameImpl(webView->mainFrame()); |
+ frame->setEditableSelectionOffsets(1, 1); |
+ WebDocument document = webView->mainFrame()->document(); |
+ EXPECT_FALSE(document.getElementById("bold").isNull()); |
+ frame->setCompositionFromExistingText(0, 4, underlines); |
+ EXPECT_FALSE(document.getElementById("bold").isNull()); |
+} |
+ |
TEST_F(WebViewTest, SetEditableSelectionOffsetsKeepsComposition) |
{ |
URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c_str()), WebString::fromUTF8("input_field_populated.html")); |