| 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_ack_handler.h" | 5 #include "content/browser/renderer_host/input/mock_input_ack_handler.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 "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
| 9 | 9 |
| 10 using base::TimeDelta; | 10 using base::TimeDelta; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 ack_event_type_(WebInputEvent::Undefined), | 24 ack_event_type_(WebInputEvent::Undefined), |
| 25 ack_state_(INPUT_EVENT_ACK_STATE_UNKNOWN) { | 25 ack_state_(INPUT_EVENT_ACK_STATE_UNKNOWN) { |
| 26 } | 26 } |
| 27 | 27 |
| 28 MockInputAckHandler::~MockInputAckHandler() {} | 28 MockInputAckHandler::~MockInputAckHandler() {} |
| 29 | 29 |
| 30 void MockInputAckHandler::OnKeyboardEventAck( | 30 void MockInputAckHandler::OnKeyboardEventAck( |
| 31 const NativeWebKeyboardEventWithLatencyInfo& event, | 31 const NativeWebKeyboardEventWithLatencyInfo& event, |
| 32 InputEventAckState ack_result) { | 32 InputEventAckState ack_result) { |
| 33 VLOG(1) << __FUNCTION__ << " called!"; | 33 VLOG(1) << __FUNCTION__ << " called!"; |
| 34 acked_key_event_ = event.event; | 34 acked_key_event_.reset(new NativeWebKeyboardEvent(event.event)); |
| 35 RecordAckCalled(event.event.type, ack_result); | 35 RecordAckCalled(event.event.type, ack_result); |
| 36 } | 36 } |
| 37 | 37 |
| 38 void MockInputAckHandler::OnMouseEventAck( | 38 void MockInputAckHandler::OnMouseEventAck( |
| 39 const MouseEventWithLatencyInfo& event, | 39 const MouseEventWithLatencyInfo& event, |
| 40 InputEventAckState ack_result) { | 40 InputEventAckState ack_result) { |
| 41 VLOG(1) << __FUNCTION__ << " called!"; | 41 VLOG(1) << __FUNCTION__ << " called!"; |
| 42 acked_mouse_event_ = event.event; | 42 acked_mouse_event_ = event.event; |
| 43 RecordAckCalled(event.event.type, ack_result); | 43 RecordAckCalled(event.event.type, ack_result); |
| 44 } | 44 } |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 } | 83 } |
| 84 | 84 |
| 85 void MockInputAckHandler::RecordAckCalled(blink::WebInputEvent::Type type, | 85 void MockInputAckHandler::RecordAckCalled(blink::WebInputEvent::Type type, |
| 86 InputEventAckState ack_result) { | 86 InputEventAckState ack_result) { |
| 87 ack_event_type_ = type; | 87 ack_event_type_ = type; |
| 88 ++ack_count_; | 88 ++ack_count_; |
| 89 ack_state_ = ack_result; | 89 ack_state_ = ack_result; |
| 90 } | 90 } |
| 91 | 91 |
| 92 } // namespace content | 92 } // namespace content |
| OLD | NEW |