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

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

Issue 2568093003: Support parsing BackgroundSpans and UnderlineSpans in Android IME's commitText() (Closed)
Patch Set: Don't try to add default underline for commitText(), attempt to fix Mac builds Created 4 years 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 f9502ff3eb02b63581dbe0c1a107db6f26a00fae..d653a3130a977159371338c70066f87381454370 100644
--- a/third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp
+++ b/third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp
@@ -853,7 +853,9 @@ TEST_F(InputMethodControllerTest, InsertLineBreakAfterConfirmingText) {
Element* div =
insertHTMLElement("<div id='sample' contenteditable></div>", "sample");
- controller().commitText("hello", 0);
+ Vector<CompositionUnderline> underlines;
+ underlines.append(CompositionUnderline(0, 2, Color(255, 0, 0), false, 0));
+ controller().commitText("hello", underlines, 0);
EXPECT_STREQ("hello", div->innerText().utf8().data());
controller().setEditableSelectionOffsets(PlainTextRange(2, 2));
@@ -967,7 +969,7 @@ TEST_F(InputMethodControllerTest, CompositionInputEventForInsert) {
// Insert new text without previous composition.
document().setTitle(emptyString());
document().updateStyleAndLayout();
- controller().commitText("hello", 0);
+ controller().commitText("hello", underlines, 0);
EXPECT_STREQ("beforeinput.data:hello;input.data:hello;",
document().title().utf8().data());
@@ -979,7 +981,7 @@ TEST_F(InputMethodControllerTest, CompositionInputEventForInsert) {
// Insert new text with previous composition.
document().setTitle(emptyString());
document().updateStyleAndLayout();
- controller().commitText("hello", 1);
+ controller().commitText("hello", underlines, 1);
EXPECT_STREQ(
"beforeinput.data:hello;input.data:hello;compositionend.data:hello;",
document().title().utf8().data());
@@ -1017,7 +1019,7 @@ TEST_F(InputMethodControllerTest, CompositionEndEventForInsert) {
// Insert new text with previous composition. Note that it moves the caret to
// [4,4] before firing 'compositonend' event.
document().updateStyleAndLayout();
- controller().commitText("hello", -1);
+ controller().commitText("hello", underlines, -1);
document().updateStyleAndLayout();
EXPECT_EQ(3u, controller().getSelectionOffsets().start());
EXPECT_EQ(3u, controller().getSelectionOffsets().end());

Powered by Google App Engine
This is Rietveld 408576698