| 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/layout_test/blink_test_runner.h" | 5 #include "content/shell/renderer/layout_test/blink_test_runner.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <algorithm> | 8 #include <algorithm> |
| 9 #include <clocale> | 9 #include <clocale> |
| 10 #include <cmath> | 10 #include <cmath> |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 #include "base/strings/sys_string_conversions.h" | 25 #include "base/strings/sys_string_conversions.h" |
| 26 #include "base/strings/utf_string_conversions.h" | 26 #include "base/strings/utf_string_conversions.h" |
| 27 #include "base/thread_task_runner_handle.h" | 27 #include "base/thread_task_runner_handle.h" |
| 28 #include "base/time/time.h" | 28 #include "base/time/time.h" |
| 29 #include "base/values.h" | 29 #include "base/values.h" |
| 30 #include "build/build_config.h" | 30 #include "build/build_config.h" |
| 31 #include "components/plugins/renderer/plugin_placeholder.h" | 31 #include "components/plugins/renderer/plugin_placeholder.h" |
| 32 #include "components/test_runner/gamepad_controller.h" | 32 #include "components/test_runner/gamepad_controller.h" |
| 33 #include "components/test_runner/layout_dump.h" | 33 #include "components/test_runner/layout_dump.h" |
| 34 #include "components/test_runner/layout_dump_flags.h" | 34 #include "components/test_runner/layout_dump_flags.h" |
| 35 #include "components/test_runner/mock_screen_orientation_client.h" | |
| 36 #include "components/test_runner/test_interfaces.h" | 35 #include "components/test_runner/test_interfaces.h" |
| 37 #include "components/test_runner/web_task.h" | 36 #include "components/test_runner/web_task.h" |
| 38 #include "components/test_runner/web_test_interfaces.h" | 37 #include "components/test_runner/web_test_interfaces.h" |
| 39 #include "components/test_runner/web_test_proxy.h" | 38 #include "components/test_runner/web_test_proxy.h" |
| 40 #include "components/test_runner/web_test_runner.h" | 39 #include "components/test_runner/web_test_runner.h" |
| 41 #include "content/public/common/content_switches.h" | 40 #include "content/public/common/content_switches.h" |
| 42 #include "content/public/common/url_constants.h" | 41 #include "content/public/common/url_constants.h" |
| 43 #include "content/public/common/web_preferences.h" | 42 #include "content/public/common/web_preferences.h" |
| 44 #include "content/public/renderer/media_stream_api.h" | 43 #include "content/public/renderer/media_stream_api.h" |
| 45 #include "content/public/renderer/render_frame.h" | 44 #include "content/public/renderer/render_frame.h" |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 using blink::WebFrame; | 99 using blink::WebFrame; |
| 101 using blink::WebLocalFrame; | 100 using blink::WebLocalFrame; |
| 102 using blink::WebPoint; | 101 using blink::WebPoint; |
| 103 using blink::WebRect; | 102 using blink::WebRect; |
| 104 using blink::WebScriptSource; | 103 using blink::WebScriptSource; |
| 105 using blink::WebSize; | 104 using blink::WebSize; |
| 106 using blink::WebString; | 105 using blink::WebString; |
| 107 using blink::WebURL; | 106 using blink::WebURL; |
| 108 using blink::WebURLError; | 107 using blink::WebURLError; |
| 109 using blink::WebURLRequest; | 108 using blink::WebURLRequest; |
| 110 using blink::WebScreenOrientationType; | |
| 111 using blink::WebTestingSupport; | 109 using blink::WebTestingSupport; |
| 112 using blink::WebTraceLocation; | 110 using blink::WebTraceLocation; |
| 113 using blink::WebThread; | 111 using blink::WebThread; |
| 114 using blink::WebVector; | 112 using blink::WebVector; |
| 115 using blink::WebView; | 113 using blink::WebView; |
| 116 | 114 |
| 117 namespace content { | 115 namespace content { |
| 118 | 116 |
| 119 namespace { | 117 namespace { |
| 120 | 118 |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 | 281 |
| 284 void BlinkTestRunner::SetDeviceMotionData(const WebDeviceMotionData& data) { | 282 void BlinkTestRunner::SetDeviceMotionData(const WebDeviceMotionData& data) { |
| 285 SetMockDeviceMotionData(data); | 283 SetMockDeviceMotionData(data); |
| 286 } | 284 } |
| 287 | 285 |
| 288 void BlinkTestRunner::SetDeviceOrientationData( | 286 void BlinkTestRunner::SetDeviceOrientationData( |
| 289 const WebDeviceOrientationData& data) { | 287 const WebDeviceOrientationData& data) { |
| 290 SetMockDeviceOrientationData(data); | 288 SetMockDeviceOrientationData(data); |
| 291 } | 289 } |
| 292 | 290 |
| 293 void BlinkTestRunner::SetScreenOrientation( | |
| 294 const WebScreenOrientationType& orientation) { | |
| 295 test_runner::MockScreenOrientationClient* mock_client = | |
| 296 proxy()->GetScreenOrientationClientMock(); | |
| 297 mock_client->UpdateDeviceOrientation( | |
| 298 render_view()->GetWebView()->mainFrame()->toWebLocalFrame(), orientation); | |
| 299 } | |
| 300 | |
| 301 void BlinkTestRunner::DisableMockScreenOrientation() { | |
| 302 test_runner::MockScreenOrientationClient* mock_client = | |
| 303 proxy()->GetScreenOrientationClientMock(); | |
| 304 mock_client->SetDisabled(true); | |
| 305 } | |
| 306 | |
| 307 void BlinkTestRunner::ResetScreenOrientation() { | |
| 308 test_runner::MockScreenOrientationClient* mock_client = | |
| 309 proxy()->GetScreenOrientationClientMock(); | |
| 310 mock_client->ResetData(); | |
| 311 } | |
| 312 | |
| 313 void BlinkTestRunner::PrintMessage(const std::string& message) { | 291 void BlinkTestRunner::PrintMessage(const std::string& message) { |
| 314 Send(new ShellViewHostMsg_PrintMessage(routing_id(), message)); | 292 Send(new ShellViewHostMsg_PrintMessage(routing_id(), message)); |
| 315 } | 293 } |
| 316 | 294 |
| 317 void BlinkTestRunner::PostTask(test_runner::WebTask* task) { | 295 void BlinkTestRunner::PostTask(test_runner::WebTask* task) { |
| 318 Platform::current()->currentThread()->getWebTaskRunner()->postTask( | 296 Platform::current()->currentThread()->getWebTaskRunner()->postTask( |
| 319 WebTraceLocation(__FUNCTION__, __FILE__), | 297 WebTraceLocation(__FUNCTION__, __FILE__), |
| 320 new InvokeTaskHelper(make_scoped_ptr(task))); | 298 new InvokeTaskHelper(make_scoped_ptr(task))); |
| 321 } | 299 } |
| 322 | 300 |
| (...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1052 get_bluetooth_events_callbacks_.pop_front(); | 1030 get_bluetooth_events_callbacks_.pop_front(); |
| 1053 callback.Run(events); | 1031 callback.Run(events); |
| 1054 } | 1032 } |
| 1055 | 1033 |
| 1056 void BlinkTestRunner::ReportLeakDetectionResult( | 1034 void BlinkTestRunner::ReportLeakDetectionResult( |
| 1057 const LeakDetectionResult& report) { | 1035 const LeakDetectionResult& report) { |
| 1058 Send(new ShellViewHostMsg_LeakDetectionDone(routing_id(), report)); | 1036 Send(new ShellViewHostMsg_LeakDetectionDone(routing_id(), report)); |
| 1059 } | 1037 } |
| 1060 | 1038 |
| 1061 } // namespace content | 1039 } // namespace content |
| OLD | NEW |