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

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

Issue 724313003: [Android] Always precede Tap gesture events with TapDown (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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_unittest.cc
diff --git a/content/common/input/gesture_event_stream_validator_unittest.cc b/content/common/input/gesture_event_stream_validator_unittest.cc
index 857dcfe9375e8f898e08b85b7b4c626e87afab84..590b1884e11c800a2723d3036240dd063f64a2bf 100644
--- a/content/common/input/gesture_event_stream_validator_unittest.cc
+++ b/content/common/input/gesture_event_stream_validator_unittest.cc
@@ -181,12 +181,16 @@ TEST(GestureEventStreamValidator, ValidTap) {
EXPECT_TRUE(validator.Validate(event, &error_msg));
EXPECT_TRUE(error_msg.empty());
- // Tap and DoubleTap do not require a TapDown (unlike TapUnconfirmed and
- // TapCancel).
+ event = Build(WebInputEvent::GestureTapDown);
+ EXPECT_TRUE(validator.Validate(event, &error_msg));
+ EXPECT_TRUE(error_msg.empty());
+
event = Build(WebInputEvent::GestureTap);
EXPECT_TRUE(validator.Validate(event, &error_msg));
EXPECT_TRUE(error_msg.empty());
+ // DoubleTap does not require a TapDown (unlike Tap, TapUnconfirmed and
+ // TapCancel).
event = Build(WebInputEvent::GestureDoubleTap);
EXPECT_TRUE(validator.Validate(event, &error_msg));
EXPECT_TRUE(error_msg.empty());
@@ -206,6 +210,10 @@ TEST(GestureEventStreamValidator, InvalidTap) {
EXPECT_FALSE(validator.Validate(event, &error_msg));
EXPECT_FALSE(error_msg.empty());
+ event = Build(WebInputEvent::GestureTap);
+ EXPECT_FALSE(validator.Validate(event, &error_msg));
+ EXPECT_FALSE(error_msg.empty());
+
// TapDown already terminated.
event = Build(WebInputEvent::GestureTapDown);
EXPECT_TRUE(validator.Validate(event, &error_msg));

Powered by Google App Engine
This is Rietveld 408576698