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

Side by Side Diff: ui/events/blink/input_handler_proxy_unittest.cc

Issue 2782893002: WebMouseEvent coordinates are now fractional & private (Closed)
Patch Set: Rebased, fixed a comment in web_input_event_builders_mac.mm Created 3 years, 8 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
« no previous file with comments | « ui/events/blink/input_handler_proxy.cc ('k') | ui/events/blink/web_input_event.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ui/events/blink/input_handler_proxy.cc ('k') | ui/events/blink/web_input_event.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698