| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
| 6 #include "base/bind.h" | 6 #include "base/bind.h" |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/memory/shared_memory.h" | 9 #include "base/memory/shared_memory.h" |
| 10 #include "base/timer/timer.h" | 10 #include "base/timer/timer.h" |
| (...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 631 // Process all pending tasks to avoid leaks. | 631 // Process all pending tasks to avoid leaks. |
| 632 base::MessageLoop::current()->RunUntilIdle(); | 632 base::MessageLoop::current()->RunUntilIdle(); |
| 633 } | 633 } |
| 634 | 634 |
| 635 int64 GetLatencyComponentId() { | 635 int64 GetLatencyComponentId() { |
| 636 return host_->GetLatencyComponentId(); | 636 return host_->GetLatencyComponentId(); |
| 637 } | 637 } |
| 638 | 638 |
| 639 void SendInputEventACK(WebInputEvent::Type type, | 639 void SendInputEventACK(WebInputEvent::Type type, |
| 640 InputEventAckState ack_result) { | 640 InputEventAckState ack_result) { |
| 641 scoped_ptr<IPC::Message> response( | 641 InputHostMsg_HandleInputEvent_ACK_Params ack; |
| 642 new InputHostMsg_HandleInputEvent_ACK(0, type, ack_result, | 642 ack.type = type; |
| 643 ui::LatencyInfo())); | 643 ack.state = ack_result; |
| 644 host_->OnMessageReceived(*response); | 644 host_->OnMessageReceived(InputHostMsg_HandleInputEvent_ACK(0, ack)); |
| 645 } | 645 } |
| 646 | 646 |
| 647 double GetNextSimulatedEventTimeSeconds() { | 647 double GetNextSimulatedEventTimeSeconds() { |
| 648 last_simulated_event_time_seconds_ += simulated_event_time_delta_seconds_; | 648 last_simulated_event_time_seconds_ += simulated_event_time_delta_seconds_; |
| 649 return last_simulated_event_time_seconds_; | 649 return last_simulated_event_time_seconds_; |
| 650 } | 650 } |
| 651 | 651 |
| 652 void SimulateKeyboardEvent(WebInputEvent::Type type) { | 652 void SimulateKeyboardEvent(WebInputEvent::Type type) { |
| 653 SimulateKeyboardEvent(type, 0); | 653 SimulateKeyboardEvent(type, 0); |
| 654 } | 654 } |
| (...skipping 1979 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2634 | 2634 |
| 2635 // Tests RWHI::ForwardTouchEventWithLatencyInfo(). | 2635 // Tests RWHI::ForwardTouchEventWithLatencyInfo(). |
| 2636 PressTouchPoint(0, 1); | 2636 PressTouchPoint(0, 1); |
| 2637 SendTouchEvent(); | 2637 SendTouchEvent(); |
| 2638 CheckLatencyInfoComponentInMessage( | 2638 CheckLatencyInfoComponentInMessage( |
| 2639 process_, GetLatencyComponentId(), WebInputEvent::TouchStart); | 2639 process_, GetLatencyComponentId(), WebInputEvent::TouchStart); |
| 2640 SendInputEventACK(WebInputEvent::TouchStart, INPUT_EVENT_ACK_STATE_CONSUMED); | 2640 SendInputEventACK(WebInputEvent::TouchStart, INPUT_EVENT_ACK_STATE_CONSUMED); |
| 2641 } | 2641 } |
| 2642 | 2642 |
| 2643 } // namespace content | 2643 } // namespace content |
| OLD | NEW |