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 1260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1271 GetEventListenerProperties(cc::EventListenerClass::kMouseWheel)) | 1271 GetEventListenerProperties(cc::EventListenerClass::kMouseWheel)) |
1272 .WillOnce(testing::Return(cc::EventListenerProperties::kPassive)); | 1272 .WillOnce(testing::Return(cc::EventListenerProperties::kPassive)); |
1273 EXPECT_CALL(mock_input_handler_, ScrollBegin(testing::_, testing::_)) | 1273 EXPECT_CALL(mock_input_handler_, ScrollBegin(testing::_, testing::_)) |
1274 .WillOnce(testing::Return(kImplThreadScrollState)); | 1274 .WillOnce(testing::Return(kImplThreadScrollState)); |
1275 EXPECT_CALL( | 1275 EXPECT_CALL( |
1276 mock_input_handler_, | 1276 mock_input_handler_, |
1277 ScrollBy(testing::Property(&cc::ScrollState::delta_x, testing::Lt(0)))) | 1277 ScrollBy(testing::Property(&cc::ScrollState::delta_x, testing::Lt(0)))) |
1278 .WillOnce(testing::Return(scroll_result_did_scroll_)); | 1278 .WillOnce(testing::Return(scroll_result_did_scroll_)); |
1279 WebMouseWheelEvent expected_wheel(WebInputEvent::MouseWheel, modifiers, | 1279 WebMouseWheelEvent expected_wheel(WebInputEvent::MouseWheel, modifiers, |
1280 WebInputEvent::TimeStampForTesting); | 1280 WebInputEvent::TimeStampForTesting); |
1281 expected_wheel.x = fling_point.x; | 1281 expected_wheel.setPositionInWidget(fling_point.x, fling_point.y); |
1282 expected_wheel.y = fling_point.y; | 1282 expected_wheel.setPositionInScreen(fling_global_point.x, |
1283 expected_wheel.globalX = fling_global_point.x; | 1283 fling_global_point.y); |
1284 expected_wheel.globalY = fling_global_point.y; | |
1285 expected_wheel.deltaX = fling_delta.x / 10; | 1284 expected_wheel.deltaX = fling_delta.x / 10; |
1286 expected_wheel.hasPreciseScrollingDeltas = true; | 1285 expected_wheel.hasPreciseScrollingDeltas = true; |
1287 | 1286 |
1288 EXPECT_CALL(mock_client_, DispatchNonBlockingEventToMainThread_( | 1287 EXPECT_CALL(mock_client_, DispatchNonBlockingEventToMainThread_( |
1289 WheelEventsMatch(expected_wheel))) | 1288 WheelEventsMatch(expected_wheel))) |
1290 .Times(1); | 1289 .Times(1); |
1291 EXPECT_CALL(mock_input_handler_, ScrollEnd(testing::_)).Times(1); | 1290 EXPECT_CALL(mock_input_handler_, ScrollEnd(testing::_)).Times(1); |
1292 | 1291 |
1293 time += base::TimeDelta::FromMilliseconds(100); | 1292 time += base::TimeDelta::FromMilliseconds(100); |
1294 Animate(time); | 1293 Animate(time); |
(...skipping 2324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3619 HandleGestureEvent(WebInputEvent::GestureScrollBegin); | 3618 HandleGestureEvent(WebInputEvent::GestureScrollBegin); |
3620 EXPECT_EQ(0ul, event_queue().size()); | 3619 EXPECT_EQ(0ul, event_queue().size()); |
3621 } | 3620 } |
3622 | 3621 |
3623 INSTANTIATE_TEST_CASE_P(AnimateInput, | 3622 INSTANTIATE_TEST_CASE_P(AnimateInput, |
3624 InputHandlerProxyTest, | 3623 InputHandlerProxyTest, |
3625 testing::ValuesIn(test_types)); | 3624 testing::ValuesIn(test_types)); |
3626 | 3625 |
3627 } // namespace test | 3626 } // namespace test |
3628 } // namespace ui | 3627 } // namespace ui |
OLD | NEW |