OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "ui/events/blink/input_handler_proxy.h" | 5 #include "ui/events/blink/input_handler_proxy.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 1258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1269 GetEventListenerProperties(cc::EventListenerClass::kMouseWheel)) | 1269 GetEventListenerProperties(cc::EventListenerClass::kMouseWheel)) |
1270 .WillOnce(testing::Return(cc::EventListenerProperties::kPassive)); | 1270 .WillOnce(testing::Return(cc::EventListenerProperties::kPassive)); |
1271 EXPECT_CALL(mock_input_handler_, ScrollBegin(testing::_, testing::_)) | 1271 EXPECT_CALL(mock_input_handler_, ScrollBegin(testing::_, testing::_)) |
1272 .WillOnce(testing::Return(kImplThreadScrollState)); | 1272 .WillOnce(testing::Return(kImplThreadScrollState)); |
1273 EXPECT_CALL( | 1273 EXPECT_CALL( |
1274 mock_input_handler_, | 1274 mock_input_handler_, |
1275 ScrollBy(testing::Property(&cc::ScrollState::delta_x, testing::Lt(0)))) | 1275 ScrollBy(testing::Property(&cc::ScrollState::delta_x, testing::Lt(0)))) |
1276 .WillOnce(testing::Return(scroll_result_did_scroll_)); | 1276 .WillOnce(testing::Return(scroll_result_did_scroll_)); |
1277 WebMouseWheelEvent expected_wheel(WebInputEvent::MouseWheel, modifiers, | 1277 WebMouseWheelEvent expected_wheel(WebInputEvent::MouseWheel, modifiers, |
1278 WebInputEvent::TimeStampForTesting); | 1278 WebInputEvent::TimeStampForTesting); |
1279 expected_wheel.x = fling_point.x; | 1279 expected_wheel.position.x = fling_point.x; |
1280 expected_wheel.y = fling_point.y; | 1280 expected_wheel.position.y = fling_point.y; |
1281 expected_wheel.globalX = fling_global_point.x; | 1281 expected_wheel.screenPosition.x = fling_global_point.x; |
1282 expected_wheel.globalY = fling_global_point.y; | 1282 expected_wheel.screenPosition.y = fling_global_point.y; |
1283 expected_wheel.deltaX = fling_delta.x / 10; | 1283 expected_wheel.deltaX = fling_delta.x / 10; |
1284 expected_wheel.hasPreciseScrollingDeltas = true; | 1284 expected_wheel.hasPreciseScrollingDeltas = true; |
1285 | 1285 |
1286 EXPECT_CALL(mock_client_, DispatchNonBlockingEventToMainThread_( | 1286 EXPECT_CALL(mock_client_, DispatchNonBlockingEventToMainThread_( |
1287 WheelEventsMatch(expected_wheel))) | 1287 WheelEventsMatch(expected_wheel))) |
1288 .Times(1); | 1288 .Times(1); |
1289 EXPECT_CALL(mock_input_handler_, ScrollEnd(testing::_)).Times(1); | 1289 EXPECT_CALL(mock_input_handler_, ScrollEnd(testing::_)).Times(1); |
1290 | 1290 |
1291 time += base::TimeDelta::FromMilliseconds(100); | 1291 time += base::TimeDelta::FromMilliseconds(100); |
1292 Animate(time); | 1292 Animate(time); |
(...skipping 2324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3617 HandleGestureEvent(WebInputEvent::GestureScrollBegin); | 3617 HandleGestureEvent(WebInputEvent::GestureScrollBegin); |
3618 EXPECT_EQ(0ul, event_queue().size()); | 3618 EXPECT_EQ(0ul, event_queue().size()); |
3619 } | 3619 } |
3620 | 3620 |
3621 INSTANTIATE_TEST_CASE_P(AnimateInput, | 3621 INSTANTIATE_TEST_CASE_P(AnimateInput, |
3622 InputHandlerProxyTest, | 3622 InputHandlerProxyTest, |
3623 testing::ValuesIn(test_types)); | 3623 testing::ValuesIn(test_types)); |
3624 | 3624 |
3625 } // namespace test | 3625 } // namespace test |
3626 } // namespace ui | 3626 } // namespace ui |
OLD | NEW |