| 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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
| 6 #include "base/memory/scoped_ptr.h" | 6 #include "base/memory/scoped_ptr.h" |
| 7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #include "content/browser/renderer_host/input/gesture_event_filter.h" | 8 #include "content/browser/renderer_host/input/gesture_event_filter.h" |
| 9 #include "content/browser/renderer_host/input/immediate_input_router.h" | 9 #include "content/browser/renderer_host/input/immediate_input_router.h" |
| 10 #include "content/browser/renderer_host/input/input_router_client.h" | 10 #include "content/browser/renderer_host/input/input_router_client.h" |
| (...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 | 355 |
| 356 input_router_.reset(); | 356 input_router_.reset(); |
| 357 client_.reset(); | 357 client_.reset(); |
| 358 process_.reset(); | 358 process_.reset(); |
| 359 browser_context_.reset(); | 359 browser_context_.reset(); |
| 360 } | 360 } |
| 361 | 361 |
| 362 void SendInputEventACK(WebInputEvent::Type type, | 362 void SendInputEventACK(WebInputEvent::Type type, |
| 363 InputEventAckState ack_result) { | 363 InputEventAckState ack_result) { |
| 364 scoped_ptr<IPC::Message> response( | 364 scoped_ptr<IPC::Message> response( |
| 365 new InputHostMsg_HandleInputEvent_ACK(0, type, ack_result)); | 365 new InputHostMsg_HandleInputEvent_ACK(0, type, ack_result, |
| 366 ui::LatencyInfo())); |
| 366 input_router_->OnMessageReceived(*response); | 367 input_router_->OnMessageReceived(*response); |
| 367 } | 368 } |
| 368 | 369 |
| 369 void SimulateKeyboardEvent(WebInputEvent::Type type) { | 370 void SimulateKeyboardEvent(WebInputEvent::Type type) { |
| 370 NativeWebKeyboardEvent key_event; | 371 NativeWebKeyboardEvent key_event; |
| 371 key_event.type = type; | 372 key_event.type = type; |
| 372 key_event.windowsKeyCode = ui::VKEY_L; // non-null made up value. | 373 key_event.windowsKeyCode = ui::VKEY_L; // non-null made up value. |
| 373 input_router_->SendKeyboardEvent(key_event, ui::LatencyInfo()); | 374 input_router_->SendKeyboardEvent(key_event, ui::LatencyInfo()); |
| 374 client_->ExpectSendCalled(true); | 375 client_->ExpectSendCalled(true); |
| 375 EXPECT_EQ(type, client_->sent_key_event().type); | 376 EXPECT_EQ(type, client_->sent_key_event().type); |
| (...skipping 1782 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2158 EXPECT_EQ(1U, process_->sink().message_count()); | 2159 EXPECT_EQ(1U, process_->sink().message_count()); |
| 2159 EXPECT_TRUE(process_->sink().GetUniqueMessageMatching( | 2160 EXPECT_TRUE(process_->sink().GetUniqueMessageMatching( |
| 2160 InputMsg_HandleInputEvent::ID)); | 2161 InputMsg_HandleInputEvent::ID)); |
| 2161 process_->sink().ClearMessages(); | 2162 process_->sink().ClearMessages(); |
| 2162 | 2163 |
| 2163 // Check that the correct unhandled wheel event was received. | 2164 // Check that the correct unhandled wheel event was received. |
| 2164 EXPECT_EQ(client_->acked_wheel_event().deltaY, -5); | 2165 EXPECT_EQ(client_->acked_wheel_event().deltaY, -5); |
| 2165 } | 2166 } |
| 2166 | 2167 |
| 2167 } // namespace content | 2168 } // namespace content |
| OLD | NEW |