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

Unified Diff: ui/events/blink/input_handler_proxy_unittest.cc

Issue 2471523002: Make touch events uncancelable during fling when they are on the current active scroll layer (Closed)
Patch Set: clean up code Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
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 889270c4c0f176b9b813609adec9e6d708d454a8..cbe7df43a56b2311575977eb73d83a85d4beba01 100644
--- a/ui/events/blink/input_handler_proxy_unittest.cc
+++ b/ui/events/blink/input_handler_proxy_unittest.cc
@@ -162,7 +162,8 @@ class MockInputHandler : public cc::InputHandler {
MOCK_CONST_METHOD1(
GetEventListenerProperties,
cc::EventListenerProperties(cc::EventListenerClass event_class));
- MOCK_METHOD1(DoTouchEventsBlockScrollAt, bool(const gfx::Point& point));
+ MOCK_METHOD1(DoTouchEventsBlockScrollAt,
+ TouchStartHitResult(const gfx::Point& point));
MOCK_METHOD0(RequestUpdateForSynchronousInputHandler, void());
MOCK_METHOD1(SetSynchronousInputHandlerRootScrollOffset,
@@ -255,7 +256,6 @@ class MockInputHandlerProxyClient
const gfx::Vector2dF& latest_overscroll_delta,
const gfx::Vector2dF& current_fling_velocity,
const gfx::PointF& causal_event_viewport_point));
- void DidStartFlinging() override {}
void DidStopFlinging() override {}
void DidAnimateForInput() override {}
@@ -1943,11 +1943,12 @@ TEST_P(InputHandlerProxyTest, MultiTouchPointHitTestNegative) {
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_,
- DoTouchEventsBlockScrollAt(
- testing::Property(&gfx::Point::x, testing::Lt(0))))
- .WillOnce(testing::Return(false));
+ .WillOnce(
+ testing::Return(cc::InputHandler::TouchStartHitResult::HANDLER));
+ EXPECT_CALL(mock_input_handler_, DoTouchEventsBlockScrollAt(testing::Property(
+ &gfx::Point::x, testing::Lt(0))))
+ .WillOnce(
+ testing::Return(cc::InputHandler::TouchStartHitResult::HANDLER));
WebTouchEvent touch;
touch.type = WebInputEvent::TouchStart;
@@ -1967,14 +1968,14 @@ TEST_P(InputHandlerProxyTest, MultiTouchPointHitTestPositive) {
expected_disposition_ = InputHandlerProxy::DID_NOT_HANDLE;
VERIFY_AND_RESET_MOCKS();
- EXPECT_CALL(mock_input_handler_,
- DoTouchEventsBlockScrollAt(
- testing::Property(&gfx::Point::x, testing::Eq(0))))
- .WillOnce(testing::Return(false));
- EXPECT_CALL(mock_input_handler_,
- DoTouchEventsBlockScrollAt(
- testing::Property(&gfx::Point::x, testing::Gt(0))))
- .WillOnce(testing::Return(true));
+ EXPECT_CALL(mock_input_handler_, DoTouchEventsBlockScrollAt(testing::Property(
+ &gfx::Point::x, testing::Eq(0))))
+ .WillOnce(
+ testing::Return(cc::InputHandler::TouchStartHitResult::HANDLER));
+ EXPECT_CALL(mock_input_handler_, DoTouchEventsBlockScrollAt(testing::Property(
+ &gfx::Point::x, testing::Gt(0))))
+ .WillOnce(
+ testing::Return(cc::InputHandler::TouchStartHitResult::SAME_LAYER));
// Since the second touch point hits a touch-region, there should be no
// hit-testing for the third touch point.
@@ -2001,7 +2002,8 @@ TEST_P(InputHandlerProxyTest, MultiTouchPointHitTestPassivePositive) {
GetEventListenerProperties(cc::EventListenerClass::kTouchStartOrMove))
.WillRepeatedly(testing::Return(cc::EventListenerProperties::kPassive));
EXPECT_CALL(mock_input_handler_, DoTouchEventsBlockScrollAt(testing::_))
- .WillRepeatedly(testing::Return(false));
+ .WillRepeatedly(
+ testing::Return(cc::InputHandler::TouchStartHitResult::HANDLER));
WebTouchEvent touch;
touch.type = WebInputEvent::TouchStart;
@@ -2031,7 +2033,8 @@ TEST_P(InputHandlerProxyTest, TouchStartPassiveAndTouchEndBlocking) {
GetEventListenerProperties(cc::EventListenerClass::kTouchEndOrCancel))
.WillOnce(testing::Return(cc::EventListenerProperties::kBlocking));
EXPECT_CALL(mock_input_handler_, DoTouchEventsBlockScrollAt(testing::_))
- .WillOnce(testing::Return(false));
+ .WillOnce(
+ testing::Return(cc::InputHandler::TouchStartHitResult::HANDLER));
WebTouchEvent touch;
touch.type = WebInputEvent::TouchStart;
« cc/trees/layer_tree_host_impl.cc ('K') | « ui/events/blink/input_handler_proxy_client.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698