| 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/browser/renderer_host/input/mock_input_router_client.h" | 5 #include "content/browser/renderer_host/input/mock_input_router_client.h" |
| 6 | 6 |
| 7 #include "content/browser/renderer_host/input/input_router.h" | 7 #include "content/browser/renderer_host/input/input_router.h" |
| 8 #include "content/common/input/input_event.h" | 8 #include "content/common/input/input_event.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 | 10 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 | 43 |
| 44 void MockInputRouterClient::DecrementInFlightEventCount() { | 44 void MockInputRouterClient::DecrementInFlightEventCount() { |
| 45 --in_flight_event_count_; | 45 --in_flight_event_count_; |
| 46 } | 46 } |
| 47 | 47 |
| 48 void MockInputRouterClient::OnHasTouchEventHandlers( | 48 void MockInputRouterClient::OnHasTouchEventHandlers( |
| 49 bool has_handlers) { | 49 bool has_handlers) { |
| 50 has_touch_handler_ = has_handlers; | 50 has_touch_handler_ = has_handlers; |
| 51 } | 51 } |
| 52 | 52 |
| 53 void MockInputRouterClient::DidFlush() { | 53 void MockInputRouterClient::SetNeedsFlushInput() {} |
| 54 |
| 55 void MockInputRouterClient::DidFlushAllInput() { |
| 54 ++did_flush_called_count_; | 56 ++did_flush_called_count_; |
| 55 } | 57 } |
| 56 | 58 |
| 57 void MockInputRouterClient::DidOverscroll(const DidOverscrollParams& params) { | 59 void MockInputRouterClient::DidOverscroll(const DidOverscrollParams& params) { |
| 58 overscroll_ = params; | 60 overscroll_ = params; |
| 59 } | 61 } |
| 60 | 62 |
| 61 void MockInputRouterClient::DidStopFlinging() { | 63 void MockInputRouterClient::DidStopFlinging() { |
| 62 } | 64 } |
| 63 | 65 |
| 64 bool MockInputRouterClient::GetAndResetFilterEventCalled() { | 66 bool MockInputRouterClient::GetAndResetFilterEventCalled() { |
| 65 bool filter_input_event_called = filter_input_event_called_; | 67 bool filter_input_event_called = filter_input_event_called_; |
| 66 filter_input_event_called_ = false; | 68 filter_input_event_called_ = false; |
| 67 return filter_input_event_called; | 69 return filter_input_event_called; |
| 68 } | 70 } |
| 69 | 71 |
| 70 size_t MockInputRouterClient::GetAndResetDidFlushCount() { | 72 size_t MockInputRouterClient::GetAndResetDidFlushCount() { |
| 71 size_t did_flush_called_count = did_flush_called_count_; | 73 size_t did_flush_called_count = did_flush_called_count_; |
| 72 did_flush_called_count_ = 0; | 74 did_flush_called_count_ = 0; |
| 73 return did_flush_called_count; | 75 return did_flush_called_count; |
| 74 } | 76 } |
| 75 | 77 |
| 76 DidOverscrollParams MockInputRouterClient::GetAndResetOverscroll() { | 78 DidOverscrollParams MockInputRouterClient::GetAndResetOverscroll() { |
| 77 DidOverscrollParams overscroll; | 79 DidOverscrollParams overscroll; |
| 78 std::swap(overscroll_, overscroll); | 80 std::swap(overscroll_, overscroll); |
| 79 return overscroll; | 81 return overscroll; |
| 80 } | 82 } |
| 81 | 83 |
| 82 } // namespace content | 84 } // namespace content |
| OLD | NEW |