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/input_router_impl.h" | 5 #include "content/browser/renderer_host/input/input_router_impl.h" |
6 | 6 |
7 #include <math.h> | 7 #include <math.h> |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
11 #include <memory> | 11 #include <memory> |
12 #include <tuple> | 12 #include <tuple> |
13 | 13 |
14 #include "base/command_line.h" | 14 #include "base/command_line.h" |
15 #include "base/location.h" | 15 #include "base/location.h" |
16 #include "base/macros.h" | 16 #include "base/macros.h" |
17 #include "base/run_loop.h" | 17 #include "base/run_loop.h" |
18 #include "base/single_thread_task_runner.h" | 18 #include "base/single_thread_task_runner.h" |
19 #include "base/strings/utf_string_conversions.h" | 19 #include "base/strings/utf_string_conversions.h" |
20 #include "base/threading/thread_task_runner_handle.h" | 20 #include "base/threading/thread_task_runner_handle.h" |
21 #include "build/build_config.h" | 21 #include "build/build_config.h" |
22 #include "content/browser/renderer_host/input/gesture_event_queue.h" | 22 #include "content/browser/renderer_host/input/gesture_event_queue.h" |
23 #include "content/browser/renderer_host/input/input_router_client.h" | 23 #include "content/browser/renderer_host/input/input_router_client.h" |
24 #include "content/browser/renderer_host/input/mock_input_ack_handler.h" | 24 #include "content/browser/renderer_host/input/mock_input_ack_handler.h" |
25 #include "content/browser/renderer_host/input/mock_input_router_client.h" | 25 #include "content/browser/renderer_host/input/mock_input_router_client.h" |
26 #include "content/common/content_constants_internal.h" | 26 #include "content/common/content_constants_internal.h" |
27 #include "content/common/edit_command.h" | 27 #include "content/common/edit_command.h" |
28 #include "content/common/input/synthetic_web_input_event_builders.h" | 28 #include "content/common/input/synthetic_web_input_event_builders.h" |
29 #include "content/common/input/touch_action.h" | 29 #include "content/common/input/touch_action.h" |
30 #include "content/common/input/web_input_event_traits.h" | |
31 #include "content/common/input_messages.h" | 30 #include "content/common/input_messages.h" |
32 #include "content/common/view_messages.h" | 31 #include "content/common/view_messages.h" |
33 #include "content/public/common/content_switches.h" | 32 #include "content/public/common/content_switches.h" |
34 #include "content/public/test/mock_render_process_host.h" | 33 #include "content/public/test/mock_render_process_host.h" |
35 #include "content/public/test/test_browser_context.h" | 34 #include "content/public/test/test_browser_context.h" |
36 #include "testing/gtest/include/gtest/gtest.h" | 35 #include "testing/gtest/include/gtest/gtest.h" |
| 36 #include "ui/events/blink/web_input_event_traits.h" |
37 #include "ui/events/keycodes/keyboard_codes.h" | 37 #include "ui/events/keycodes/keyboard_codes.h" |
38 | 38 |
39 #if defined(USE_AURA) | 39 #if defined(USE_AURA) |
40 #include "content/browser/renderer_host/ui_events_helper.h" | 40 #include "content/browser/renderer_host/ui_events_helper.h" |
41 #include "ui/events/event.h" | 41 #include "ui/events/event.h" |
42 #endif | 42 #endif |
43 | 43 |
44 using blink::WebGestureDevice; | 44 using blink::WebGestureDevice; |
45 using blink::WebGestureEvent; | 45 using blink::WebGestureEvent; |
46 using blink::WebKeyboardEvent; | 46 using blink::WebKeyboardEvent; |
47 using blink::WebInputEvent; | 47 using blink::WebInputEvent; |
48 using blink::WebMouseEvent; | 48 using blink::WebMouseEvent; |
49 using blink::WebMouseWheelEvent; | 49 using blink::WebMouseWheelEvent; |
50 using blink::WebTouchEvent; | 50 using blink::WebTouchEvent; |
51 using blink::WebTouchPoint; | 51 using blink::WebTouchPoint; |
52 using ui::DidOverscrollParams; | 52 using ui::DidOverscrollParams; |
| 53 using ui::WebInputEventTraits; |
53 | 54 |
54 namespace content { | 55 namespace content { |
55 | 56 |
56 namespace { | 57 namespace { |
57 | 58 |
58 const WebInputEvent* GetInputEventFromMessage(const IPC::Message& message) { | 59 const WebInputEvent* GetInputEventFromMessage(const IPC::Message& message) { |
59 base::PickleIterator iter(message); | 60 base::PickleIterator iter(message); |
60 const char* data; | 61 const char* data; |
61 int data_length; | 62 int data_length; |
62 if (!iter.ReadData(&data, &data_length)) | 63 if (!iter.ReadData(&data, &data_length)) |
(...skipping 2215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2278 EXPECT_EQ(80, sent_event->data.flingStart.velocityY); | 2279 EXPECT_EQ(80, sent_event->data.flingStart.velocityY); |
2279 | 2280 |
2280 const WebGestureEvent* filter_event = | 2281 const WebGestureEvent* filter_event = |
2281 GetFilterWebInputEvent<WebGestureEvent>(); | 2282 GetFilterWebInputEvent<WebGestureEvent>(); |
2282 TestLocationInFilterEvent(filter_event, orig); | 2283 TestLocationInFilterEvent(filter_event, orig); |
2283 EXPECT_EQ(30, filter_event->data.flingStart.velocityX); | 2284 EXPECT_EQ(30, filter_event->data.flingStart.velocityX); |
2284 EXPECT_EQ(40, filter_event->data.flingStart.velocityY); | 2285 EXPECT_EQ(40, filter_event->data.flingStart.velocityY); |
2285 } | 2286 } |
2286 | 2287 |
2287 } // namespace content | 2288 } // namespace content |
OLD | NEW |