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

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

Issue 1720023002: Wheel scrolling with smooth scrolling enabled would cause an extra animation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix failing test with adjusted scrollbegin/scroll end approach Created 4 years, 10 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') | no next file » | 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 "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 621 matching lines...) Expand 10 before | Expand all | Expand 10 after
632 TEST_P(InputHandlerProxyTest, GestureScrollByCoarsePixels) { 632 TEST_P(InputHandlerProxyTest, GestureScrollByCoarsePixels) {
633 #else 633 #else
634 TEST_P(InputHandlerProxyTest, DISABLED_GestureScrollByCoarsePixels) { 634 TEST_P(InputHandlerProxyTest, DISABLED_GestureScrollByCoarsePixels) {
635 #endif 635 #endif
636 SetSmoothScrollEnabled(true); 636 SetSmoothScrollEnabled(true);
637 expected_disposition_ = InputHandlerProxy::DID_HANDLE; 637 expected_disposition_ = InputHandlerProxy::DID_HANDLE;
638 638
639 gesture_.type = WebInputEvent::GestureScrollBegin; 639 gesture_.type = WebInputEvent::GestureScrollBegin;
640 gesture_.data.scrollBegin.deltaHintUnits = 640 gesture_.data.scrollBegin.deltaHintUnits =
641 WebGestureEvent::ScrollUnits::Pixels; 641 WebGestureEvent::ScrollUnits::Pixels;
642 EXPECT_CALL(mock_input_handler_, ScrollAnimated(::testing::_, ::testing::_)) 642 EXPECT_CALL(mock_input_handler_, ScrollBegin(::testing::_, ::testing::_))
643 .WillOnce(testing::Return(kImplThreadScrollState)); 643 .WillOnce(testing::Return(kImplThreadScrollState));
644 EXPECT_CALL(mock_input_handler_, ScrollEnd(testing::_));
644 EXPECT_EQ(expected_disposition_, input_handler_->HandleInputEvent(gesture_)); 645 EXPECT_EQ(expected_disposition_, input_handler_->HandleInputEvent(gesture_));
645 646
646 gesture_.type = WebInputEvent::GestureScrollUpdate; 647 gesture_.type = WebInputEvent::GestureScrollUpdate;
647 gesture_.data.scrollUpdate.deltaUnits = WebGestureEvent::ScrollUnits::Pixels; 648 gesture_.data.scrollUpdate.deltaUnits = WebGestureEvent::ScrollUnits::Pixels;
648 649
649 EXPECT_CALL(mock_input_handler_, ScrollAnimated(::testing::_, ::testing::_)) 650 EXPECT_CALL(mock_input_handler_, ScrollAnimated(::testing::_, ::testing::_))
650 .WillOnce(testing::Return(kImplThreadScrollState)); 651 .WillOnce(testing::Return(kImplThreadScrollState));
651 EXPECT_EQ(expected_disposition_, input_handler_->HandleInputEvent(gesture_)); 652 EXPECT_EQ(expected_disposition_, input_handler_->HandleInputEvent(gesture_));
652 653
653 VERIFY_AND_RESET_MOCKS(); 654 VERIFY_AND_RESET_MOCKS();
(...skipping 2131 matching lines...) Expand 10 before | Expand all | Expand 10 after
2785 testing::Mock::VerifyAndClearExpectations(&mock_input_handler); 2786 testing::Mock::VerifyAndClearExpectations(&mock_input_handler);
2786 testing::Mock::VerifyAndClearExpectations(&mock_client); 2787 testing::Mock::VerifyAndClearExpectations(&mock_client);
2787 testing::Mock::VerifyAndClearExpectations(&mock_synchronous_input_handler); 2788 testing::Mock::VerifyAndClearExpectations(&mock_synchronous_input_handler);
2788 } 2789 }
2789 2790
2790 INSTANTIATE_TEST_CASE_P(AnimateInput, 2791 INSTANTIATE_TEST_CASE_P(AnimateInput,
2791 InputHandlerProxyTest, 2792 InputHandlerProxyTest,
2792 testing::ValuesIn(test_types)); 2793 testing::ValuesIn(test_types));
2793 } // namespace test 2794 } // namespace test
2794 } // namespace ui 2795 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/blink/input_handler_proxy.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698