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

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

Issue 2104883002: Change text selection iterator behaviour for non-editable empty selection (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added myself in AUTHORS list. Created 4 years, 6 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
« no previous file with comments | « third_party/WebKit/Source/core/editing/SelectionController.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 99d47f4cd6c7be3d340950327b8cd8f4a0547252..6f9e23edd98c478bbcf26978585af56465175cd7 100644
--- a/third_party/WebKit/Source/web/tests/WebViewTest.cpp
+++ b/third_party/WebKit/Source/web/tests/WebViewTest.cpp
@@ -1643,6 +1643,27 @@ TEST_F(WebViewTest, LongPressEmptyEditableSelection)
EXPECT_EQ(WebInputEventResult::HandledSystem, webView->handleInputEvent(event));
}
+TEST_F(WebViewTest, LongPressEmptyNonEditableSelection)
+{
+ URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c_str()),
+ WebString::fromUTF8("long_press_image.html"));
+
+ WebViewImpl* webView = m_webViewHelper.initializeAndLoad(m_baseURL + "long_press_image.html", true);
+ webView->resize(WebSize(500, 500));
+ webView->updateAllLifecyclePhases();
+ runPendingTasks();
+
+ WebGestureEvent event;
+ event.type = WebInputEvent::GestureLongPress;
+ event.sourceDevice = WebGestureDeviceTouchscreen;
+ event.x = 300;
+ event.y = 300;
+ WebLocalFrameImpl* frame = toWebLocalFrameImpl(webView->mainFrame());
+
+ EXPECT_EQ(WebInputEventResult::HandledSystem, webView->handleInputEvent(event));
+ EXPECT_TRUE(frame->selectionAsText().isEmpty());
+}
+
TEST_F(WebViewTest, LongPressSelection)
{
URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c_str()), WebString::fromUTF8("longpress_selection.html"));
« no previous file with comments | « third_party/WebKit/Source/core/editing/SelectionController.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698