| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/renderer/input/input_handler_proxy.h" | 5 #include "content/renderer/input/input_handler_proxy.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "cc/base/swap_promise_monitor.h" | 9 #include "cc/base/swap_promise_monitor.h" |
| 10 #include "content/renderer/input/input_handler_proxy_client.h" | 10 #include "content/renderer/input/input_handler_proxy_client.h" |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 virtual void DidStopFlinging() OVERRIDE {} | 134 virtual void DidStopFlinging() OVERRIDE {} |
| 135 | 135 |
| 136 private: | 136 private: |
| 137 DISALLOW_COPY_AND_ASSIGN(MockInputHandlerProxyClient); | 137 DISALLOW_COPY_AND_ASSIGN(MockInputHandlerProxyClient); |
| 138 }; | 138 }; |
| 139 | 139 |
| 140 WebTouchPoint CreateWebTouchPoint(WebTouchPoint::State state, float x, | 140 WebTouchPoint CreateWebTouchPoint(WebTouchPoint::State state, float x, |
| 141 float y) { | 141 float y) { |
| 142 WebTouchPoint point; | 142 WebTouchPoint point; |
| 143 point.state = state; | 143 point.state = state; |
| 144 point.screenPosition.x = x; | 144 point.screenPosition = WebFloatPoint(x, y); |
| 145 point.screenPosition.y = y; | 145 point.position = WebFloatPoint(x, y); |
| 146 point.position.x = x; | |
| 147 point.position.y = y; | |
| 148 return point; | 146 return point; |
| 149 } | 147 } |
| 150 | 148 |
| 151 class InputHandlerProxyTest : public testing::Test { | 149 class InputHandlerProxyTest : public testing::Test { |
| 152 public: | 150 public: |
| 153 InputHandlerProxyTest() | 151 InputHandlerProxyTest() |
| 154 : expected_disposition_(InputHandlerProxy::DID_HANDLE) { | 152 : expected_disposition_(InputHandlerProxy::DID_HANDLE) { |
| 155 input_handler_.reset( | 153 input_handler_.reset( |
| 156 new content::InputHandlerProxy(&mock_input_handler_)); | 154 new content::InputHandlerProxy(&mock_input_handler_)); |
| 157 input_handler_->SetClient(&mock_client_); | 155 input_handler_->SetClient(&mock_client_); |
| (...skipping 1065 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1223 | 1221 |
| 1224 touch.touchesLength = 3; | 1222 touch.touchesLength = 3; |
| 1225 touch.touches[0] = CreateWebTouchPoint(WebTouchPoint::StatePressed, 0, 0); | 1223 touch.touches[0] = CreateWebTouchPoint(WebTouchPoint::StatePressed, 0, 0); |
| 1226 touch.touches[1] = CreateWebTouchPoint(WebTouchPoint::StatePressed, 10, 10); | 1224 touch.touches[1] = CreateWebTouchPoint(WebTouchPoint::StatePressed, 10, 10); |
| 1227 touch.touches[2] = CreateWebTouchPoint(WebTouchPoint::StatePressed, -10, 10); | 1225 touch.touches[2] = CreateWebTouchPoint(WebTouchPoint::StatePressed, -10, 10); |
| 1228 EXPECT_EQ(expected_disposition_, input_handler_->HandleInputEvent(touch)); | 1226 EXPECT_EQ(expected_disposition_, input_handler_->HandleInputEvent(touch)); |
| 1229 } | 1227 } |
| 1230 | 1228 |
| 1231 } // namespace | 1229 } // namespace |
| 1232 } // namespace content | 1230 } // namespace content |
| OLD | NEW |