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

Unified Diff: content/renderer/input/input_handler_proxy_unittest.cc

Issue 557403002: InputHandlerProxy to inform blink scheduler of input events (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added a test Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
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 a2da06c0209d505c9350c3bf3854d6acb74d7934..6f4480ca0354c0f502c16acfc76833b7e75c2bfd 100644
--- a/content/renderer/input/input_handler_proxy_unittest.cc
+++ b/content/renderer/input/input_handler_proxy_unittest.cc
@@ -179,11 +179,24 @@ class MockInputHandlerProxyClient
MOCK_METHOD1(DidOverscroll, void(const DidOverscrollParams&));
virtual void DidStopFlinging() OVERRIDE {}
+ virtual void DidReceiveInputEvent() OVERRIDE {}
private:
DISALLOW_COPY_AND_ASSIGN(MockInputHandlerProxyClient);
};
+class MockInputHandlerProxyClientWithDidReceiveInputEvent
+ : public MockInputHandlerProxyClient {
+ public:
+ MockInputHandlerProxyClientWithDidReceiveInputEvent() {}
+ virtual ~MockInputHandlerProxyClientWithDidReceiveInputEvent() {}
+
+ MOCK_METHOD0(DidReceiveInputEvent, void());
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(MockInputHandlerProxyClientWithDidReceiveInputEvent);
+};
+
WebTouchPoint CreateWebTouchPoint(WebTouchPoint::State state, float x,
float y) {
WebTouchPoint point;
@@ -1935,5 +1948,22 @@ TEST_F(InputHandlerProxyTest, FlingBoostTerminatedDuringScrollSequence) {
VERIFY_AND_RESET_MOCKS();
}
+TEST_F(InputHandlerProxyTest, DidReceiveInputEvent) {
+ testing::StrictMock<
+ MockInputHandlerProxyClientWithDidReceiveInputEvent> mock_client;
+ input_handler_.reset(
+ new content::InputHandlerProxy(&mock_input_handler_, &mock_client));
+
+ // Note the type of input event isn't important.
+ WebMouseWheelEvent wheel;
+ wheel.type = WebInputEvent::MouseWheel;
+ wheel.scrollByPage = true;
+
+ EXPECT_CALL(mock_client, DidReceiveInputEvent());
+
+ input_handler_->HandleInputEvent(wheel);
+ testing::Mock::VerifyAndClearExpectations(&mock_client);
+}
+
} // namespace
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698