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 15 matching lines...) Expand all Loading... |
26 #include "content/public/renderer/render_view_visitor.h" | 26 #include "content/public/renderer/render_view_visitor.h" |
27 #include "content/public/test/layouttest_support.h" | 27 #include "content/public/test/layouttest_support.h" |
28 #include "content/shell/common/shell_messages.h" | 28 #include "content/shell/common/shell_messages.h" |
29 #include "content/shell/common/shell_switches.h" | 29 #include "content/shell/common/shell_switches.h" |
30 #include "content/shell/common/webkit_test_helpers.h" | 30 #include "content/shell/common/webkit_test_helpers.h" |
31 #include "content/shell/renderer/gc_controller.h" | 31 #include "content/shell/renderer/gc_controller.h" |
32 #include "content/shell/renderer/leak_detector.h" | 32 #include "content/shell/renderer/leak_detector.h" |
33 #include "content/shell/renderer/shell_render_process_observer.h" | 33 #include "content/shell/renderer/shell_render_process_observer.h" |
34 #include "content/shell/renderer/test_runner/WebTask.h" | 34 #include "content/shell/renderer/test_runner/WebTask.h" |
35 #include "content/shell/renderer/test_runner/WebTestInterfaces.h" | 35 #include "content/shell/renderer/test_runner/WebTestInterfaces.h" |
| 36 #include "content/shell/renderer/test_runner/mock_screen_orientation_client.h" |
36 #include "content/shell/renderer/test_runner/web_test_proxy.h" | 37 #include "content/shell/renderer/test_runner/web_test_proxy.h" |
37 #include "content/shell/renderer/test_runner/web_test_runner.h" | 38 #include "content/shell/renderer/test_runner/web_test_runner.h" |
38 #include "net/base/filename_util.h" | 39 #include "net/base/filename_util.h" |
39 #include "net/base/net_errors.h" | 40 #include "net/base/net_errors.h" |
40 #include "skia/ext/platform_canvas.h" | 41 #include "skia/ext/platform_canvas.h" |
41 #include "third_party/WebKit/public/platform/Platform.h" | 42 #include "third_party/WebKit/public/platform/Platform.h" |
42 #include "third_party/WebKit/public/platform/WebCString.h" | 43 #include "third_party/WebKit/public/platform/WebCString.h" |
43 #include "third_party/WebKit/public/platform/WebPoint.h" | 44 #include "third_party/WebKit/public/platform/WebPoint.h" |
44 #include "third_party/WebKit/public/platform/WebRect.h" | 45 #include "third_party/WebKit/public/platform/WebRect.h" |
45 #include "third_party/WebKit/public/platform/WebSize.h" | 46 #include "third_party/WebKit/public/platform/WebSize.h" |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 SetMockDeviceMotionData(data); | 211 SetMockDeviceMotionData(data); |
211 } | 212 } |
212 | 213 |
213 void WebKitTestRunner::setDeviceOrientationData( | 214 void WebKitTestRunner::setDeviceOrientationData( |
214 const WebDeviceOrientationData& data) { | 215 const WebDeviceOrientationData& data) { |
215 SetMockDeviceOrientationData(data); | 216 SetMockDeviceOrientationData(data); |
216 } | 217 } |
217 | 218 |
218 void WebKitTestRunner::setScreenOrientation( | 219 void WebKitTestRunner::setScreenOrientation( |
219 const WebScreenOrientationType& orientation) { | 220 const WebScreenOrientationType& orientation) { |
220 SetMockScreenOrientation(render_view(), orientation); | 221 MockScreenOrientationClient* mock_client = |
| 222 proxy()->GetScreenOrientationClientMock(); |
| 223 mock_client->UpdateDeviceOrientation(render_view()->GetWebView()->mainFrame(), |
| 224 orientation); |
221 } | 225 } |
222 | 226 |
223 void WebKitTestRunner::resetScreenOrientation() { | 227 void WebKitTestRunner::resetScreenOrientation() { |
224 ResetMockScreenOrientation(); | 228 MockScreenOrientationClient* mock_client = |
| 229 proxy()->GetScreenOrientationClientMock(); |
| 230 mock_client->ResetData(); |
225 } | 231 } |
226 | 232 |
227 void WebKitTestRunner::didChangeBatteryStatus( | 233 void WebKitTestRunner::didChangeBatteryStatus( |
228 const blink::WebBatteryStatus& status) { | 234 const blink::WebBatteryStatus& status) { |
229 MockBatteryStatusChanged(status); | 235 MockBatteryStatusChanged(status); |
230 } | 236 } |
231 | 237 |
232 void WebKitTestRunner::printMessage(const std::string& message) { | 238 void WebKitTestRunner::printMessage(const std::string& message) { |
233 Send(new ShellViewHostMsg_PrintMessage(routing_id(), message)); | 239 Send(new ShellViewHostMsg_PrintMessage(routing_id(), message)); |
234 } | 240 } |
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
712 | 718 |
713 leak_detector_->TryLeakDetection(main_frame); | 719 leak_detector_->TryLeakDetection(main_frame); |
714 } | 720 } |
715 | 721 |
716 void WebKitTestRunner::ReportLeakDetectionResult( | 722 void WebKitTestRunner::ReportLeakDetectionResult( |
717 const LeakDetectionResult& report) { | 723 const LeakDetectionResult& report) { |
718 Send(new ShellViewHostMsg_LeakDetectionDone(routing_id(), report)); | 724 Send(new ShellViewHostMsg_LeakDetectionDone(routing_id(), report)); |
719 } | 725 } |
720 | 726 |
721 } // namespace content | 727 } // namespace content |
OLD | NEW |