| Index: Source/web/tests/WebViewTest.cpp
|
| diff --git a/Source/web/tests/WebViewTest.cpp b/Source/web/tests/WebViewTest.cpp
|
| index e90bd0a5b51cd2ee0001b9d0a0bb79a5e25ca010..502c90288406941958972a9872270334c6d5ce22 100644
|
| --- a/Source/web/tests/WebViewTest.cpp
|
| +++ b/Source/web/tests/WebViewTest.cpp
|
| @@ -33,6 +33,7 @@
|
|
|
| #include "core/dom/Document.h"
|
| #include "core/dom/Element.h"
|
| +#include "core/editing/FrameSelection.h"
|
| #include "core/frame/EventHandlerRegistry.h"
|
| #include "core/frame/FrameView.h"
|
| #include "core/frame/LocalFrame.h"
|
| @@ -1169,6 +1170,29 @@ TEST_F(WebViewTest, LongPressSelection)
|
| EXPECT_TRUE(tapElementById(webView, WebInputEvent::GestureLongPress, target));
|
| EXPECT_EQ("testword", std::string(frame->selectionAsText().utf8().data()));
|
| }
|
| +
|
| +TEST_F(WebViewTest, BlinkCaretOnTypingAfterLongPress)
|
| +{
|
| + URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c_str()), WebString::fromUTF8("blink_caret_on_typing_after_long_press.html"));
|
| +
|
| + WebView* webView = m_webViewHelper.initializeAndLoad(m_baseURL + "blink_caret_on_typing_after_long_press.html", true);
|
| + webView->resize(WebSize(640, 480));
|
| + webView->layout();
|
| + runPendingTasks();
|
| +
|
| + WebString target = WebString::fromUTF8("target");
|
| + WebLocalFrameImpl* mainFrame = toWebLocalFrameImpl(webView->mainFrame());
|
| +
|
| + EXPECT_TRUE(tapElementById(webView, WebInputEvent::GestureLongPress, target));
|
| + EXPECT_TRUE(mainFrame->frame()->selection().isCaretBlinkingSuspended());
|
| +
|
| + WebKeyboardEvent keyEvent;
|
| + keyEvent.type = WebInputEvent::RawKeyDown;
|
| + webView->handleInputEvent(keyEvent);
|
| + keyEvent.type = WebInputEvent::KeyUp;
|
| + webView->handleInputEvent(keyEvent);
|
| + EXPECT_FALSE(mainFrame->frame()->selection().isCaretBlinkingSuspended());
|
| +}
|
| #endif
|
|
|
| TEST_F(WebViewTest, SelectionOnDisabledInput)
|
|
|