| Index: Source/web/tests/WebViewTest.cpp
|
| diff --git a/Source/web/tests/WebViewTest.cpp b/Source/web/tests/WebViewTest.cpp
|
| index ced7a554ae8dca0330f1ba611f3fbd2ef2e4da45..ea64a12c23f7a46f91be07b99d073bc78023291c 100644
|
| --- a/Source/web/tests/WebViewTest.cpp
|
| +++ b/Source/web/tests/WebViewTest.cpp
|
| @@ -34,7 +34,6 @@
|
| #include "core/dom/Document.h"
|
| #include "core/dom/Element.h"
|
| #include "core/editing/FrameSelection.h"
|
| -#include "core/editing/markers/DocumentMarkerController.h"
|
| #include "core/frame/EventHandlerRegistry.h"
|
| #include "core/frame/FrameHost.h"
|
| #include "core/frame/FrameView.h"
|
| @@ -992,6 +991,9 @@
|
| WebLocalFrameImpl* frame = toWebLocalFrameImpl(webView->mainFrame());
|
| frame->setEditableSelectionOffsets(4, 10);
|
| frame->setCompositionFromExistingText(8, 12, underlines);
|
| + WebVector<WebCompositionUnderline> underlineResults = toWebViewImpl(webView)->compositionUnderlines();
|
| + EXPECT_EQ(8u, underlineResults[0].startOffset);
|
| + EXPECT_EQ(12u, underlineResults[0].endOffset);
|
| WebTextInputInfo info = webView->textInputInfo();
|
| EXPECT_EQ(4, info.selectionStart);
|
| EXPECT_EQ(10, info.selectionEnd);
|
| @@ -1022,6 +1024,9 @@
|
|
|
| frame->setEditableSelectionOffsets(31, 31);
|
| frame->setCompositionFromExistingText(30, 34, underlines);
|
| + WebVector<WebCompositionUnderline> underlineResults = toWebViewImpl(webView)->compositionUnderlines();
|
| + EXPECT_EQ(2u, underlineResults[0].startOffset);
|
| + EXPECT_EQ(6u, underlineResults[0].endOffset);
|
| info = webView->textInputInfo();
|
| EXPECT_EQ("0123456789abcdefghijklmnopq\nrstuvwxyz", std::string(info.value.utf8().data()));
|
| EXPECT_EQ(31, info.selectionStart);
|
| @@ -1037,21 +1042,6 @@
|
| EXPECT_EQ(34, info.selectionEnd);
|
| EXPECT_EQ(-1, info.compositionStart);
|
| 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)
|
| @@ -1682,6 +1672,7 @@
|
| // text changed notification for autofill.
|
| client.clearChangeCounts();
|
| webView->setFocus(false);
|
| + EXPECT_EQ(1, client.textChangesWhileIgnored());
|
| EXPECT_EQ(0, client.textChangesWhileNotIgnored());
|
|
|
| frame->setAutofillClient(0);
|
|
|