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

Unified Diff: third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp

Issue 2469983003: Trybot test for finishComposingText keeping style (Closed)
Patch Set: Do nothing Created 4 years, 1 month 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: 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 1d1eaf64d0da2b65835dd646f456a9ec1104c2e7..b16743d164794b7ea10622130c10567b9eff7206 100644
--- a/third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp
+++ b/third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp
@@ -187,6 +187,24 @@ TEST_F(InputMethodControllerTest,
EXPECT_STREQ("<b>\xE0\xB0\x83</b>", div->innerHTML().utf8().data());
}
+TEST_F(InputMethodControllerTest, FinishComposingTextKeepingStyle) {
+ Element* div = insertHTMLElement(
+ "<div id='sample' "
+ "contenteditable='true'>k<b>i</b>d</div>",
+ "sample");
+
+ Vector<CompositionUnderline> underlines;
+ underlines.append(CompositionUnderline(0, 3, Color(255, 0, 0), false, 0));
+ controller().setCompositionFromExistingText(underlines, 0, 3);
+
+ // Append a character.
+ controller().setComposition(String("kids"), underlines, 4, 4);
+ EXPECT_STREQ("k<b>i</b>ds", div->innerHTML().utf8().data());
+
+ controller().finishComposingText(InputMethodController::KeepSelection);
+ EXPECT_STREQ("k<b>i</b>ds", div->innerHTML().utf8().data());
+}
+
TEST_F(InputMethodControllerTest, SelectionOnConfirmExistingText) {
insertHTMLElement("<div id='sample' contenteditable='true'>hello world</div>",
"sample");

Powered by Google App Engine
This is Rietveld 408576698