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

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

Issue 872633005: Stop sending an async touchmove for the app slop region (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comment Created 5 years, 11 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_event_queue.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_event_queue_unittest.cc
diff --git a/content/browser/renderer_host/input/touch_event_queue_unittest.cc b/content/browser/renderer_host/input/touch_event_queue_unittest.cc
index 21895d2935c7f0150262eba792821ee9be57ca4a..6d75aedd09189aca8cabd2a36978d1e5e765e4c3 100644
--- a/content/browser/renderer_host/input/touch_event_queue_unittest.cc
+++ b/content/browser/renderer_host/input/touch_event_queue_unittest.cc
@@ -1936,6 +1936,45 @@ TEST_F(TouchEventQueueTest, AsyncTouchThrottledAfterScroll) {
EXPECT_EQ(1U, GetAndResetAckedEventCount());
}
+TEST_F(TouchEventQueueTest, AsyncTouchDeferredDuringTouchAck) {
+ SetTouchScrollingMode(TouchEventQueue::TOUCH_SCROLLING_MODE_ASYNC_TOUCHMOVE);
+
+ // Initiate scroll-induced touch throttling.
+ PressTouchPoint(0, 0);
+ SendTouchEventAck(INPUT_EVENT_ACK_STATE_NOT_CONSUMED);
+ EXPECT_EQ(1U, GetAndResetSentEventCount());
+ EXPECT_EQ(1U, GetAndResetAckedEventCount());
+
+ MoveTouchPoint(0, 0, 5);
+ EXPECT_EQ(1U, queued_event_count());
+ EXPECT_EQ(1U, GetAndResetSentEventCount());
+ EXPECT_EQ(0U, GetAndResetAckedEventCount());
+ SendGestureEvent(WebInputEvent::GestureScrollBegin);
+ SendGestureEvent(WebInputEvent::GestureScrollUpdate);
+
+ // Now queue a touchmove that exceeds the application slop region.
+ MoveTouchPoint(0, 0, 20);
+ EXPECT_FALSE(HasPendingAsyncTouchMove());
+ EXPECT_EQ(2U, queued_event_count());
+ EXPECT_EQ(0U, GetAndResetSentEventCount());
+ EXPECT_EQ(0U, GetAndResetAckedEventCount());
+
+ // Despite the second touchmove exceeding the application slop region, its
+ // sending will be deferred until after the original touch was ack'ed.
+ SendTouchEventAck(INPUT_EVENT_ACK_STATE_NOT_CONSUMED);
+ EXPECT_TRUE(HasPendingAsyncTouchMove());
+ EXPECT_EQ(0U, queued_event_count());
+ EXPECT_EQ(0U, GetAndResetSentEventCount());
+ EXPECT_EQ(2U, GetAndResetAckedEventCount());
+
+ // A subsequent touchmove will flush the deferred async touchmove,
Rick Byers 2015/01/27 17:59:15 coalescing means it's more like 'replace' than 'fl
+ MoveTouchPoint(0, 0, 25);
+ EXPECT_FALSE(HasPendingAsyncTouchMove());
+ EXPECT_FALSE(sent_event().cancelable);
+ EXPECT_EQ(1U, GetAndResetSentEventCount());
+ EXPECT_EQ(0U, GetAndResetAckedEventCount());
+}
+
// Ensure that async touch dispatch and touch ack timeout interactions work
// appropriately.
TEST_F(TouchEventQueueTest, AsyncTouchWithAckTimeout) {
« no previous file with comments | « content/browser/renderer_host/input/touch_event_queue.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698