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

Unified Diff: content/common/input/gesture_event_stream_validator.cc

Issue 537733003: [Android] Enable input event stream validation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Code review and fix tests Created 6 years, 3 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: content/common/input/gesture_event_stream_validator.cc
diff --git a/content/common/input/gesture_event_stream_validator.cc b/content/common/input/gesture_event_stream_validator.cc
index a6229f98b6995fc3c3622e46e51108debbad41a9..b95a674541df1958e44fbf2b6b823758568abed6 100644
--- a/content/common/input/gesture_event_stream_validator.cc
+++ b/content/common/input/gesture_event_stream_validator.cc
@@ -24,8 +24,10 @@ bool GestureEventStreamValidator::Validate(const blink::WebGestureEvent& event,
error_msg->clear();
switch (event.type) {
case WebInputEvent::GestureScrollBegin:
- if (scrolling_ || pinching_)
+ if (scrolling_)
error_msg->append("Scroll begin during scroll\n");
+ if (pinching_)
+ error_msg->append("Scroll begin during pinch\n");
scrolling_ = true;
break;
case WebInputEvent::GestureScrollUpdate:
@@ -42,18 +44,16 @@ bool GestureEventStreamValidator::Validate(const blink::WebGestureEvent& event,
scrolling_ = false;
break;
case WebInputEvent::GesturePinchBegin:
- if (!scrolling_)
- error_msg->append("Pinch begin outside of scroll\n");
if (pinching_)
error_msg->append("Pinch begin during pinch\n");
pinching_ = true;
break;
case WebInputEvent::GesturePinchUpdate:
- if (!pinching_ || !scrolling_)
+ if (!pinching_)
error_msg->append("Pinch update outside of pinch\n");
break;
case WebInputEvent::GesturePinchEnd:
- if (!pinching_ || !scrolling_)
+ if (!pinching_)
error_msg->append("Pinch end outside of pinch\n");
pinching_ = false;
break;
@@ -64,11 +64,13 @@ bool GestureEventStreamValidator::Validate(const blink::WebGestureEvent& event,
break;
case WebInputEvent::GestureTap:
case WebInputEvent::GestureTapCancel:
- case WebInputEvent::GestureDoubleTap:
if (!waiting_for_tap_end_)
error_msg->append("Missing GestureTapDown event\n");
waiting_for_tap_end_ = false;
break;
+ case WebInputEvent::GestureDoubleTap:
+ waiting_for_tap_end_ = false;
+ break;
default:
break;
}
« no previous file with comments | « content/common/input/gesture_event_stream_validator.h ('k') | content/common/input/gesture_event_stream_validator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698