Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1896)

Unified Diff: Source/web/tests/WebViewTest.cpp

Issue 1325563002: Avoid style clobbering in setCompositionFromExistingText. (2nd land) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix end to refer to endPosition Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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"));
« Source/core/paint/InlineTextBoxPainter.cpp ('K') | « Source/core/paint/InlineTextBoxPainter.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698