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

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

Issue 1888163003: Articulate the cancel behavior in the WebTouchEvent. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and non-const ref passed back Created 4 years, 8 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/common/input/web_input_event_traits.cc ('k') | content/common/input/web_touch_event_traits.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/input/web_input_event_traits_unittest.cc
diff --git a/content/common/input/web_input_event_traits_unittest.cc b/content/common/input/web_input_event_traits_unittest.cc
index 6ae3d93661664f7aea47cdc41d5ae2e8f4d65b3e..1daf80dcf1a4927ec6b994983aba1530e96acefe 100644
--- a/content/common/input/web_input_event_traits_unittest.cc
+++ b/content/common/input/web_input_event_traits_unittest.cc
@@ -124,6 +124,34 @@ TEST_F(WebInputEventTraitsTest, TouchEventCoalescing) {
ASSERT_EQ(0, touch1.touches[1].id);
EXPECT_EQ(WebTouchPoint::StateMoved, touch1.touches[0].state);
EXPECT_EQ(WebTouchPoint::StateMoved, touch1.touches[1].state);
+
+ // Touch moves with different dispatchTypes coalesce.
+ touch0 = CreateTouch(WebInputEvent::TouchMove, 2);
+ touch0.dispatchType = WebInputEvent::DispatchType::Blocking;
+ touch1 = CreateTouch(WebInputEvent::TouchMove, 2);
+ touch1.dispatchType = WebInputEvent::DispatchType::EventNonBlocking;
+ touch0.touches[0] = touch1.touches[1] =
+ CreateTouchPoint(WebTouchPoint::StateMoved, 1);
+ touch0.touches[1] = touch1.touches[0] =
+ CreateTouchPoint(WebTouchPoint::StateMoved, 0);
+ EXPECT_TRUE(WebInputEventTraits::CanCoalesce(touch0, touch1));
+ WebInputEventTraits::Coalesce(touch0, &touch1);
+ ASSERT_EQ(WebInputEvent::DispatchType::Blocking, touch1.dispatchType);
+
+ touch0 = CreateTouch(WebInputEvent::TouchMove, 2);
+ touch0.dispatchType =
+ WebInputEvent::DispatchType::ListenersForcedNonBlockingPassive;
+ touch1 = CreateTouch(WebInputEvent::TouchMove, 2);
+ touch1.dispatchType =
+ WebInputEvent::DispatchType::ListenersNonBlockingPassive;
+ touch0.touches[0] = touch1.touches[1] =
+ CreateTouchPoint(WebTouchPoint::StateMoved, 1);
+ touch0.touches[1] = touch1.touches[0] =
+ CreateTouchPoint(WebTouchPoint::StateMoved, 0);
+ EXPECT_TRUE(WebInputEventTraits::CanCoalesce(touch0, touch1));
+ WebInputEventTraits::Coalesce(touch0, &touch1);
+ ASSERT_EQ(WebInputEvent::DispatchType::ListenersNonBlockingPassive,
+ touch1.dispatchType);
}
TEST_F(WebInputEventTraitsTest, PinchEventCoalescing) {
« no previous file with comments | « content/common/input/web_input_event_traits.cc ('k') | content/common/input/web_touch_event_traits.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698