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 "content/shell/renderer/webkit_test_runner.h" | 5 #include "content/shell/renderer/webkit_test_runner.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <clocale> | 8 #include <clocale> |
9 #include <cmath> | 9 #include <cmath> |
10 | 10 |
11 #include "base/base64.h" | 11 #include "base/base64.h" |
12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
13 #include "base/debug/debugger.h" | 13 #include "base/debug/debugger.h" |
14 #include "base/files/file_path.h" | 14 #include "base/files/file_path.h" |
15 #include "base/md5.h" | 15 #include "base/md5.h" |
16 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
17 #include "base/message_loop/message_loop.h" | 17 #include "base/message_loop/message_loop.h" |
18 #include "base/strings/string_util.h" | 18 #include "base/strings/string_util.h" |
19 #include "base/strings/stringprintf.h" | 19 #include "base/strings/stringprintf.h" |
20 #include "base/strings/sys_string_conversions.h" | 20 #include "base/strings/sys_string_conversions.h" |
21 #include "base/strings/utf_string_conversions.h" | 21 #include "base/strings/utf_string_conversions.h" |
22 #include "base/time/time.h" | 22 #include "base/time/time.h" |
23 #include "content/public/common/content_switches.h" | 23 #include "content/public/common/content_switches.h" |
24 #include "content/public/common/url_constants.h" | 24 #include "content/public/common/url_constants.h" |
25 #include "content/public/common/web_preferences.h" | 25 #include "content/public/common/web_preferences.h" |
26 #include "content/public/renderer/render_view.h" | 26 #include "content/public/renderer/render_view.h" |
27 #include "content/public/renderer/render_view_visitor.h" | 27 #include "content/public/renderer/render_view_visitor.h" |
| 28 #include "content/public/renderer/renderer_gamepad_provider.h" |
28 #include "content/public/test/layouttest_support.h" | 29 #include "content/public/test/layouttest_support.h" |
29 #include "content/shell/common/shell_messages.h" | 30 #include "content/shell/common/shell_messages.h" |
30 #include "content/shell/common/shell_switches.h" | 31 #include "content/shell/common/shell_switches.h" |
31 #include "content/shell/common/webkit_test_helpers.h" | 32 #include "content/shell/common/webkit_test_helpers.h" |
32 #include "content/shell/renderer/gc_controller.h" | 33 #include "content/shell/renderer/gc_controller.h" |
33 #include "content/shell/renderer/leak_detector.h" | 34 #include "content/shell/renderer/leak_detector.h" |
34 #include "content/shell/renderer/shell_render_process_observer.h" | 35 #include "content/shell/renderer/shell_render_process_observer.h" |
35 #include "content/shell/renderer/test_runner/WebTask.h" | 36 #include "content/shell/renderer/test_runner/WebTask.h" |
36 #include "content/shell/renderer/test_runner/WebTestInterfaces.h" | 37 #include "content/shell/renderer/test_runner/WebTestInterfaces.h" |
37 #include "content/shell/renderer/test_runner/mock_screen_orientation_client.h" | 38 #include "content/shell/renderer/test_runner/mock_screen_orientation_client.h" |
(...skipping 28 matching lines...) Expand all Loading... |
66 #include "ui/gfx/rect.h" | 67 #include "ui/gfx/rect.h" |
67 | 68 |
68 using blink::Platform; | 69 using blink::Platform; |
69 using blink::WebArrayBufferView; | 70 using blink::WebArrayBufferView; |
70 using blink::WebContextMenuData; | 71 using blink::WebContextMenuData; |
71 using blink::WebDevToolsAgent; | 72 using blink::WebDevToolsAgent; |
72 using blink::WebDeviceMotionData; | 73 using blink::WebDeviceMotionData; |
73 using blink::WebDeviceOrientationData; | 74 using blink::WebDeviceOrientationData; |
74 using blink::WebElement; | 75 using blink::WebElement; |
75 using blink::WebLocalFrame; | 76 using blink::WebLocalFrame; |
76 using blink::WebGamepads; | |
77 using blink::WebHistoryItem; | 77 using blink::WebHistoryItem; |
78 using blink::WebLocalFrame; | 78 using blink::WebLocalFrame; |
79 using blink::WebPoint; | 79 using blink::WebPoint; |
80 using blink::WebRect; | 80 using blink::WebRect; |
81 using blink::WebScriptSource; | 81 using blink::WebScriptSource; |
82 using blink::WebSize; | 82 using blink::WebSize; |
83 using blink::WebString; | 83 using blink::WebString; |
84 using blink::WebURL; | 84 using blink::WebURL; |
85 using blink::WebURLError; | 85 using blink::WebURLError; |
86 using blink::WebURLRequest; | 86 using blink::WebURLRequest; |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 void WebKitTestRunner::clearEditCommand() { | 196 void WebKitTestRunner::clearEditCommand() { |
197 render_view()->ClearEditCommands(); | 197 render_view()->ClearEditCommands(); |
198 } | 198 } |
199 | 199 |
200 void WebKitTestRunner::setEditCommand(const std::string& name, | 200 void WebKitTestRunner::setEditCommand(const std::string& name, |
201 const std::string& value) { | 201 const std::string& value) { |
202 render_view()->SetEditCommandForNextKeyEvent(name, value); | 202 render_view()->SetEditCommandForNextKeyEvent(name, value); |
203 } | 203 } |
204 | 204 |
205 void WebKitTestRunner::setGamepadProvider( | 205 void WebKitTestRunner::setGamepadProvider( |
206 RendererGamepadProvider* provider) { | 206 scoped_ptr<RendererGamepadProvider> provider) { |
207 SetMockGamepadProvider(provider); | 207 SetMockGamepadProvider(provider.Pass()); |
208 } | 208 } |
209 | 209 |
210 void WebKitTestRunner::setDeviceLightData(const double data) { | 210 void WebKitTestRunner::setDeviceLightData(const double data) { |
211 SetMockDeviceLightData(data); | 211 SetMockDeviceLightData(data); |
212 } | 212 } |
213 | 213 |
214 void WebKitTestRunner::setDeviceMotionData(const WebDeviceMotionData& data) { | 214 void WebKitTestRunner::setDeviceMotionData(const WebDeviceMotionData& data) { |
215 SetMockDeviceMotionData(data); | 215 SetMockDeviceMotionData(data); |
216 } | 216 } |
217 | 217 |
(...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
742 | 742 |
743 leak_detector_->TryLeakDetection(main_frame); | 743 leak_detector_->TryLeakDetection(main_frame); |
744 } | 744 } |
745 | 745 |
746 void WebKitTestRunner::ReportLeakDetectionResult( | 746 void WebKitTestRunner::ReportLeakDetectionResult( |
747 const LeakDetectionResult& report) { | 747 const LeakDetectionResult& report) { |
748 Send(new ShellViewHostMsg_LeakDetectionDone(routing_id(), report)); | 748 Send(new ShellViewHostMsg_LeakDetectionDone(routing_id(), report)); |
749 } | 749 } |
750 | 750 |
751 } // namespace content | 751 } // namespace content |
OLD | NEW |