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

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

Issue 2793403002: Adds missing kBlockingAndPassive case to TouchpadFlingScroll (Closed)
Patch Set: 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') | 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 <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 597 matching lines...) Expand 10 before | Expand all | Expand 10 after
608 EXPECT_CALL(mock_input_handler_, 608 EXPECT_CALL(mock_input_handler_,
609 GetEventListenerProperties(cc::EventListenerClass::kMouseWheel)) 609 GetEventListenerProperties(cc::EventListenerClass::kMouseWheel))
610 .WillOnce(testing::Return(cc::EventListenerProperties::kBlocking)); 610 .WillOnce(testing::Return(cc::EventListenerProperties::kBlocking));
611 611
612 WebMouseWheelEvent wheel(WebInputEvent::MouseWheel, WebInputEvent::ControlKey, 612 WebMouseWheelEvent wheel(WebInputEvent::MouseWheel, WebInputEvent::ControlKey,
613 WebInputEvent::TimeStampForTesting); 613 WebInputEvent::TimeStampForTesting);
614 EXPECT_EQ(expected_disposition_, input_handler_->HandleInputEvent(wheel)); 614 EXPECT_EQ(expected_disposition_, input_handler_->HandleInputEvent(wheel));
615 VERIFY_AND_RESET_MOCKS(); 615 VERIFY_AND_RESET_MOCKS();
616 } 616 }
617 617
618 TEST_P(InputHandlerProxyTest, MouseWheelBlockingAndPassiveListener) {
619 expected_disposition_ = InputHandlerProxy::DID_NOT_HANDLE;
620 EXPECT_CALL(mock_input_handler_,
621 GetEventListenerProperties(cc::EventListenerClass::kMouseWheel))
622 .WillOnce(
623 testing::Return(cc::EventListenerProperties::kBlockingAndPassive));
624
625 WebMouseWheelEvent wheel(WebInputEvent::MouseWheel, WebInputEvent::ControlKey,
626 WebInputEvent::TimeStampForTesting);
627 EXPECT_EQ(expected_disposition_, input_handler_->HandleInputEvent(wheel));
628 VERIFY_AND_RESET_MOCKS();
629 }
630
618 TEST_P(InputHandlerProxyTest, GestureScrollStarted) { 631 TEST_P(InputHandlerProxyTest, GestureScrollStarted) {
619 // We shouldn't send any events to the widget for this gesture. 632 // We shouldn't send any events to the widget for this gesture.
620 expected_disposition_ = InputHandlerProxy::DID_HANDLE; 633 expected_disposition_ = InputHandlerProxy::DID_HANDLE;
621 VERIFY_AND_RESET_MOCKS(); 634 VERIFY_AND_RESET_MOCKS();
622 635
623 EXPECT_CALL(mock_input_handler_, ScrollBegin(testing::_, testing::_)) 636 EXPECT_CALL(mock_input_handler_, ScrollBegin(testing::_, testing::_))
624 .WillOnce(testing::Return(kImplThreadScrollState)); 637 .WillOnce(testing::Return(kImplThreadScrollState));
625 638
626 gesture_.setType(WebInputEvent::GestureScrollBegin); 639 gesture_.setType(WebInputEvent::GestureScrollBegin);
627 EXPECT_EQ(expected_disposition_,input_handler_->HandleInputEvent(gesture_)); 640 EXPECT_EQ(expected_disposition_,input_handler_->HandleInputEvent(gesture_));
(...skipping 2991 matching lines...) Expand 10 before | Expand all | Expand 10 after
3619 HandleGestureEvent(WebInputEvent::GestureScrollBegin); 3632 HandleGestureEvent(WebInputEvent::GestureScrollBegin);
3620 EXPECT_EQ(0ul, event_queue().size()); 3633 EXPECT_EQ(0ul, event_queue().size());
3621 } 3634 }
3622 3635
3623 INSTANTIATE_TEST_CASE_P(AnimateInput, 3636 INSTANTIATE_TEST_CASE_P(AnimateInput,
3624 InputHandlerProxyTest, 3637 InputHandlerProxyTest,
3625 testing::ValuesIn(test_types)); 3638 testing::ValuesIn(test_types));
3626 3639
3627 } // namespace test 3640 } // namespace test
3628 } // namespace ui 3641 } // 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