Index: content/renderer/input/input_handler_proxy_unittest.cc |
diff --git a/content/renderer/input/input_handler_proxy_unittest.cc b/content/renderer/input/input_handler_proxy_unittest.cc |
index 59f3efd206df96454bdd7641e9fd66fb58da9213..10eb56b992ee6c145b049e32c9985e240cdfd056 100644 |
--- a/content/renderer/input/input_handler_proxy_unittest.cc |
+++ b/content/renderer/input/input_handler_proxy_unittest.cc |
@@ -2002,5 +2002,34 @@ TEST_F(InputHandlerProxyTest, DidReceiveInputEvent) { |
testing::Mock::VerifyAndClearExpectations(&mock_client); |
} |
+TEST_F(InputHandlerProxyTest, DidReceiveInputEvent_ForFling) { |
+ testing::StrictMock< |
+ MockInputHandlerProxyClientWithDidReceiveInputEvent> mock_client; |
+ input_handler_.reset( |
+ new content::InputHandlerProxy(&mock_input_handler_, &mock_client)); |
+ |
+ // Both the initial gesture and the animate should call DidReceiveInputEvent. |
+ gesture_.type = WebInputEvent::GestureFlingStart; |
+ WebFloatPoint fling_delta = WebFloatPoint(100, 100); |
+ gesture_.data.flingStart.velocityX = fling_delta.x; |
+ gesture_.data.flingStart.velocityY = fling_delta.y; |
+ EXPECT_CALL(mock_input_handler_, SetNeedsAnimate()); |
+ EXPECT_CALL(mock_input_handler_, ScrollBegin(testing::_, testing::_)) |
+ .WillOnce(testing::Return(cc::InputHandler::ScrollStarted)); |
+ EXPECT_CALL(mock_input_handler_, ScrollEnd()); |
+ EXPECT_CALL(mock_client, DidReceiveInputEvent()); |
+ EXPECT_EQ(InputHandlerProxy::DID_HANDLE, |
+ input_handler_->HandleInputEvent(gesture_)); |
+ testing::Mock::VerifyAndClearExpectations(&mock_input_handler_); |
+ testing::Mock::VerifyAndClearExpectations(&mock_client); |
+ |
+ EXPECT_CALL(mock_input_handler_, SetNeedsAnimate()); |
+ EXPECT_CALL(mock_client, DidReceiveInputEvent()); |
+ base::TimeTicks time = base::TimeTicks() + base::TimeDelta::FromSeconds(10); |
+ input_handler_->Animate(time); |
+ |
+ testing::Mock::VerifyAndClearExpectations(&mock_client); |
+} |
+ |
} // namespace |
} // namespace content |