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 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 #include "webkit/base/file_path_string_conversions.h" | 58 #include "webkit/base/file_path_string_conversions.h" |
59 #include "webkit/glue/glue_serialize.h" | 59 #include "webkit/glue/glue_serialize.h" |
60 #include "webkit/glue/webkit_glue.h" | 60 #include "webkit/glue/webkit_glue.h" |
61 #include "webkit/glue/webpreferences.h" | 61 #include "webkit/glue/webpreferences.h" |
62 #include "webkit/mocks/test_media_stream_client.h" | 62 #include "webkit/mocks/test_media_stream_client.h" |
63 | 63 |
64 using WebKit::Platform; | 64 using WebKit::Platform; |
65 using WebKit::WebArrayBufferView; | 65 using WebKit::WebArrayBufferView; |
66 using WebKit::WebContextMenuData; | 66 using WebKit::WebContextMenuData; |
67 using WebKit::WebDevToolsAgent; | 67 using WebKit::WebDevToolsAgent; |
| 68 using WebKit::WebDeviceMotionListener; |
68 using WebKit::WebDeviceOrientation; | 69 using WebKit::WebDeviceOrientation; |
69 using WebKit::WebElement; | 70 using WebKit::WebElement; |
70 using WebKit::WebFrame; | 71 using WebKit::WebFrame; |
71 using WebKit::WebGamepads; | 72 using WebKit::WebGamepads; |
72 using WebKit::WebHistoryItem; | 73 using WebKit::WebHistoryItem; |
73 using WebKit::WebMediaPlayer; | 74 using WebKit::WebMediaPlayer; |
74 using WebKit::WebMediaPlayerClient; | 75 using WebKit::WebMediaPlayerClient; |
75 using WebKit::WebPoint; | 76 using WebKit::WebPoint; |
76 using WebKit::WebRect; | 77 using WebKit::WebRect; |
77 using WebKit::WebScriptSource; | 78 using WebKit::WebScriptSource; |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 | 206 |
206 void WebKitTestRunner::setEditCommand(const std::string& name, | 207 void WebKitTestRunner::setEditCommand(const std::string& name, |
207 const std::string& value) { | 208 const std::string& value) { |
208 render_view()->SetEditCommandForNextKeyEvent(name, value); | 209 render_view()->SetEditCommandForNextKeyEvent(name, value); |
209 } | 210 } |
210 | 211 |
211 void WebKitTestRunner::setGamepadData(const WebGamepads& gamepads) { | 212 void WebKitTestRunner::setGamepadData(const WebGamepads& gamepads) { |
212 SetMockGamepads(gamepads); | 213 SetMockGamepads(gamepads); |
213 } | 214 } |
214 | 215 |
| 216 void WebKitTestRunner::setDeviceMotionListener( |
| 217 WebDeviceMotionListener* listener) { |
| 218 SetMockDeviceMotionListener(listener); |
| 219 } |
| 220 |
215 void WebKitTestRunner::printMessage(const std::string& message) { | 221 void WebKitTestRunner::printMessage(const std::string& message) { |
216 Send(new ShellViewHostMsg_PrintMessage(routing_id(), message)); | 222 Send(new ShellViewHostMsg_PrintMessage(routing_id(), message)); |
217 } | 223 } |
218 | 224 |
219 void WebKitTestRunner::postTask(WebTask* task) { | 225 void WebKitTestRunner::postTask(WebTask* task) { |
220 Platform::current()->callOnMainThread(InvokeTaskHelper, task); | 226 Platform::current()->callOnMainThread(InvokeTaskHelper, task); |
221 } | 227 } |
222 | 228 |
223 void WebKitTestRunner::postDelayedTask(WebTask* task, long long ms) { | 229 void WebKitTestRunner::postDelayedTask(WebTask* task, long long ms) { |
224 base::MessageLoop::current()->PostDelayedTask( | 230 base::MessageLoop::current()->PostDelayedTask( |
(...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
698 ->loadRequest(WebURLRequest(GURL("about:blank"))); | 704 ->loadRequest(WebURLRequest(GURL("about:blank"))); |
699 Send(new ShellViewHostMsg_ResetDone(routing_id())); | 705 Send(new ShellViewHostMsg_ResetDone(routing_id())); |
700 } | 706 } |
701 | 707 |
702 void WebKitTestRunner::OnNotifyDone() { | 708 void WebKitTestRunner::OnNotifyDone() { |
703 render_view()->GetWebView()->mainFrame()->executeScript( | 709 render_view()->GetWebView()->mainFrame()->executeScript( |
704 WebScriptSource(WebString::fromUTF8("testRunner.notifyDone();"))); | 710 WebScriptSource(WebString::fromUTF8("testRunner.notifyDone();"))); |
705 } | 711 } |
706 | 712 |
707 } // namespace content | 713 } // namespace content |
OLD | NEW |