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

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: 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
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 // Simulate gesture events.
tdresser 2016/05/02 13:27:15 The previous line doesn't add much information.
dtapuska 2016/05/02 13:57:25 Done.
1162
1163 SimulateGestureEvent(WebInputEvent::GestureScrollUpdate,
1164 blink::WebGestureDeviceTouchpad);
1165 EXPECT_EQ(1U, GetAndResetSentGestureEventCount());
1166 EXPECT_EQ(1U, GestureEventQueueSize());
1167
1168 WebGestureEvent synthetic_end = SyntheticWebGestureEventBuilder::Build(
1169 WebInputEvent::GestureScrollEnd, blink::WebGestureDeviceTouchpad);
1170 synthetic_end.data.scrollEnd.synthetic = true;
1171
1172 SimulateGestureEvent(synthetic_end);
1173 EXPECT_EQ(0U, GetAndResetSentGestureEventCount());
1174 EXPECT_EQ(2U, GestureEventQueueSize());
1175
1176 // Synthetic begin will remove the unsent synthetic end.
1177 WebGestureEvent synthetic_begin = SyntheticWebGestureEventBuilder::Build(
1178 WebInputEvent::GestureScrollBegin, blink::WebGestureDeviceTouchpad);
1179 synthetic_begin.data.scrollBegin.synthetic = true;
1180
1181 SimulateGestureEvent(synthetic_begin);
1182 EXPECT_EQ(0U, GetAndResetSentGestureEventCount());
1183 EXPECT_EQ(1U, GestureEventQueueSize());
1184 }
1185
1159 } // namespace content 1186 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698