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

Unified Diff: Source/web/tests/WebViewTest.cpp

Issue 364193002: Cursor does not blink on longpress in an emptyField. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 6 years, 5 months 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: 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)
« no previous file with comments | « Source/core/page/EventHandler.cpp ('k') | Source/web/tests/data/blink_caret_on_typing_after_long_press.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698