| 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/common/input/did_overscroll_params.h" | 10 #include "content/common/input/did_overscroll_params.h" |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 TEST_F(InputHandlerProxyTest, MouseWheelByPageMainThread) { | 281 TEST_F(InputHandlerProxyTest, MouseWheelByPageMainThread) { |
| 282 expected_disposition_ = InputHandlerProxy::DID_NOT_HANDLE; | 282 expected_disposition_ = InputHandlerProxy::DID_NOT_HANDLE; |
| 283 WebMouseWheelEvent wheel; | 283 WebMouseWheelEvent wheel; |
| 284 wheel.type = WebInputEvent::MouseWheel; | 284 wheel.type = WebInputEvent::MouseWheel; |
| 285 wheel.scrollByPage = true; | 285 wheel.scrollByPage = true; |
| 286 | 286 |
| 287 EXPECT_EQ(expected_disposition_, input_handler_->HandleInputEvent(wheel)); | 287 EXPECT_EQ(expected_disposition_, input_handler_->HandleInputEvent(wheel)); |
| 288 testing::Mock::VerifyAndClearExpectations(&mock_client_); | 288 testing::Mock::VerifyAndClearExpectations(&mock_client_); |
| 289 } | 289 } |
| 290 | 290 |
| 291 TEST_F(InputHandlerProxyTest, MouseWheelWithCtrlNotScroll) { | 291 TEST_F(InputHandlerProxyTest, MouseWheelWithCtrl) { |
| 292 expected_disposition_ = InputHandlerProxy::DID_NOT_HANDLE; | 292 expected_disposition_ = InputHandlerProxy::DID_NOT_HANDLE; |
| 293 WebMouseWheelEvent wheel; | 293 WebMouseWheelEvent wheel; |
| 294 wheel.type = WebInputEvent::MouseWheel; | 294 wheel.type = WebInputEvent::MouseWheel; |
| 295 wheel.modifiers = WebInputEvent::ControlKey; | 295 wheel.modifiers = WebInputEvent::ControlKey; |
| 296 wheel.canScroll = false; | 296 |
| 297 EXPECT_EQ(expected_disposition_, input_handler_->HandleInputEvent(wheel)); | 297 EXPECT_EQ(expected_disposition_, input_handler_->HandleInputEvent(wheel)); |
| 298 testing::Mock::VerifyAndClearExpectations(&mock_client_); | 298 testing::Mock::VerifyAndClearExpectations(&mock_client_); |
| 299 } | 299 } |
| 300 | 300 |
| 301 TEST_F(InputHandlerProxyTest, GestureScrollStarted) { | 301 TEST_F(InputHandlerProxyTest, GestureScrollStarted) { |
| 302 // We shouldn't send any events to the widget for this gesture. | 302 // We shouldn't send any events to the widget for this gesture. |
| 303 expected_disposition_ = InputHandlerProxy::DID_HANDLE; | 303 expected_disposition_ = InputHandlerProxy::DID_HANDLE; |
| 304 VERIFY_AND_RESET_MOCKS(); | 304 VERIFY_AND_RESET_MOCKS(); |
| 305 | 305 |
| 306 EXPECT_CALL(mock_input_handler_, ScrollBegin(testing::_, testing::_)) | 306 EXPECT_CALL(mock_input_handler_, ScrollBegin(testing::_, testing::_)) |
| (...skipping 1778 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2085 EXPECT_CALL(mock_input_handler_, SetNeedsAnimate()); | 2085 EXPECT_CALL(mock_input_handler_, SetNeedsAnimate()); |
| 2086 EXPECT_CALL(mock_client, DidAnimateForInput()); | 2086 EXPECT_CALL(mock_client, DidAnimateForInput()); |
| 2087 base::TimeTicks time = base::TimeTicks() + base::TimeDelta::FromSeconds(10); | 2087 base::TimeTicks time = base::TimeTicks() + base::TimeDelta::FromSeconds(10); |
| 2088 input_handler_->Animate(time); | 2088 input_handler_->Animate(time); |
| 2089 | 2089 |
| 2090 testing::Mock::VerifyAndClearExpectations(&mock_client); | 2090 testing::Mock::VerifyAndClearExpectations(&mock_client); |
| 2091 } | 2091 } |
| 2092 | 2092 |
| 2093 } // namespace | 2093 } // namespace |
| 2094 } // namespace content | 2094 } // namespace content |
| OLD | NEW |