Index: third_party/WebKit/Source/web/tests/WebViewTest.cpp |
diff --git a/third_party/WebKit/Source/web/tests/WebViewTest.cpp b/third_party/WebKit/Source/web/tests/WebViewTest.cpp |
index 257c108f10122690e018255c7be60ce097494097..d1101b199dee2caad40c9c9e5310a5a4258e49b6 100644 |
--- a/third_party/WebKit/Source/web/tests/WebViewTest.cpp |
+++ b/third_party/WebKit/Source/web/tests/WebViewTest.cpp |
@@ -995,8 +995,10 @@ TEST_P(WebViewTest, SetCompositionForNewCaretPositions) { |
->frameWidget() |
->getActiveWebInputMethodController(); |
- activeInputMethodController->commitText("hello", 0); |
- activeInputMethodController->commitText("world", -5); |
+ WebVector<WebCompositionUnderline> emptyUnderlines; |
+ |
+ activeInputMethodController->commitText("hello", emptyUnderlines, 0); |
+ activeInputMethodController->commitText("world", emptyUnderlines, -5); |
WebTextInputInfo info = webView->textInputInfo(); |
EXPECT_EQ("helloworld", std::string(info.value.utf8().data())); |
EXPECT_EQ(5, info.selectionStart); |
@@ -1004,7 +1006,6 @@ TEST_P(WebViewTest, SetCompositionForNewCaretPositions) { |
EXPECT_EQ(-1, info.compositionStart); |
EXPECT_EQ(-1, info.compositionEnd); |
- WebVector<WebCompositionUnderline> emptyUnderlines; |
// Set up a composition that needs to be committed. |
std::string compositionText("ABC"); |
@@ -1102,7 +1103,9 @@ TEST_P(WebViewTest, SetCompositionWithEmptyText) { |
->frameWidget() |
->getActiveWebInputMethodController(); |
- activeInputMethodController->commitText("hello", 0); |
+ WebVector<WebCompositionUnderline> emptyUnderlines; |
+ |
+ activeInputMethodController->commitText("hello", emptyUnderlines, 0); |
WebTextInputInfo info = webView->textInputInfo(); |
EXPECT_EQ("hello", std::string(info.value.utf8().data())); |
EXPECT_EQ(5, info.selectionStart); |
@@ -1110,8 +1113,6 @@ TEST_P(WebViewTest, SetCompositionWithEmptyText) { |
EXPECT_EQ(-1, info.compositionStart); |
EXPECT_EQ(-1, info.compositionEnd); |
- WebVector<WebCompositionUnderline> emptyUnderlines; |
- |
activeInputMethodController->setComposition(WebString::fromUTF8(""), |
emptyUnderlines, 0, 0); |
info = webView->textInputInfo(); |
@@ -1143,8 +1144,10 @@ TEST_P(WebViewTest, CommitTextForNewCaretPositions) { |
->frameWidget() |
->getActiveWebInputMethodController(); |
+ WebVector<WebCompositionUnderline> emptyUnderlines; |
+ |
// Caret is on the left of composing text. |
- activeInputMethodController->commitText("ab", -2); |
+ activeInputMethodController->commitText("ab", emptyUnderlines, -2); |
WebTextInputInfo info = webView->textInputInfo(); |
EXPECT_EQ("ab", std::string(info.value.utf8().data())); |
EXPECT_EQ(0, info.selectionStart); |
@@ -1153,7 +1156,7 @@ TEST_P(WebViewTest, CommitTextForNewCaretPositions) { |
EXPECT_EQ(-1, info.compositionEnd); |
// Caret is on the right of composing text. |
- activeInputMethodController->commitText("c", 1); |
+ activeInputMethodController->commitText("c", emptyUnderlines, 1); |
info = webView->textInputInfo(); |
EXPECT_EQ("cab", std::string(info.value.utf8().data())); |
EXPECT_EQ(2, info.selectionStart); |
@@ -1162,7 +1165,7 @@ TEST_P(WebViewTest, CommitTextForNewCaretPositions) { |
EXPECT_EQ(-1, info.compositionEnd); |
// Caret is on the left boundary. |
- activeInputMethodController->commitText("def", -5); |
+ activeInputMethodController->commitText("def", emptyUnderlines, -5); |
info = webView->textInputInfo(); |
EXPECT_EQ("cadefb", std::string(info.value.utf8().data())); |
EXPECT_EQ(0, info.selectionStart); |
@@ -1171,7 +1174,7 @@ TEST_P(WebViewTest, CommitTextForNewCaretPositions) { |
EXPECT_EQ(-1, info.compositionEnd); |
// Caret is on the right boundary. |
- activeInputMethodController->commitText("g", 6); |
+ activeInputMethodController->commitText("g", emptyUnderlines, 6); |
info = webView->textInputInfo(); |
EXPECT_EQ("gcadefb", std::string(info.value.utf8().data())); |
EXPECT_EQ(7, info.selectionStart); |
@@ -1180,7 +1183,7 @@ TEST_P(WebViewTest, CommitTextForNewCaretPositions) { |
EXPECT_EQ(-1, info.compositionEnd); |
// Caret exceeds the left boundary. |
- activeInputMethodController->commitText("hi", -100); |
+ activeInputMethodController->commitText("hi", emptyUnderlines, -100); |
info = webView->textInputInfo(); |
EXPECT_EQ("gcadefbhi", std::string(info.value.utf8().data())); |
EXPECT_EQ(0, info.selectionStart); |
@@ -1189,7 +1192,7 @@ TEST_P(WebViewTest, CommitTextForNewCaretPositions) { |
EXPECT_EQ(-1, info.compositionEnd); |
// Caret exceeds the right boundary. |
- activeInputMethodController->commitText("jk", 100); |
+ activeInputMethodController->commitText("jk", emptyUnderlines, 100); |
info = webView->textInputInfo(); |
EXPECT_EQ("jkgcadefbhi", std::string(info.value.utf8().data())); |
EXPECT_EQ(11, info.selectionStart); |
@@ -1222,7 +1225,7 @@ TEST_P(WebViewTest, CommitTextWhileComposing) { |
// Deletes ongoing composition, inserts the specified text and moves the |
// caret. |
- activeInputMethodController->commitText("hello", -2); |
+ activeInputMethodController->commitText("hello", emptyUnderlines, -2); |
info = webView->textInputInfo(); |
EXPECT_EQ("hello", std::string(info.value.utf8().data())); |
EXPECT_EQ(3, info.selectionStart); |
@@ -1240,7 +1243,7 @@ TEST_P(WebViewTest, CommitTextWhileComposing) { |
EXPECT_EQ(6, info.compositionEnd); |
// Deletes ongoing composition and moves the caret. |
- activeInputMethodController->commitText("", 2); |
+ activeInputMethodController->commitText("", emptyUnderlines, 2); |
info = webView->textInputInfo(); |
EXPECT_EQ("hello", std::string(info.value.utf8().data())); |
EXPECT_EQ(5, info.selectionStart); |
@@ -1249,7 +1252,7 @@ TEST_P(WebViewTest, CommitTextWhileComposing) { |
EXPECT_EQ(-1, info.compositionEnd); |
// Inserts the specified text and moves the caret. |
- activeInputMethodController->commitText("world", -5); |
+ activeInputMethodController->commitText("world", emptyUnderlines, -5); |
info = webView->textInputInfo(); |
EXPECT_EQ("helloworld", std::string(info.value.utf8().data())); |
EXPECT_EQ(5, info.selectionStart); |
@@ -1258,7 +1261,7 @@ TEST_P(WebViewTest, CommitTextWhileComposing) { |
EXPECT_EQ(-1, info.compositionEnd); |
// Only moves the caret. |
- activeInputMethodController->commitText("", 5); |
+ activeInputMethodController->commitText("", emptyUnderlines, 5); |
info = webView->textInputInfo(); |
EXPECT_EQ("helloworld", std::string(info.value.utf8().data())); |
EXPECT_EQ(10, info.selectionStart); |
@@ -1337,7 +1340,7 @@ TEST_P(WebViewTest, InsertNewLinePlacementAfterFinishComposingText) { |
std::string compositionText("\n"); |
activeInputMethodController->commitText( |
- WebString::fromUTF8(compositionText.c_str()), 0); |
+ WebString::fromUTF8(compositionText.c_str()), emptyUnderlines, 0); |
info = webView->textInputInfo(); |
EXPECT_EQ(5, info.selectionStart); |
EXPECT_EQ(5, info.selectionEnd); |
@@ -1449,8 +1452,9 @@ TEST_P(WebViewTest, SetCompositionFromExistingTextInTextArea) { |
frame->frameWidget()->getActiveWebInputMethodController(); |
frame->setEditableSelectionOffsets(27, 27); |
std::string newLineText("\n"); |
+ WebVector<WebCompositionUnderline> emptyUnderlines; |
activeInputMethodController->commitText( |
- WebString::fromUTF8(newLineText.c_str()), 0); |
+ WebString::fromUTF8(newLineText.c_str()), emptyUnderlines, 0); |
WebTextInputInfo info = webView->textInputInfo(); |
EXPECT_EQ("0123456789abcdefghijklmnopq\nrstuvwxyz", |
std::string(info.value.utf8().data())); |
@@ -1467,7 +1471,7 @@ TEST_P(WebViewTest, SetCompositionFromExistingTextInTextArea) { |
std::string compositionText("yolo"); |
activeInputMethodController->commitText( |
- WebString::fromUTF8(compositionText.c_str()), 0); |
+ WebString::fromUTF8(compositionText.c_str()), emptyUnderlines, 0); |
info = webView->textInputInfo(); |
EXPECT_EQ("0123456789abcdefghijklmnopq\nrsyoloxyz", |
std::string(info.value.utf8().data())); |
@@ -1510,7 +1514,7 @@ TEST_P(WebViewTest, SetEditableSelectionOffsetsKeepsComposition) { |
->frameWidget() |
->getActiveWebInputMethodController(); |
activeInputMethodController->commitText( |
- WebString::fromUTF8(compositionTextFirst.c_str()), 0); |
+ WebString::fromUTF8(compositionTextFirst.c_str()), emptyUnderlines, 0); |
activeInputMethodController->setComposition( |
WebString::fromUTF8(compositionTextSecond.c_str()), emptyUnderlines, 5, |
5); |
@@ -4033,9 +4037,12 @@ TEST_P(WebViewTest, PasswordFieldEditingIsUserGesture) { |
frame->setAutofillClient(&client); |
webView->setInitialFocus(false); |
+ WebVector<WebCompositionUnderline> emptyUnderlines; |
+ |
EXPECT_TRUE( |
frame->frameWidget()->getActiveWebInputMethodController()->commitText( |
- WebString::fromUTF8(std::string("hello").c_str()), 0)); |
+ WebString::fromUTF8(std::string("hello").c_str()), emptyUnderlines, |
+ 0)); |
EXPECT_EQ(1, client.textChangesFromUserGesture()); |
EXPECT_FALSE(UserGestureIndicator::processingUserGesture()); |
frame->setAutofillClient(0); |