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

Side by Side Diff: content/browser/renderer_host/input/gesture_event_queue_unittest.cc

Issue 1932363002: Trackpad scrolling could lag on MacOSX (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix nits 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/renderer_host/input/gesture_event_queue.h" 5 #include "content/browser/renderer_host/input/gesture_event_queue.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <utility> 10 #include <utility>
(...skipping 1138 matching lines...) Expand 10 before | Expand all | Expand 10 after
1149 WebInputEvent::GestureScrollUpdate, 1149 WebInputEvent::GestureScrollUpdate,
1150 WebInputEvent::GestureScrollUpdate}; 1150 WebInputEvent::GestureScrollUpdate};
1151 1151
1152 for (unsigned i = 0; i < sizeof(expected) / sizeof(WebInputEvent::Type); 1152 for (unsigned i = 0; i < sizeof(expected) / sizeof(WebInputEvent::Type);
1153 i++) { 1153 i++) {
1154 WebGestureEvent merged_event = GestureEventQueueEventAt(i); 1154 WebGestureEvent merged_event = GestureEventQueueEventAt(i);
1155 EXPECT_EQ(expected[i], merged_event.type); 1155 EXPECT_EQ(expected[i], merged_event.type);
1156 } 1156 }
1157 } 1157 }
1158 1158
1159 TEST_F(GestureEventQueueTest, CoalescesSyntheticScrollBeginEndEvents) {
1160 // Test coalescing of only GestureScrollBegin/End events.
1161 SimulateGestureEvent(WebInputEvent::GestureScrollUpdate,
1162 blink::WebGestureDeviceTouchpad);
1163 EXPECT_EQ(1U, GetAndResetSentGestureEventCount());
1164 EXPECT_EQ(1U, GestureEventQueueSize());
1165
1166 WebGestureEvent synthetic_end = SyntheticWebGestureEventBuilder::Build(
1167 WebInputEvent::GestureScrollEnd, blink::WebGestureDeviceTouchpad);
1168 synthetic_end.data.scrollEnd.synthetic = true;
1169
1170 SimulateGestureEvent(synthetic_end);
1171 EXPECT_EQ(0U, GetAndResetSentGestureEventCount());
1172 EXPECT_EQ(2U, GestureEventQueueSize());
1173
1174 // Synthetic begin will remove the unsent synthetic end.
1175 WebGestureEvent synthetic_begin = SyntheticWebGestureEventBuilder::Build(
1176 WebInputEvent::GestureScrollBegin, blink::WebGestureDeviceTouchpad);
1177 synthetic_begin.data.scrollBegin.synthetic = true;
1178
1179 SimulateGestureEvent(synthetic_begin);
1180 EXPECT_EQ(0U, GetAndResetSentGestureEventCount());
1181 EXPECT_EQ(1U, GestureEventQueueSize());
1182 }
1183
1159 } // namespace content 1184 } // namespace content
OLDNEW
« 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