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

Unified Diff: content/browser/renderer_host/input/touch_handle_unittest.cc

Issue 462163002: Use a minimum touch size for selection handle hit testing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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 | « content/browser/renderer_host/input/touch_handle.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/input/touch_handle_unittest.cc
diff --git a/content/browser/renderer_host/input/touch_handle_unittest.cc b/content/browser/renderer_host/input/touch_handle_unittest.cc
index 4c50c2c6b9b796b5fa10006d91c848b2a7882da4..87d3a8c68a3764fcae480ecbfa3827f97cc17e83 100644
--- a/content/browser/renderer_host/input/touch_handle_unittest.cc
+++ b/content/browser/renderer_host/input/touch_handle_unittest.cc
@@ -424,6 +424,15 @@ TEST_F(TouchHandleTest, DragTargettingUsesTouchSize) {
event.SetTouchMajor(kTouchSize * 2.f);
EXPECT_TRUE(handle.WillHandleTouchEvent(event));
EXPECT_TRUE(IsDragging());
+
+ // Ensure a touch size of 0 can still register a hit.
+ event = MockMotionEvent(MockMotionEvent::ACTION_DOWN,
+ event_time,
+ kDefaultDrawableSize / 2.f,
+ kDefaultDrawableSize / 2.f);
+ event.SetTouchMajor(0);
+ EXPECT_TRUE(handle.WillHandleTouchEvent(event));
+ EXPECT_TRUE(IsDragging());
}
TEST_F(TouchHandleTest, Tap) {
« no previous file with comments | « content/browser/renderer_host/input/touch_handle.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698