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 <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/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
14 #include "base/debug/debugger.h" | 14 #include "base/debug/debugger.h" |
15 #include "base/files/file_path.h" | 15 #include "base/files/file_path.h" |
16 #include "base/location.h" | 16 #include "base/location.h" |
17 #include "base/md5.h" | 17 #include "base/md5.h" |
18 #include "base/memory/scoped_ptr.h" | 18 #include "base/memory/scoped_ptr.h" |
19 #include "base/single_thread_task_runner.h" | 19 #include "base/single_thread_task_runner.h" |
20 #include "base/strings/string_util.h" | 20 #include "base/strings/string_util.h" |
21 #include "base/strings/stringprintf.h" | 21 #include "base/strings/stringprintf.h" |
22 #include "base/strings/sys_string_conversions.h" | 22 #include "base/strings/sys_string_conversions.h" |
23 #include "base/strings/utf_string_conversions.h" | 23 #include "base/strings/utf_string_conversions.h" |
24 #include "base/thread_task_runner_handle.h" | 24 #include "base/thread_task_runner_handle.h" |
25 #include "base/time/time.h" | 25 #include "base/time/time.h" |
| 26 #include "components/plugins/renderer/plugin_placeholder.h" |
26 #include "components/test_runner/app_banner_client.h" | 27 #include "components/test_runner/app_banner_client.h" |
27 #include "components/test_runner/gamepad_controller.h" | 28 #include "components/test_runner/gamepad_controller.h" |
28 #include "components/test_runner/mock_screen_orientation_client.h" | 29 #include "components/test_runner/mock_screen_orientation_client.h" |
29 #include "components/test_runner/test_interfaces.h" | 30 #include "components/test_runner/test_interfaces.h" |
30 #include "components/test_runner/web_task.h" | 31 #include "components/test_runner/web_task.h" |
31 #include "components/test_runner/web_test_interfaces.h" | 32 #include "components/test_runner/web_test_interfaces.h" |
32 #include "components/test_runner/web_test_proxy.h" | 33 #include "components/test_runner/web_test_proxy.h" |
33 #include "components/test_runner/web_test_runner.h" | 34 #include "components/test_runner/web_test_runner.h" |
34 #include "content/public/common/content_switches.h" | 35 #include "content/public/common/content_switches.h" |
35 #include "content/public/common/url_constants.h" | 36 #include "content/public/common/url_constants.h" |
36 #include "content/public/common/web_preferences.h" | 37 #include "content/public/common/web_preferences.h" |
37 #include "content/public/renderer/render_frame.h" | 38 #include "content/public/renderer/render_frame.h" |
38 #include "content/public/renderer/render_view.h" | 39 #include "content/public/renderer/render_view.h" |
39 #include "content/public/renderer/render_view_visitor.h" | 40 #include "content/public/renderer/render_view_visitor.h" |
40 #include "content/public/renderer/renderer_gamepad_provider.h" | 41 #include "content/public/renderer/renderer_gamepad_provider.h" |
41 #include "content/public/test/layouttest_support.h" | 42 #include "content/public/test/layouttest_support.h" |
42 #include "content/shell/common/layout_test/layout_test_messages.h" | 43 #include "content/shell/common/layout_test/layout_test_messages.h" |
43 #include "content/shell/common/shell_messages.h" | 44 #include "content/shell/common/shell_messages.h" |
44 #include "content/shell/common/shell_switches.h" | 45 #include "content/shell/common/shell_switches.h" |
45 #include "content/shell/renderer/layout_test/blink_test_helpers.h" | 46 #include "content/shell/renderer/layout_test/blink_test_helpers.h" |
46 #include "content/shell/renderer/layout_test/gc_controller.h" | 47 #include "content/shell/renderer/layout_test/gc_controller.h" |
47 #include "content/shell/renderer/layout_test/layout_test_render_process_observer
.h" | 48 #include "content/shell/renderer/layout_test/layout_test_render_process_observer
.h" |
48 #include "content/shell/renderer/layout_test/leak_detector.h" | 49 #include "content/shell/renderer/layout_test/leak_detector.h" |
49 #include "content/shell/renderer/layout_test/test_plugin_placeholder.h" | |
50 #include "net/base/filename_util.h" | 50 #include "net/base/filename_util.h" |
51 #include "net/base/net_errors.h" | 51 #include "net/base/net_errors.h" |
52 #include "skia/ext/platform_canvas.h" | 52 #include "skia/ext/platform_canvas.h" |
53 #include "third_party/WebKit/public/platform/Platform.h" | 53 #include "third_party/WebKit/public/platform/Platform.h" |
54 #include "third_party/WebKit/public/platform/WebCString.h" | 54 #include "third_party/WebKit/public/platform/WebCString.h" |
55 #include "third_party/WebKit/public/platform/WebPoint.h" | 55 #include "third_party/WebKit/public/platform/WebPoint.h" |
56 #include "third_party/WebKit/public/platform/WebRect.h" | 56 #include "third_party/WebKit/public/platform/WebRect.h" |
57 #include "third_party/WebKit/public/platform/WebSize.h" | 57 #include "third_party/WebKit/public/platform/WebSize.h" |
58 #include "third_party/WebKit/public/platform/WebString.h" | 58 #include "third_party/WebKit/public/platform/WebString.h" |
59 #include "third_party/WebKit/public/platform/WebThread.h" | 59 #include "third_party/WebKit/public/platform/WebThread.h" |
(...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
681 | 681 |
682 void BlinkTestRunner::ResolveBeforeInstallPromptPromise( | 682 void BlinkTestRunner::ResolveBeforeInstallPromptPromise( |
683 int request_id, const std::string& platform) { | 683 int request_id, const std::string& platform) { |
684 test_runner::WebTestInterfaces* interfaces = | 684 test_runner::WebTestInterfaces* interfaces = |
685 LayoutTestRenderProcessObserver::GetInstance()->test_interfaces(); | 685 LayoutTestRenderProcessObserver::GetInstance()->test_interfaces(); |
686 interfaces->GetAppBannerClient()->ResolvePromise(request_id, platform); | 686 interfaces->GetAppBannerClient()->ResolvePromise(request_id, platform); |
687 } | 687 } |
688 | 688 |
689 blink::WebPlugin* BlinkTestRunner::CreatePluginPlaceholder( | 689 blink::WebPlugin* BlinkTestRunner::CreatePluginPlaceholder( |
690 blink::WebLocalFrame* frame, const blink::WebPluginParams& params) { | 690 blink::WebLocalFrame* frame, const blink::WebPluginParams& params) { |
691 if (params.mimeType == "application/x-plugin-placeholder-test") | 691 if (params.mimeType != "application/x-plugin-placeholder-test") |
692 return (new TestPluginPlaceholder(render_view()->GetMainRenderFrame(), | 692 return nullptr; |
693 frame, params))->plugin(); | 693 |
694 return 0; | 694 plugins::PluginPlaceholder* placeholder = |
| 695 new plugins::PluginPlaceholder(render_view()->GetMainRenderFrame(), frame, |
| 696 params, "<div>Test content</div>"); |
| 697 return placeholder->plugin(); |
695 } | 698 } |
696 | 699 |
697 // RenderViewObserver -------------------------------------------------------- | 700 // RenderViewObserver -------------------------------------------------------- |
698 | 701 |
699 void BlinkTestRunner::DidClearWindowObject(WebLocalFrame* frame) { | 702 void BlinkTestRunner::DidClearWindowObject(WebLocalFrame* frame) { |
700 WebTestingSupport::injectInternalsObject(frame); | 703 WebTestingSupport::injectInternalsObject(frame); |
701 LayoutTestRenderProcessObserver::GetInstance()->test_interfaces()->BindTo( | 704 LayoutTestRenderProcessObserver::GetInstance()->test_interfaces()->BindTo( |
702 frame); | 705 frame); |
703 GCController::Install(frame); | 706 GCController::Install(frame); |
704 } | 707 } |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
889 | 892 |
890 leak_detector_->TryLeakDetection(main_frame); | 893 leak_detector_->TryLeakDetection(main_frame); |
891 } | 894 } |
892 | 895 |
893 void BlinkTestRunner::ReportLeakDetectionResult( | 896 void BlinkTestRunner::ReportLeakDetectionResult( |
894 const LeakDetectionResult& report) { | 897 const LeakDetectionResult& report) { |
895 Send(new ShellViewHostMsg_LeakDetectionDone(routing_id(), report)); | 898 Send(new ShellViewHostMsg_LeakDetectionDone(routing_id(), report)); |
896 } | 899 } |
897 | 900 |
898 } // namespace content | 901 } // namespace content |
OLD | NEW |