| OLD | NEW |
| 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 <vector> | 5 #include <vector> |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 1133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1144 WebInputEvent::GestureScrollUpdate, | 1144 WebInputEvent::GestureScrollUpdate, |
| 1145 WebInputEvent::GestureScrollUpdate}; | 1145 WebInputEvent::GestureScrollUpdate}; |
| 1146 | 1146 |
| 1147 for (unsigned i = 0; i < sizeof(expected) / sizeof(WebInputEvent::Type); | 1147 for (unsigned i = 0; i < sizeof(expected) / sizeof(WebInputEvent::Type); |
| 1148 i++) { | 1148 i++) { |
| 1149 WebGestureEvent merged_event = GestureEventQueueEventAt(i); | 1149 WebGestureEvent merged_event = GestureEventQueueEventAt(i); |
| 1150 EXPECT_EQ(expected[i], merged_event.type); | 1150 EXPECT_EQ(expected[i], merged_event.type); |
| 1151 } | 1151 } |
| 1152 } | 1152 } |
| 1153 | 1153 |
| 1154 TEST_F(GestureEventQueueTest, DropZeroVelocityFlings) { | |
| 1155 WebGestureEvent gesture_event; | |
| 1156 gesture_event.type = WebInputEvent::GestureFlingStart; | |
| 1157 gesture_event.sourceDevice = WebGestureEvent::Touchpad; | |
| 1158 gesture_event.data.flingStart.velocityX = 0.f; | |
| 1159 gesture_event.data.flingStart.velocityY = 0.f; | |
| 1160 ASSERT_EQ(0U, GetAndResetSentGestureEventCount()); | |
| 1161 ASSERT_EQ(0U, GestureEventQueueSize()); | |
| 1162 EXPECT_FALSE(SimulateGestureEvent(gesture_event)); | |
| 1163 EXPECT_EQ(0U, GetAndResetSentGestureEventCount()); | |
| 1164 EXPECT_EQ(0U, GestureEventQueueSize()); | |
| 1165 } | |
| 1166 | |
| 1167 } // namespace content | 1154 } // namespace content |
| OLD | NEW |