Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / content / renderer / input / input_handler_proxy_unittest.cc
index d64288c..49fa56a 100644 (file)
@@ -90,8 +90,9 @@ class MockInputHandler : public cc::InputHandler {
                ScrollStatus(const gfx::Point& viewport_point,
                             const gfx::Vector2dF& scroll_delta));
   MOCK_METHOD2(ScrollBy,
-               bool(const gfx::Point& viewport_point,
-                    const gfx::Vector2dF& scroll_delta));
+               cc::InputHandlerScrollResult(
+                   const gfx::Point& viewport_point,
+                   const gfx::Vector2dF& scroll_delta));
   MOCK_METHOD2(ScrollVerticallyByPage,
                bool(const gfx::Point& viewport_point,
                     cc::ScrollDirection direction));
@@ -99,13 +100,13 @@ class MockInputHandler : public cc::InputHandler {
   MOCK_METHOD0(FlingScrollBegin, cc::InputHandler::ScrollStatus());
 
   virtual scoped_ptr<cc::SwapPromiseMonitor>
-    CreateLatencyInfoSwapPromiseMonitor(ui::LatencyInfo* latency) OVERRIDE {
+    CreateLatencyInfoSwapPromiseMonitor(ui::LatencyInfo* latency) override {
       return scoped_ptr<cc::SwapPromiseMonitor>();
   }
 
-  virtual void BindToClient(cc::InputHandlerClient* client) OVERRIDE {}
+  virtual void BindToClient(cc::InputHandlerClient* client) override {}
 
-  virtual void MouseMoveAt(const gfx::Point& mouse_position) OVERRIDE {}
+  virtual void MouseMoveAt(const gfx::Point& mouse_position) override {}
 
   MOCK_METHOD2(IsCurrentlyScrollingLayerAt,
                bool(const gfx::Point& point,
@@ -115,9 +116,9 @@ class MockInputHandler : public cc::InputHandler {
 
   virtual void SetRootLayerScrollOffsetDelegate(
       cc::LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate)
-      OVERRIDE {}
+      override {}
 
-  virtual void OnRootLayerDelegatedScrollOffsetChanged() OVERRIDE {}
+  virtual void OnRootLayerDelegatedScrollOffsetChanged() override {}
 
   DISALLOW_COPY_AND_ASSIGN(MockInputHandler);
 };
@@ -158,7 +159,7 @@ class MockInputHandlerProxyClient
   MockInputHandlerProxyClient() {}
   virtual ~MockInputHandlerProxyClient() {}
 
-  virtual void WillShutdown() OVERRIDE {}
+  virtual void WillShutdown() override {}
 
   MOCK_METHOD1(TransferActiveWheelFlingAnimation,
                void(const WebActiveWheelFlingParameters&));
@@ -166,15 +167,15 @@ class MockInputHandlerProxyClient
   virtual blink::WebGestureCurve* CreateFlingAnimationCurve(
       WebGestureDevice deviceSource,
       const WebFloatPoint& velocity,
-      const WebSize& cumulative_scroll) OVERRIDE {
+      const WebSize& cumulative_scroll) override {
     return new FakeWebGestureCurve(
         blink::WebFloatSize(velocity.x, velocity.y),
         blink::WebFloatSize(cumulative_scroll.width, cumulative_scroll.height));
   }
 
   MOCK_METHOD1(DidOverscroll, void(const DidOverscrollParams&));
-  virtual void DidStopFlinging() OVERRIDE {}
-  virtual void DidReceiveInputEvent() OVERRIDE {}
+  virtual void DidStopFlinging() override {}
+  virtual void DidReceiveInputEvent() override {}
 
  private:
   DISALLOW_COPY_AND_ASSIGN(MockInputHandlerProxyClient);
@@ -207,6 +208,8 @@ class InputHandlerProxyTest : public testing::Test {
       : expected_disposition_(InputHandlerProxy::DID_HANDLE) {
     input_handler_.reset(
         new content::InputHandlerProxy(&mock_input_handler_, &mock_client_));
+    scroll_result_did_scroll_.did_scroll = true;
+    scroll_result_did_not_scroll_.did_scroll = false;
   }
 
   ~InputHandlerProxyTest() {
@@ -264,8 +267,9 @@ class InputHandlerProxyTest : public testing::Test {
   scoped_ptr<content::InputHandlerProxy> input_handler_;
   testing::StrictMock<MockInputHandlerProxyClient> mock_client_;
   WebGestureEvent gesture_;
-
   InputHandlerProxy::EventDisposition expected_disposition_;
+  cc::InputHandlerScrollResult scroll_result_did_scroll_;
+  cc::InputHandlerScrollResult scroll_result_did_not_scroll_;
 };
 
 TEST_F(InputHandlerProxyTest, MouseWheelByPageMainThread) {
@@ -309,7 +313,7 @@ TEST_F(InputHandlerProxyTest, GestureScrollStarted) {
   EXPECT_CALL(mock_input_handler_,
               ScrollBy(testing::_,
                        testing::Property(&gfx::Vector2dF::y, testing::Gt(0))))
-      .WillOnce(testing::Return(false));
+      .WillOnce(testing::Return(scroll_result_did_not_scroll_));
   EXPECT_EQ(expected_disposition_, input_handler_->HandleInputEvent(gesture_));
 
   // Mark the event as handled if scroll happens.
@@ -322,7 +326,7 @@ TEST_F(InputHandlerProxyTest, GestureScrollStarted) {
   EXPECT_CALL(mock_input_handler_,
               ScrollBy(testing::_,
                        testing::Property(&gfx::Vector2dF::y, testing::Gt(0))))
-      .WillOnce(testing::Return(true));
+      .WillOnce(testing::Return(scroll_result_did_scroll_));
   EXPECT_EQ(expected_disposition_, input_handler_->HandleInputEvent(gesture_));
 
   VERIFY_AND_RESET_MOCKS();
@@ -456,7 +460,7 @@ TEST_F(InputHandlerProxyTest, GesturePinchAfterScrollOnMainThread) {
   EXPECT_CALL(mock_input_handler_,
               ScrollBy(testing::_,
                        testing::Property(&gfx::Vector2dF::y, testing::Gt(0))))
-      .WillOnce(testing::Return(true));
+      .WillOnce(testing::Return(scroll_result_did_scroll_));
   EXPECT_EQ(expected_disposition_, input_handler_->HandleInputEvent(gesture_));
 
   VERIFY_AND_RESET_MOCKS();
@@ -601,7 +605,7 @@ TEST_F(InputHandlerProxyTest, GestureFlingAnimatesTouchpad) {
   EXPECT_CALL(mock_input_handler_,
               ScrollBy(testing::_,
                        testing::Property(&gfx::Vector2dF::x, testing::Lt(0))))
-      .WillOnce(testing::Return(true));
+      .WillOnce(testing::Return(scroll_result_did_scroll_));
   EXPECT_CALL(mock_input_handler_, ScrollEnd());
   time += base::TimeDelta::FromMilliseconds(100);
   input_handler_->Animate(time);
@@ -704,7 +708,7 @@ TEST_F(InputHandlerProxyTest, GestureFlingTransferResetsTouchpad) {
   EXPECT_CALL(mock_input_handler_,
               ScrollBy(testing::_,
                        testing::Property(&gfx::Vector2dF::x, testing::Lt(0))))
-      .WillOnce(testing::Return(true));
+      .WillOnce(testing::Return(scroll_result_did_scroll_));
   EXPECT_CALL(mock_input_handler_, ScrollEnd());
   time += base::TimeDelta::FromMilliseconds(100);
   input_handler_->Animate(time);
@@ -805,7 +809,7 @@ TEST_F(InputHandlerProxyTest, GestureFlingTransferResetsTouchpad) {
   EXPECT_CALL(mock_input_handler_,
               ScrollBy(testing::_,
                        testing::Property(&gfx::Vector2dF::y, testing::Gt(0))))
-      .WillOnce(testing::Return(true));
+      .WillOnce(testing::Return(scroll_result_did_scroll_));
   EXPECT_CALL(mock_input_handler_, ScrollEnd());
   time += base::TimeDelta::FromMilliseconds(100);
   input_handler_->Animate(time);
@@ -977,7 +981,7 @@ TEST_F(InputHandlerProxyTest, GestureFlingAnimatesTouchscreen) {
   EXPECT_CALL(mock_input_handler_,
               ScrollBy(testing::_,
                        testing::Property(&gfx::Vector2dF::x, testing::Lt(0))))
-      .WillOnce(testing::Return(true));
+      .WillOnce(testing::Return(scroll_result_did_scroll_));
   time += base::TimeDelta::FromMilliseconds(100);
   input_handler_->Animate(time);
 
@@ -1031,7 +1035,7 @@ TEST_F(InputHandlerProxyTest, GestureFlingWithValidTimestamp) {
   EXPECT_CALL(mock_input_handler_,
               ScrollBy(testing::_,
                        testing::Property(&gfx::Vector2dF::x, testing::Lt(0))))
-      .WillOnce(testing::Return(true));
+      .WillOnce(testing::Return(scroll_result_did_scroll_));
   time += dt;
   input_handler_->Animate(time);
 
@@ -1094,7 +1098,7 @@ TEST_F(InputHandlerProxyTest, GestureFlingWithInvalidTimestamp) {
   EXPECT_CALL(mock_input_handler_,
               ScrollBy(testing::_,
                        testing::Property(&gfx::Vector2dF::x, testing::Lt(0))))
-      .WillOnce(testing::Return(true));
+      .WillOnce(testing::Return(scroll_result_did_scroll_));
   time += base::TimeDelta::FromMilliseconds(10);
   input_handler_->Animate(time);
 
@@ -1161,7 +1165,7 @@ TEST_F(InputHandlerProxyTest,
   EXPECT_CALL(mock_input_handler_,
               ScrollBy(testing::_,
                        testing::Property(&gfx::Vector2dF::x, testing::Lt(0))))
-      .WillOnce(testing::Return(true));
+      .WillOnce(testing::Return(scroll_result_did_scroll_));
   time += base::TimeDelta::FromMilliseconds(100);
   input_handler_->Animate(time);
 
@@ -1187,10 +1191,10 @@ TEST_F(InputHandlerProxyTest, GestureFlingStopsAtContentEdge) {
   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_input_handler_, SetNeedsAnimate());
   EXPECT_EQ(expected_disposition_, input_handler_->HandleInputEvent(gesture_));
   testing::Mock::VerifyAndClearExpectations(&mock_input_handler_);
 
@@ -1201,35 +1205,48 @@ TEST_F(InputHandlerProxyTest, GestureFlingStopsAtContentEdge) {
   testing::Mock::VerifyAndClearExpectations(&mock_input_handler_);
 
   // The second animate starts scrolling in the positive X and Y directions.
-  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_,
               ScrollBy(testing::_,
                        testing::Property(&gfx::Vector2dF::y, testing::Lt(0))))
-      .WillOnce(testing::Return(true));
+      .WillOnce(testing::Return(scroll_result_did_scroll_));
   EXPECT_CALL(mock_input_handler_, ScrollEnd());
+  EXPECT_CALL(mock_input_handler_, SetNeedsAnimate());
   time += base::TimeDelta::FromMilliseconds(100);
   input_handler_->Animate(time);
   testing::Mock::VerifyAndClearExpectations(&mock_input_handler_);
 
-  // Simulate hitting the bottom content edge.
-  gfx::Vector2dF accumulated_overscroll(0, 100);
-  gfx::Vector2dF latest_overscroll_delta(0, 10);
-  gfx::PointF scroll_point(10, 0);
+  // The third animate overscrolls in the positive Y direction but scrolls
+  // somewhat.
+  cc::InputHandlerScrollResult overscroll;
+  overscroll.did_scroll = true;
+  overscroll.did_overscroll_root = true;
+  overscroll.accumulated_root_overscroll = gfx::Vector2dF(0, 100);
+  overscroll.unused_scroll_delta = gfx::Vector2dF(0, 10);
+  EXPECT_CALL(mock_input_handler_, ScrollBegin(testing::_, testing::_))
+      .WillOnce(testing::Return(cc::InputHandler::ScrollStarted));
+  EXPECT_CALL(mock_input_handler_,
+              ScrollBy(testing::_,
+                       testing::Property(&gfx::Vector2dF::y, testing::Lt(0))))
+      .WillOnce(testing::Return(overscroll));
   EXPECT_CALL(
       mock_client_,
       DidOverscroll(testing::AllOf(
-          testing::Field(&DidOverscrollParams::accumulated_overscroll,
-                         testing::Eq(accumulated_overscroll)),
-          testing::Field(&DidOverscrollParams::latest_overscroll_delta,
-                         testing::Eq(latest_overscroll_delta)),
-          testing::Field(&DidOverscrollParams::current_fling_velocity,
-                         testing::Property(&gfx::Vector2dF::y, testing::Lt(0))),
-          testing::Field(&DidOverscrollParams::causal_event_viewport_point,
-                         testing::Eq(scroll_point)))));
-  input_handler_->DidOverscroll(
-      scroll_point, accumulated_overscroll, latest_overscroll_delta);
+          testing::Field(
+              &DidOverscrollParams::accumulated_overscroll,
+              testing::Eq(overscroll.accumulated_root_overscroll)),
+          testing::Field(
+              &DidOverscrollParams::latest_overscroll_delta,
+              testing::Eq(overscroll.unused_scroll_delta)),
+          testing::Field(
+              &DidOverscrollParams::current_fling_velocity,
+              testing::Property(&gfx::Vector2dF::y, testing::Lt(0))))));
+  EXPECT_CALL(mock_input_handler_, ScrollEnd());
+  EXPECT_CALL(mock_input_handler_, SetNeedsAnimate());
+  time += base::TimeDelta::FromMilliseconds(100);
+  input_handler_->Animate(time);
+  testing::Mock::VerifyAndClearExpectations(&mock_input_handler_);
 
   // The next call to animate will no longer scroll vertically.
   EXPECT_CALL(mock_input_handler_, SetNeedsAnimate());
@@ -1238,7 +1255,7 @@ TEST_F(InputHandlerProxyTest, GestureFlingStopsAtContentEdge) {
   EXPECT_CALL(mock_input_handler_,
               ScrollBy(testing::_,
                        testing::Property(&gfx::Vector2dF::y, testing::Eq(0))))
-      .WillOnce(testing::Return(true));
+      .WillOnce(testing::Return(scroll_result_did_scroll_));
   EXPECT_CALL(mock_input_handler_, ScrollEnd());
   time += base::TimeDelta::FromMilliseconds(100);
   input_handler_->Animate(time);
@@ -1293,7 +1310,7 @@ TEST_F(InputHandlerProxyTest, GestureFlingNotCancelledBySmallTimeDelta) {
   EXPECT_CALL(mock_input_handler_,
               ScrollBy(testing::_,
                        testing::Property(&gfx::Vector2dF::x, testing::Lt(0))))
-      .WillOnce(testing::Return(false));
+      .WillOnce(testing::Return(scroll_result_did_not_scroll_));
   time += base::TimeDelta::FromMicroseconds(5);
   input_handler_->Animate(time);
 
@@ -1314,7 +1331,7 @@ TEST_F(InputHandlerProxyTest, GestureFlingNotCancelledBySmallTimeDelta) {
   EXPECT_CALL(mock_input_handler_,
               ScrollBy(testing::_,
                        testing::Property(&gfx::Vector2dF::x, testing::Lt(1))))
-      .WillOnce(testing::Return(false));
+      .WillOnce(testing::Return(scroll_result_did_not_scroll_));
   time += base::TimeDelta::FromMilliseconds(100);
   input_handler_->Animate(time);
 
@@ -1323,6 +1340,10 @@ TEST_F(InputHandlerProxyTest, GestureFlingNotCancelledBySmallTimeDelta) {
 }
 
 TEST_F(InputHandlerProxyTest, GestureFlingCancelledAfterBothAxesStopScrolling) {
+  cc::InputHandlerScrollResult overscroll;
+  overscroll.did_scroll = true;
+  overscroll.did_overscroll_root = true;
+
   // We shouldn't send any events to the widget for this gesture.
   expected_disposition_ = InputHandlerProxy::DID_HANDLE;
   VERIFY_AND_RESET_MOCKS();
@@ -1357,61 +1378,73 @@ TEST_F(InputHandlerProxyTest, GestureFlingCancelledAfterBothAxesStopScrolling) {
   EXPECT_CALL(mock_input_handler_,
               ScrollBy(testing::_,
                        testing::Property(&gfx::Vector2dF::y, testing::Lt(0))))
-      .WillOnce(testing::Return(true));
+      .WillOnce(testing::Return(scroll_result_did_scroll_));
   time += base::TimeDelta::FromMilliseconds(10);
   input_handler_->Animate(time);
   testing::Mock::VerifyAndClearExpectations(&mock_input_handler_);
 
-  // Simulate hitting the bottom content edge.
-  gfx::Vector2dF accumulated_overscroll(0, 100);
-  gfx::Vector2dF latest_overscroll_delta(0, 100);
-  gfx::PointF scroll_point(10, -50);
+  // The third animate hits the bottom content edge.
+  overscroll.accumulated_root_overscroll = gfx::Vector2dF(0, 100);
+  overscroll.unused_scroll_delta = gfx::Vector2dF(0, 100);
+  EXPECT_CALL(mock_input_handler_,
+              ScrollBy(testing::_,
+                       testing::Property(&gfx::Vector2dF::y, testing::Lt(0))))
+      .WillOnce(testing::Return(overscroll));
   EXPECT_CALL(
       mock_client_,
       DidOverscroll(testing::AllOf(
-          testing::Field(&DidOverscrollParams::accumulated_overscroll,
-                         testing::Eq(accumulated_overscroll)),
-          testing::Field(&DidOverscrollParams::latest_overscroll_delta,
-                         testing::Eq(latest_overscroll_delta)),
-          testing::Field(&DidOverscrollParams::current_fling_velocity,
-                         testing::Property(&gfx::Vector2dF::y, testing::Lt(0))),
-          testing::Field(&DidOverscrollParams::causal_event_viewport_point,
-                         testing::Eq(scroll_point)))));
-  input_handler_->DidOverscroll(
-      scroll_point, accumulated_overscroll, latest_overscroll_delta);
+          testing::Field(
+              &DidOverscrollParams::accumulated_overscroll,
+              testing::Eq(overscroll.accumulated_root_overscroll)),
+          testing::Field(
+              &DidOverscrollParams::latest_overscroll_delta,
+              testing::Eq(overscroll.unused_scroll_delta)),
+          testing::Field(
+              &DidOverscrollParams::current_fling_velocity,
+              testing::Property(&gfx::Vector2dF::y, testing::Lt(0))))));
+  EXPECT_CALL(mock_input_handler_, SetNeedsAnimate());
+  time += base::TimeDelta::FromMilliseconds(10);
+  input_handler_->Animate(time);
+  testing::Mock::VerifyAndClearExpectations(&mock_input_handler_);
 
   // The next call to animate will no longer scroll vertically.
   EXPECT_CALL(mock_input_handler_, SetNeedsAnimate());
   EXPECT_CALL(mock_input_handler_,
               ScrollBy(testing::_,
                        testing::Property(&gfx::Vector2dF::y, testing::Eq(0))))
-      .WillOnce(testing::Return(true));
+      .WillOnce(testing::Return(scroll_result_did_scroll_));
   time += base::TimeDelta::FromMilliseconds(10);
   input_handler_->Animate(time);
   testing::Mock::VerifyAndClearExpectations(&mock_input_handler_);
 
-  // Simulate hitting the right content edge.
-  accumulated_overscroll = gfx::Vector2dF(100, 100);
-  latest_overscroll_delta = gfx::Vector2dF(100, 0);
-  scroll_point = gfx::PointF(50, 0);
+  // The next call will hit the right edge.
+  overscroll.accumulated_root_overscroll = gfx::Vector2dF(100, 100);
+  overscroll.unused_scroll_delta = gfx::Vector2dF(100, 0);
+  EXPECT_CALL(mock_input_handler_,
+              ScrollBy(testing::_,
+                       testing::Property(&gfx::Vector2dF::x, testing::Lt(0))))
+      .WillOnce(testing::Return(overscroll));
   EXPECT_CALL(
       mock_client_,
       DidOverscroll(testing::AllOf(
-          testing::Field(&DidOverscrollParams::accumulated_overscroll,
-                         testing::Eq(accumulated_overscroll)),
-          testing::Field(&DidOverscrollParams::latest_overscroll_delta,
-                         testing::Eq(latest_overscroll_delta)),
-          testing::Field(&DidOverscrollParams::current_fling_velocity,
-                         testing::Property(&gfx::Vector2dF::x, testing::Lt(0))),
-          testing::Field(&DidOverscrollParams::causal_event_viewport_point,
-                         testing::Eq(scroll_point)))));
-  input_handler_->DidOverscroll(
-      scroll_point, accumulated_overscroll, latest_overscroll_delta);
+          testing::Field(
+              &DidOverscrollParams::accumulated_overscroll,
+              testing::Eq(overscroll.accumulated_root_overscroll)),
+          testing::Field(
+              &DidOverscrollParams::latest_overscroll_delta,
+              testing::Eq(overscroll.unused_scroll_delta)),
+          testing::Field(
+              &DidOverscrollParams::current_fling_velocity,
+              testing::Property(&gfx::Vector2dF::x, testing::Lt(0))))));
+  EXPECT_CALL(mock_input_handler_, ScrollEnd());
+  time += base::TimeDelta::FromMilliseconds(10);
+  input_handler_->Animate(time);
+  testing::Mock::VerifyAndClearExpectations(&mock_input_handler_);
+
   // The next call to animate will no longer scroll horizontally or vertically,
   // and the fling should be cancelled.
   EXPECT_CALL(mock_input_handler_, SetNeedsAnimate()).Times(0);
   EXPECT_CALL(mock_input_handler_, ScrollBy(testing::_, testing::_)).Times(0);
-  EXPECT_CALL(mock_input_handler_, ScrollEnd());
   time += base::TimeDelta::FromMilliseconds(10);
   input_handler_->Animate(time);
   testing::Mock::VerifyAndClearExpectations(&mock_input_handler_);
@@ -1575,7 +1608,7 @@ TEST_F(InputHandlerProxyTest, GestureFlingWithNegativeTimeDelta) {
   EXPECT_CALL(mock_input_handler_,
               ScrollBy(testing::_,
                        testing::Property(&gfx::Vector2dF::x, testing::Lt(0))))
-      .WillOnce(testing::Return(true));
+      .WillOnce(testing::Return(scroll_result_did_scroll_));
 
   input_handler_->Animate(time + base::TimeDelta::FromMilliseconds(1));
 
@@ -1622,7 +1655,7 @@ TEST_F(InputHandlerProxyTest, FlingBoost) {
               ScrollBy(testing::_,
                        testing::Property(&gfx::Vector2dF::x,
                                          testing::Eq(expected_delta))))
-      .WillOnce(testing::Return(true));
+      .WillOnce(testing::Return(scroll_result_did_scroll_));
   input_handler_->Animate(time);
   last_animate_time = time;
 
@@ -1646,7 +1679,7 @@ TEST_F(InputHandlerProxyTest, FlingBoost) {
               ScrollBy(testing::_,
                        testing::Property(&gfx::Vector2dF::x,
                                          testing::Eq(expected_delta))))
-      .WillOnce(testing::Return(true));
+      .WillOnce(testing::Return(scroll_result_did_scroll_));
   input_handler_->Animate(time);
   last_animate_time = time;
 
@@ -1672,7 +1705,7 @@ TEST_F(InputHandlerProxyTest, FlingBoost) {
               ScrollBy(testing::_,
                        testing::Property(&gfx::Vector2dF::x,
                                          testing::Eq(expected_delta))))
-      .WillOnce(testing::Return(true));
+      .WillOnce(testing::Return(scroll_result_did_scroll_));
   input_handler_->Animate(time);
   last_animate_time = time;
 
@@ -1698,7 +1731,7 @@ TEST_F(InputHandlerProxyTest, FlingBoost) {
               ScrollBy(testing::_,
                        testing::Property(&gfx::Vector2dF::x,
                                          testing::Eq(expected_delta))))
-      .WillOnce(testing::Return(true));
+      .WillOnce(testing::Return(scroll_result_did_scroll_));
   input_handler_->Animate(time);
   last_animate_time = time;
 
@@ -1824,7 +1857,7 @@ TEST_F(InputHandlerProxyTest, NoFlingBoostIfFlingInDifferentDirection) {
               ScrollBy(testing::_,
                        testing::Property(&gfx::Vector2dF::y,
                                          testing::Eq(expected_delta))))
-      .WillOnce(testing::Return(true));
+      .WillOnce(testing::Return(scroll_result_did_scroll_));
   input_handler_->Animate(time);
 
   VERIFY_AND_RESET_MOCKS();
@@ -1869,7 +1902,7 @@ TEST_F(InputHandlerProxyTest, NoFlingBoostIfScrollInDifferentDirection) {
               ScrollBy(testing::_,
                        testing::Property(&gfx::Vector2dF::x,
                                          testing::Eq(fling_delta.x))))
-      .WillOnce(testing::Return(true));
+      .WillOnce(testing::Return(scroll_result_did_scroll_));
   EXPECT_EQ(expected_disposition_, input_handler_->HandleInputEvent(gesture_));
 
   VERIFY_AND_RESET_MOCKS();
@@ -1909,7 +1942,7 @@ TEST_F(InputHandlerProxyTest, NoFlingBoostIfFlingTooSlow) {
               ScrollBy(testing::_,
                        testing::Property(&gfx::Vector2dF::x,
                                          testing::Eq(expected_delta))))
-      .WillOnce(testing::Return(true));
+      .WillOnce(testing::Return(scroll_result_did_scroll_));
   input_handler_->Animate(time);
 
   VERIFY_AND_RESET_MOCKS();
@@ -1951,7 +1984,7 @@ TEST_F(InputHandlerProxyTest, FlingBoostTerminatedDuringScrollSequence) {
               ScrollBy(testing::_,
                        testing::Property(&gfx::Vector2dF::x,
                                          testing::Eq(expected_delta))))
-      .WillOnce(testing::Return(false));
+      .WillOnce(testing::Return(scroll_result_did_not_scroll_));
   EXPECT_CALL(mock_input_handler_, ScrollEnd());
   EXPECT_CALL(mock_input_handler_, ScrollBegin(testing::_, testing::_))
       .WillOnce(testing::Return(cc::InputHandler::ScrollStarted));
@@ -1970,7 +2003,7 @@ TEST_F(InputHandlerProxyTest, FlingBoostTerminatedDuringScrollSequence) {
               ScrollBy(testing::_,
                        testing::Property(&gfx::Vector2dF::x,
                                          testing::Eq(expected_delta))))
-      .WillOnce(testing::Return(true));
+      .WillOnce(testing::Return(scroll_result_did_scroll_));
   EXPECT_EQ(expected_disposition_, input_handler_->HandleInputEvent(gesture_));
 
   VERIFY_AND_RESET_MOCKS();