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

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

Issue 1949993002: Trackpad scrolling could lag on MacOSX (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: Created 4 years, 7 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/gesture_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/gesture_event_queue_unittest.cc
diff --git a/content/browser/renderer_host/input/gesture_event_queue_unittest.cc b/content/browser/renderer_host/input/gesture_event_queue_unittest.cc
index 44087274c4bae32cf9a0a3ac2c419b2733aa4386..6b3234a7af5f8973e6735ca152ba0815874842a7 100644
--- a/content/browser/renderer_host/input/gesture_event_queue_unittest.cc
+++ b/content/browser/renderer_host/input/gesture_event_queue_unittest.cc
@@ -1154,4 +1154,29 @@ TEST_F(GestureEventQueueTest, DebounceDropsDeferredEvents) {
}
}
+TEST_F(GestureEventQueueTest, CoalescesSyntheticScrollBeginEndEvents) {
+ // Test coalescing of only GestureScrollBegin/End events.
+ SimulateGestureEvent(WebInputEvent::GestureScrollUpdate,
+ blink::WebGestureDeviceTouchpad);
+ EXPECT_EQ(1U, GetAndResetSentGestureEventCount());
+ EXPECT_EQ(1U, GestureEventQueueSize());
+
+ WebGestureEvent synthetic_end = SyntheticWebGestureEventBuilder::Build(
+ WebInputEvent::GestureScrollEnd, blink::WebGestureDeviceTouchpad);
+ synthetic_end.data.scrollEnd.synthetic = true;
+
+ SimulateGestureEvent(synthetic_end);
+ EXPECT_EQ(0U, GetAndResetSentGestureEventCount());
+ EXPECT_EQ(2U, GestureEventQueueSize());
+
+ // Synthetic begin will remove the unsent synthetic end.
+ WebGestureEvent synthetic_begin = SyntheticWebGestureEventBuilder::Build(
+ WebInputEvent::GestureScrollBegin, blink::WebGestureDeviceTouchpad);
+ synthetic_begin.data.scrollBegin.synthetic = true;
+
+ SimulateGestureEvent(synthetic_begin);
+ EXPECT_EQ(0U, GetAndResetSentGestureEventCount());
+ EXPECT_EQ(1U, GestureEventQueueSize());
+}
+
} // namespace content
« no previous file with comments | « content/browser/renderer_host/input/gesture_event_queue.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698