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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 #include "third_party/WebKit/public/web/WebTestingSupport.h" | 57 #include "third_party/WebKit/public/web/WebTestingSupport.h" |
58 #include "third_party/WebKit/public/web/WebView.h" | 58 #include "third_party/WebKit/public/web/WebView.h" |
59 #include "ui/gfx/rect.h" | 59 #include "ui/gfx/rect.h" |
60 #include "webkit/common/webpreferences.h" | 60 #include "webkit/common/webpreferences.h" |
61 #include "webkit/glue/webkit_glue.h" | 61 #include "webkit/glue/webkit_glue.h" |
62 | 62 |
63 using WebKit::Platform; | 63 using WebKit::Platform; |
64 using WebKit::WebArrayBufferView; | 64 using WebKit::WebArrayBufferView; |
65 using WebKit::WebContextMenuData; | 65 using WebKit::WebContextMenuData; |
66 using WebKit::WebDevToolsAgent; | 66 using WebKit::WebDevToolsAgent; |
| 67 using WebKit::WebDeviceMotionData; |
67 using WebKit::WebDeviceOrientation; | 68 using WebKit::WebDeviceOrientation; |
68 using WebKit::WebElement; | 69 using WebKit::WebElement; |
69 using WebKit::WebFrame; | 70 using WebKit::WebFrame; |
70 using WebKit::WebGamepads; | 71 using WebKit::WebGamepads; |
71 using WebKit::WebHistoryItem; | 72 using WebKit::WebHistoryItem; |
72 using WebKit::WebPoint; | 73 using WebKit::WebPoint; |
73 using WebKit::WebRect; | 74 using WebKit::WebRect; |
74 using WebKit::WebScriptSource; | 75 using WebKit::WebScriptSource; |
75 using WebKit::WebSize; | 76 using WebKit::WebSize; |
76 using WebKit::WebString; | 77 using WebKit::WebString; |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 | 205 |
205 void WebKitTestRunner::setEditCommand(const std::string& name, | 206 void WebKitTestRunner::setEditCommand(const std::string& name, |
206 const std::string& value) { | 207 const std::string& value) { |
207 render_view()->SetEditCommandForNextKeyEvent(name, value); | 208 render_view()->SetEditCommandForNextKeyEvent(name, value); |
208 } | 209 } |
209 | 210 |
210 void WebKitTestRunner::setGamepadData(const WebGamepads& gamepads) { | 211 void WebKitTestRunner::setGamepadData(const WebGamepads& gamepads) { |
211 SetMockGamepads(gamepads); | 212 SetMockGamepads(gamepads); |
212 } | 213 } |
213 | 214 |
| 215 void WebKitTestRunner::setDeviceMotionData(const WebDeviceMotionData& data) { |
| 216 SetMockDeviceMotionData(data); |
| 217 } |
| 218 |
214 void WebKitTestRunner::printMessage(const std::string& message) { | 219 void WebKitTestRunner::printMessage(const std::string& message) { |
215 Send(new ShellViewHostMsg_PrintMessage(routing_id(), message)); | 220 Send(new ShellViewHostMsg_PrintMessage(routing_id(), message)); |
216 } | 221 } |
217 | 222 |
218 void WebKitTestRunner::postTask(WebTask* task) { | 223 void WebKitTestRunner::postTask(WebTask* task) { |
219 Platform::current()->callOnMainThread(InvokeTaskHelper, task); | 224 Platform::current()->callOnMainThread(InvokeTaskHelper, task); |
220 } | 225 } |
221 | 226 |
222 void WebKitTestRunner::postDelayedTask(WebTask* task, long long ms) { | 227 void WebKitTestRunner::postDelayedTask(WebTask* task, long long ms) { |
223 base::MessageLoop::current()->PostDelayedTask( | 228 base::MessageLoop::current()->PostDelayedTask( |
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
665 ->loadRequest(WebURLRequest(GURL("about:blank"))); | 670 ->loadRequest(WebURLRequest(GURL("about:blank"))); |
666 Send(new ShellViewHostMsg_ResetDone(routing_id())); | 671 Send(new ShellViewHostMsg_ResetDone(routing_id())); |
667 } | 672 } |
668 | 673 |
669 void WebKitTestRunner::OnNotifyDone() { | 674 void WebKitTestRunner::OnNotifyDone() { |
670 render_view()->GetWebView()->mainFrame()->executeScript( | 675 render_view()->GetWebView()->mainFrame()->executeScript( |
671 WebScriptSource(WebString::fromUTF8("testRunner.notifyDone();"))); | 676 WebScriptSource(WebString::fromUTF8("testRunner.notifyDone();"))); |
672 } | 677 } |
673 | 678 |
674 } // namespace content | 679 } // namespace content |
OLD | NEW |