OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/common/input/event_with_latency_info.h" | 5 #include "content/common/input/event_with_latency_info.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
10 #include "third_party/WebKit/public/web/WebInputEvent.h" | 10 #include "third_party/WebKit/public/web/WebInputEvent.h" |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 touch0.event.touches[0] = touch1.event.touches[1] = | 231 touch0.event.touches[0] = touch1.event.touches[1] = |
232 CreateTouchPoint(WebTouchPoint::StateMoved, 1); | 232 CreateTouchPoint(WebTouchPoint::StateMoved, 1); |
233 touch0.event.touches[1] = touch1.event.touches[0] = | 233 touch0.event.touches[1] = touch1.event.touches[0] = |
234 CreateTouchPoint(WebTouchPoint::StateMoved, 0); | 234 CreateTouchPoint(WebTouchPoint::StateMoved, 0); |
235 EXPECT_TRUE(CanCoalesce(touch0, touch1)); | 235 EXPECT_TRUE(CanCoalesce(touch0, touch1)); |
236 Coalesce(touch0, &touch1); | 236 Coalesce(touch0, &touch1); |
237 ASSERT_EQ(WebInputEvent::DispatchType::Blocking, touch1.event.dispatchType); | 237 ASSERT_EQ(WebInputEvent::DispatchType::Blocking, touch1.event.dispatchType); |
238 | 238 |
239 touch0 = CreateTouch(WebInputEvent::TouchMove, 2); | 239 touch0 = CreateTouch(WebInputEvent::TouchMove, 2); |
240 touch0.event.dispatchType = | 240 touch0.event.dispatchType = |
241 WebInputEvent::DispatchType::ListenersForcedNonBlockingPassive; | 241 WebInputEvent::DispatchType::ListenersForcedNonBlockingPassiveDueToFling; |
242 touch1 = CreateTouch(WebInputEvent::TouchMove, 2); | 242 touch1 = CreateTouch(WebInputEvent::TouchMove, 2); |
243 touch1.event.dispatchType = | 243 touch1.event.dispatchType = |
244 WebInputEvent::DispatchType::ListenersNonBlockingPassive; | 244 WebInputEvent::DispatchType::ListenersNonBlockingPassive; |
245 touch0.event.touches[0] = touch1.event.touches[1] = | 245 touch0.event.touches[0] = touch1.event.touches[1] = |
246 CreateTouchPoint(WebTouchPoint::StateMoved, 1); | 246 CreateTouchPoint(WebTouchPoint::StateMoved, 1); |
247 touch0.event.touches[1] = touch1.event.touches[0] = | 247 touch0.event.touches[1] = touch1.event.touches[0] = |
248 CreateTouchPoint(WebTouchPoint::StateMoved, 0); | 248 CreateTouchPoint(WebTouchPoint::StateMoved, 0); |
249 EXPECT_TRUE(CanCoalesce(touch0, touch1)); | 249 EXPECT_TRUE(CanCoalesce(touch0, touch1)); |
250 Coalesce(touch0, &touch1); | 250 Coalesce(touch0, &touch1); |
251 ASSERT_EQ(WebInputEvent::DispatchType::ListenersNonBlockingPassive, | 251 ASSERT_EQ(WebInputEvent::DispatchType::ListenersNonBlockingPassive, |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 MouseWheelEventWithLatencyInfo mouse_wheel_1 = CreateMouseWheel(2, 2); | 322 MouseWheelEventWithLatencyInfo mouse_wheel_1 = CreateMouseWheel(2, 2); |
323 mouse_wheel_1.event.timeStampSeconds = 10.0; | 323 mouse_wheel_1.event.timeStampSeconds = 10.0; |
324 | 324 |
325 EXPECT_TRUE(CanCoalesce(mouse_wheel_0, mouse_wheel_1)); | 325 EXPECT_TRUE(CanCoalesce(mouse_wheel_0, mouse_wheel_1)); |
326 Coalesce(mouse_wheel_1, &mouse_wheel_0); | 326 Coalesce(mouse_wheel_1, &mouse_wheel_0); |
327 EXPECT_EQ(10.0, mouse_wheel_0.event.timeStampSeconds); | 327 EXPECT_EQ(10.0, mouse_wheel_0.event.timeStampSeconds); |
328 } | 328 } |
329 | 329 |
330 } // namespace | 330 } // namespace |
331 } // namespace content | 331 } // namespace content |
OLD | NEW |