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

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

Issue 1749343004: Implement Wheel Gesture Scrolling on OSX. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Ensure only high precision scroll begins are used Created 4 years, 9 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
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 "base/macros.h" 7 #include "base/macros.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "cc/input/main_thread_scrolling_reason.h" 9 #include "cc/input/main_thread_scrolling_reason.h"
10 #include "cc/trees/swap_promise_monitor.h" 10 #include "cc/trees/swap_promise_monitor.h"
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 MOCK_METHOD0(PinchGestureEnd, void()); 97 MOCK_METHOD0(PinchGestureEnd, void());
98 98
99 MOCK_METHOD0(SetNeedsAnimateInput, void()); 99 MOCK_METHOD0(SetNeedsAnimateInput, void());
100 100
101 MOCK_METHOD2(ScrollBegin, 101 MOCK_METHOD2(ScrollBegin,
102 ScrollStatus(cc::ScrollState*, 102 ScrollStatus(cc::ScrollState*,
103 cc::InputHandler::ScrollInputType type)); 103 cc::InputHandler::ScrollInputType type));
104 MOCK_METHOD2(RootScrollBegin, 104 MOCK_METHOD2(RootScrollBegin,
105 ScrollStatus(cc::ScrollState*, 105 ScrollStatus(cc::ScrollState*,
106 cc::InputHandler::ScrollInputType type)); 106 cc::InputHandler::ScrollInputType type));
107 MOCK_METHOD1(ScrollAnimatedBegin,
108 ScrollStatus(const gfx::Point& viewport_point));
107 MOCK_METHOD2(ScrollAnimated, 109 MOCK_METHOD2(ScrollAnimated,
108 ScrollStatus(const gfx::Point& viewport_point, 110 ScrollStatus(const gfx::Point& viewport_point,
109 const gfx::Vector2dF& scroll_delta)); 111 const gfx::Vector2dF& scroll_delta));
110 MOCK_METHOD1(ScrollBy, cc::InputHandlerScrollResult(cc::ScrollState*)); 112 MOCK_METHOD1(ScrollBy, cc::InputHandlerScrollResult(cc::ScrollState*));
111 MOCK_METHOD2(ScrollVerticallyByPage, 113 MOCK_METHOD2(ScrollVerticallyByPage,
112 bool(const gfx::Point& viewport_point, 114 bool(const gfx::Point& viewport_point,
113 cc::ScrollDirection direction)); 115 cc::ScrollDirection direction));
114 MOCK_METHOD1(ScrollEnd, void(cc::ScrollState*)); 116 MOCK_METHOD1(ScrollEnd, void(cc::ScrollState*));
115 MOCK_METHOD0(FlingScrollBegin, cc::InputHandler::ScrollStatus()); 117 MOCK_METHOD0(FlingScrollBegin, cc::InputHandler::ScrollStatus());
116 118
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after
632 TEST_P(InputHandlerProxyTest, GestureScrollByCoarsePixels) { 634 TEST_P(InputHandlerProxyTest, GestureScrollByCoarsePixels) {
633 #else 635 #else
634 TEST_P(InputHandlerProxyTest, DISABLED_GestureScrollByCoarsePixels) { 636 TEST_P(InputHandlerProxyTest, DISABLED_GestureScrollByCoarsePixels) {
635 #endif 637 #endif
636 SetSmoothScrollEnabled(true); 638 SetSmoothScrollEnabled(true);
637 expected_disposition_ = InputHandlerProxy::DID_HANDLE; 639 expected_disposition_ = InputHandlerProxy::DID_HANDLE;
638 640
639 gesture_.type = WebInputEvent::GestureScrollBegin; 641 gesture_.type = WebInputEvent::GestureScrollBegin;
640 gesture_.data.scrollBegin.deltaHintUnits = 642 gesture_.data.scrollBegin.deltaHintUnits =
641 WebGestureEvent::ScrollUnits::Pixels; 643 WebGestureEvent::ScrollUnits::Pixels;
642 EXPECT_CALL(mock_input_handler_, ScrollBegin(::testing::_, ::testing::_)) 644 EXPECT_CALL(mock_input_handler_, ScrollAnimatedBegin(::testing::_))
643 .WillOnce(testing::Return(kImplThreadScrollState)); 645 .WillOnce(testing::Return(kImplThreadScrollState));
644 EXPECT_CALL(mock_input_handler_, ScrollEnd(testing::_));
645 EXPECT_EQ(expected_disposition_, input_handler_->HandleInputEvent(gesture_)); 646 EXPECT_EQ(expected_disposition_, input_handler_->HandleInputEvent(gesture_));
646 647
647 gesture_.type = WebInputEvent::GestureScrollUpdate; 648 gesture_.type = WebInputEvent::GestureScrollUpdate;
648 gesture_.data.scrollUpdate.deltaUnits = WebGestureEvent::ScrollUnits::Pixels; 649 gesture_.data.scrollUpdate.deltaUnits = WebGestureEvent::ScrollUnits::Pixels;
649 650
650 EXPECT_CALL(mock_input_handler_, ScrollAnimated(::testing::_, ::testing::_)) 651 EXPECT_CALL(mock_input_handler_, ScrollAnimated(::testing::_, ::testing::_))
651 .WillOnce(testing::Return(kImplThreadScrollState)); 652 .WillOnce(testing::Return(kImplThreadScrollState));
652 EXPECT_EQ(expected_disposition_, input_handler_->HandleInputEvent(gesture_)); 653 EXPECT_EQ(expected_disposition_, input_handler_->HandleInputEvent(gesture_));
653 654
654 VERIFY_AND_RESET_MOCKS(); 655 VERIFY_AND_RESET_MOCKS();
(...skipping 2131 matching lines...) Expand 10 before | Expand all | Expand 10 after
2786 testing::Mock::VerifyAndClearExpectations(&mock_input_handler); 2787 testing::Mock::VerifyAndClearExpectations(&mock_input_handler);
2787 testing::Mock::VerifyAndClearExpectations(&mock_client); 2788 testing::Mock::VerifyAndClearExpectations(&mock_client);
2788 testing::Mock::VerifyAndClearExpectations(&mock_synchronous_input_handler); 2789 testing::Mock::VerifyAndClearExpectations(&mock_synchronous_input_handler);
2789 } 2790 }
2790 2791
2791 INSTANTIATE_TEST_CASE_P(AnimateInput, 2792 INSTANTIATE_TEST_CASE_P(AnimateInput,
2792 InputHandlerProxyTest, 2793 InputHandlerProxyTest,
2793 testing::ValuesIn(test_types)); 2794 testing::ValuesIn(test_types));
2794 } // namespace test 2795 } // namespace test
2795 } // namespace ui 2796 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/blink/input_handler_proxy.cc ('k') | ui/events/blink/input_scroll_elasticity_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698