OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/auto_reset.h" | 5 #include "base/auto_reset.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/run_loop.h" | 8 #include "base/run_loop.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "content/browser/renderer_host/input/synthetic_gesture.h" | 10 #include "content/browser/renderer_host/input/synthetic_gesture.h" |
11 #include "content/browser/renderer_host/input/synthetic_gesture_controller.h" | 11 #include "content/browser/renderer_host/input/synthetic_gesture_controller.h" |
12 #include "content/browser/renderer_host/input/synthetic_gesture_target.h" | 12 #include "content/browser/renderer_host/input/synthetic_gesture_target.h" |
13 #include "content/browser/renderer_host/input/synthetic_smooth_scroll_gesture.h" | 13 #include "content/browser/renderer_host/input/synthetic_smooth_scroll_gesture.h" |
14 #include "content/browser/renderer_host/input/touch_event_queue.h" | 14 #include "content/browser/renderer_host/input/touch_event_queue.h" |
15 #include "content/browser/renderer_host/render_widget_host_impl.h" | 15 #include "content/browser/renderer_host/render_widget_host_impl.h" |
16 #include "content/browser/web_contents/web_contents_impl.h" | 16 #include "content/browser/web_contents/web_contents_impl.h" |
17 #include "content/common/input/synthetic_gesture_params.h" | 17 #include "content/common/input/synthetic_gesture_params.h" |
18 #include "content/common/input/synthetic_smooth_scroll_gesture_params.h" | 18 #include "content/common/input/synthetic_smooth_scroll_gesture_params.h" |
19 #include "content/common/input_messages.h" | 19 #include "content/common/input_messages.h" |
20 #include "content/port/browser/render_widget_host_view_port.h" | 20 #include "content/port/browser/render_widget_host_view_port.h" |
21 #include "content/public/browser/render_view_host.h" | 21 #include "content/public/browser/render_view_host.h" |
22 #include "content/public/browser/render_widget_host_view.h" | 22 #include "content/public/browser/render_widget_host_view.h" |
23 #include "content/public/common/content_switches.h" | 23 #include "content/public/common/content_switches.h" |
24 #include "content/public/test/browser_test_utils.h" | 24 #include "content/public/test/browser_test_utils.h" |
| 25 #include "content/public/test/content_browser_test.h" |
| 26 #include "content/public/test/content_browser_test_utils.h" |
25 #include "content/public/test/test_utils.h" | 27 #include "content/public/test/test_utils.h" |
26 #include "content/shell/browser/shell.h" | 28 #include "content/shell/browser/shell.h" |
27 #include "content/test/content_browser_test.h" | |
28 #include "content/test/content_browser_test_utils.h" | |
29 #include "third_party/WebKit/public/web/WebInputEvent.h" | 29 #include "third_party/WebKit/public/web/WebInputEvent.h" |
30 #include "ui/events/event_switches.h" | 30 #include "ui/events/event_switches.h" |
31 #include "ui/events/latency_info.h" | 31 #include "ui/events/latency_info.h" |
32 | 32 |
33 using blink::WebInputEvent; | 33 using blink::WebInputEvent; |
34 | 34 |
35 namespace { | 35 namespace { |
36 | 36 |
37 const char kTouchActionDataURL[] = | 37 const char kTouchActionDataURL[] = |
38 "data:text/html;charset=utf-8," | 38 "data:text/html;charset=utf-8," |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 bool scrolled = DoTouchScroll(gfx::Point(50, 150), gfx::Vector2d(0, 45)); | 197 bool scrolled = DoTouchScroll(gfx::Point(50, 150), gfx::Vector2d(0, 45)); |
198 EXPECT_FALSE(scrolled); | 198 EXPECT_FALSE(scrolled); |
199 | 199 |
200 EXPECT_EQ(1, ExecuteScriptAndExtractInt("eventCounts.touchstart")); | 200 EXPECT_EQ(1, ExecuteScriptAndExtractInt("eventCounts.touchstart")); |
201 EXPECT_GT(ExecuteScriptAndExtractInt("eventCounts.touchmove"), 1); | 201 EXPECT_GT(ExecuteScriptAndExtractInt("eventCounts.touchmove"), 1); |
202 EXPECT_EQ(1, ExecuteScriptAndExtractInt("eventCounts.touchend")); | 202 EXPECT_EQ(1, ExecuteScriptAndExtractInt("eventCounts.touchend")); |
203 EXPECT_EQ(0, ExecuteScriptAndExtractInt("eventCounts.touchcancel")); | 203 EXPECT_EQ(0, ExecuteScriptAndExtractInt("eventCounts.touchcancel")); |
204 } | 204 } |
205 | 205 |
206 } // namespace content | 206 } // namespace content |
OLD | NEW |