Chromium Code Reviews| Index: ui/events/blink/input_handler_proxy_unittest.cc |
| diff --git a/ui/events/blink/input_handler_proxy_unittest.cc b/ui/events/blink/input_handler_proxy_unittest.cc |
| index 729029b4b1d6273c22ed12e9f5805e73cc4a5236..662cd37eb540bd3daaee7743707a43600292c5b8 100644 |
| --- a/ui/events/blink/input_handler_proxy_unittest.cc |
| +++ b/ui/events/blink/input_handler_proxy_unittest.cc |
| @@ -1994,6 +1994,10 @@ TEST_P(InputHandlerProxyTest, MultiTouchPointHitTestNegative) { |
| EXPECT_CALL(mock_input_handler_, |
| GetEventListenerProperties(cc::EventListenerClass::kTouch)) |
| .WillOnce(testing::Return(cc::EventListenerProperties::kNone)); |
| + EXPECT_CALL( |
| + mock_input_handler_, |
| + GetEventListenerProperties(cc::EventListenerClass::kTouchEndOrCancel)) |
| + .WillOnce(testing::Return(cc::EventListenerProperties::kNone)); |
| EXPECT_CALL(mock_input_handler_, DoTouchEventsBlockScrollAt(testing::_)) |
| .WillOnce(testing::Return(false)); |
| EXPECT_CALL(mock_input_handler_, |
| @@ -2066,6 +2070,37 @@ TEST_P(InputHandlerProxyTest, MultiTouchPointHitTestPassivePositive) { |
| VERIFY_AND_RESET_MOCKS(); |
| } |
| +TEST_P(InputHandlerProxyTest, TouchStartPassiveAndTouchEndBlocking) { |
| + // The touch start is not in a region but there is a touch end handler |
|
tdresser
2016/04/13 16:52:35
not in a touch-region
dtapuska
2016/04/13 18:00:15
Done.
|
| + // so to maintain targetting we need to dispatch the touch start as |
|
tdresser
2016/04/13 16:52:35
targeting
dtapuska
2016/04/13 18:00:15
Done.
|
| + // non-blocking but drop all touch moves. |
| + expected_disposition_ = InputHandlerProxy::DID_HANDLE_NON_BLOCKING; |
| + VERIFY_AND_RESET_MOCKS(); |
| + |
| + EXPECT_CALL(mock_input_handler_, |
| + GetEventListenerProperties(cc::EventListenerClass::kTouch)) |
| + .WillOnce(testing::Return(cc::EventListenerProperties::kNone)); |
| + EXPECT_CALL( |
| + mock_input_handler_, |
| + GetEventListenerProperties(cc::EventListenerClass::kTouchEndOrCancel)) |
| + .WillOnce(testing::Return(cc::EventListenerProperties::kBlocking)); |
| + EXPECT_CALL(mock_input_handler_, DoTouchEventsBlockScrollAt(testing::_)) |
| + .WillOnce(testing::Return(false)); |
| + |
| + WebTouchEvent touch; |
| + touch.type = WebInputEvent::TouchStart; |
| + touch.touchesLength = 1; |
| + touch.touches[0] = CreateWebTouchPoint(WebTouchPoint::StatePressed, 0, 0); |
| + EXPECT_EQ(expected_disposition_, input_handler_->HandleInputEvent(touch)); |
| + |
| + touch.type = WebInputEvent::TouchMove; |
| + touch.touchesLength = 1; |
| + touch.touches[0] = CreateWebTouchPoint(WebTouchPoint::StatePressed, 10, 10); |
| + EXPECT_EQ(InputHandlerProxy::DROP_EVENT, |
| + input_handler_->HandleInputEvent(touch)); |
| + VERIFY_AND_RESET_MOCKS(); |
| +} |
| + |
| TEST_P(InputHandlerProxyTest, GestureFlingCancelledByKeyboardEvent) { |
| // We shouldn't send any events to the widget for this gesture. |
| expected_disposition_ = InputHandlerProxy::DID_HANDLE; |