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

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

Issue 2753533002: Fixed a bug in TouchActionFilter for unidirectional touch-actions. (Closed)
Patch Set: Fixed a test. Created 3 years, 9 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 | « no previous file | content/browser/renderer_host/input/touch_action_filter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/input/input_router_impl_unittest.cc
diff --git a/content/browser/renderer_host/input/input_router_impl_unittest.cc b/content/browser/renderer_host/input/input_router_impl_unittest.cc
index ce14e3e1bffbebd181b26d707aa1ef52804847ee..f48267d8e78dee7cb8753489b3dd909113ddaacf 100644
--- a/content/browser/renderer_host/input/input_router_impl_unittest.cc
+++ b/content/browser/renderer_host/input/input_router_impl_unittest.cc
@@ -232,12 +232,19 @@ class InputRouterImplTest : public testing::Test {
}
void SimulateGestureEvent(WebGestureEvent gesture) {
- // Ensure non-zero touchscreen fling velocities, as the router will
- // validate aganst such.
- if (gesture.type() == WebInputEvent::GestureFlingStart &&
+ if (gesture.type() == WebInputEvent::GestureScrollBegin &&
gesture.sourceDevice == blink::WebGestureDeviceTouchscreen &&
- !gesture.data.flingStart.velocityX &&
- !gesture.data.flingStart.velocityY) {
+ !gesture.data.scrollBegin.deltaXHint &&
+ !gesture.data.scrollBegin.deltaYHint) {
+ // Ensure non-zero scroll-begin offset-hint to make the event sane,
+ // prevents unexpected filtering at TouchActionFilter.
+ gesture.data.scrollBegin.deltaYHint = 2.f;
+ } else if (gesture.type() == WebInputEvent::GestureFlingStart &&
+ gesture.sourceDevice == blink::WebGestureDeviceTouchscreen &&
+ !gesture.data.flingStart.velocityX &&
+ !gesture.data.flingStart.velocityY) {
+ // Ensure non-zero touchscreen fling velocities, as the router will
+ // validate against such.
gesture.data.flingStart.velocityX = 5.f;
}
« no previous file with comments | « no previous file | content/browser/renderer_host/input/touch_action_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698