| 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/public/test/layouttest_support.h" | 5 #include "content/public/test/layouttest_support.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| 11 #include "base/lazy_instance.h" | 11 #include "base/lazy_instance.h" |
| 12 #include "base/memory/ptr_util.h" | 12 #include "base/memory/ptr_util.h" |
| 13 #include "base/strings/string_util.h" | 13 #include "base/strings/string_util.h" |
| 14 #include "build/build_config.h" | 14 #include "build/build_config.h" |
| 15 #include "cc/output/copy_output_request.h" | 15 #include "cc/output/copy_output_request.h" |
| 16 #include "cc/test/pixel_test_output_surface.h" | 16 #include "cc/test/pixel_test_output_surface.h" |
| 17 #include "cc/test/test_compositor_frame_sink.h" | 17 #include "cc/test/test_compositor_frame_sink.h" |
| 18 #include "components/test_runner/test_common.h" | 18 #include "components/test_runner/test_common.h" |
| 19 #include "components/test_runner/web_frame_test_proxy.h" | 19 #include "components/test_runner/web_frame_test_proxy.h" |
| 20 #include "components/test_runner/web_view_test_proxy.h" | 20 #include "components/test_runner/web_view_test_proxy.h" |
| 21 #include "components/test_runner/web_widget_test_proxy.h" | 21 #include "components/test_runner/web_widget_test_proxy.h" |
| 22 #include "content/browser/bluetooth/bluetooth_device_chooser_controller.h" | 22 #include "content/browser/bluetooth/bluetooth_device_chooser_controller.h" |
| 23 #include "content/browser/renderer_host/render_process_host_impl.h" | 23 #include "content/browser/renderer_host/render_process_host_impl.h" |
| 24 #include "content/browser/renderer_host/render_widget_host_impl.h" | 24 #include "content/browser/renderer_host/render_widget_host_impl.h" |
| 25 #include "content/common/gpu/client/context_provider_command_buffer.h" | 25 #include "content/common/gpu/client/context_provider_command_buffer.h" |
| 26 #include "content/common/renderer.mojom.h" |
| 26 #include "content/common/site_isolation_policy.h" | 27 #include "content/common/site_isolation_policy.h" |
| 27 #include "content/public/common/page_state.h" | 28 #include "content/public/common/page_state.h" |
| 28 #include "content/public/renderer/renderer_gamepad_provider.h" | 29 #include "content/public/renderer/renderer_gamepad_provider.h" |
| 29 #include "content/renderer/fetchers/manifest_fetcher.h" | 30 #include "content/renderer/fetchers/manifest_fetcher.h" |
| 30 #include "content/renderer/gpu/render_widget_compositor.h" | 31 #include "content/renderer/gpu/render_widget_compositor.h" |
| 31 #include "content/renderer/history_entry.h" | 32 #include "content/renderer/history_entry.h" |
| 32 #include "content/renderer/history_serialization.h" | 33 #include "content/renderer/history_serialization.h" |
| 33 #include "content/renderer/layout_test_dependencies.h" | 34 #include "content/renderer/layout_test_dependencies.h" |
| 34 #include "content/renderer/render_frame_impl.h" | 35 #include "content/renderer/render_frame_impl.h" |
| 35 #include "content/renderer/render_thread_impl.h" | 36 #include "content/renderer/render_thread_impl.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 | 74 |
| 74 base::LazyInstance<WidgetProxyCreationCallback>::Leaky | 75 base::LazyInstance<WidgetProxyCreationCallback>::Leaky |
| 75 g_widget_test_proxy_callback = LAZY_INSTANCE_INITIALIZER; | 76 g_widget_test_proxy_callback = LAZY_INSTANCE_INITIALIZER; |
| 76 | 77 |
| 77 base::LazyInstance<FrameProxyCreationCallback>::Leaky | 78 base::LazyInstance<FrameProxyCreationCallback>::Leaky |
| 78 g_frame_test_proxy_callback = LAZY_INSTANCE_INITIALIZER; | 79 g_frame_test_proxy_callback = LAZY_INSTANCE_INITIALIZER; |
| 79 | 80 |
| 80 using WebViewTestProxyType = | 81 using WebViewTestProxyType = |
| 81 test_runner::WebViewTestProxy<RenderViewImpl, | 82 test_runner::WebViewTestProxy<RenderViewImpl, |
| 82 CompositorDependencies*, | 83 CompositorDependencies*, |
| 83 const ViewMsg_New_Params&>; | 84 const mojom::CreateViewParams&>; |
| 84 using WebWidgetTestProxyType = | 85 using WebWidgetTestProxyType = |
| 85 test_runner::WebWidgetTestProxy<RenderWidget, | 86 test_runner::WebWidgetTestProxy<RenderWidget, |
| 86 CompositorDependencies*, | 87 CompositorDependencies*, |
| 87 blink::WebPopupType, | 88 blink::WebPopupType, |
| 88 const ScreenInfo&, | 89 const ScreenInfo&, |
| 89 bool, | 90 bool, |
| 90 bool, | 91 bool, |
| 91 bool>; | 92 bool>; |
| 92 using WebFrameTestProxyType = | 93 using WebFrameTestProxyType = |
| 93 test_runner::WebFrameTestProxy<RenderFrameImpl, | 94 test_runner::WebFrameTestProxy<RenderFrameImpl, |
| 94 const RenderFrameImpl::CreateParams&>; | 95 const RenderFrameImpl::CreateParams&>; |
| 95 | 96 |
| 96 RenderViewImpl* CreateWebViewTestProxy(CompositorDependencies* compositor_deps, | 97 RenderViewImpl* CreateWebViewTestProxy(CompositorDependencies* compositor_deps, |
| 97 const ViewMsg_New_Params& params) { | 98 const mojom::CreateViewParams& params) { |
| 98 WebViewTestProxyType* render_view_proxy = | 99 WebViewTestProxyType* render_view_proxy = |
| 99 new WebViewTestProxyType(compositor_deps, params); | 100 new WebViewTestProxyType(compositor_deps, params); |
| 100 if (g_view_test_proxy_callback == 0) | 101 if (g_view_test_proxy_callback == 0) |
| 101 return render_view_proxy; | 102 return render_view_proxy; |
| 102 g_view_test_proxy_callback.Get().Run(render_view_proxy, render_view_proxy); | 103 g_view_test_proxy_callback.Get().Run(render_view_proxy, render_view_proxy); |
| 103 return render_view_proxy; | 104 return render_view_proxy; |
| 104 } | 105 } |
| 105 | 106 |
| 106 RenderWidget* CreateWebWidgetTestProxy(CompositorDependencies* compositor_deps, | 107 RenderWidget* CreateWebWidgetTestProxy(CompositorDependencies* compositor_deps, |
| 107 blink::WebPopupType popup_type, | 108 blink::WebPopupType popup_type, |
| (...skipping 925 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1033 return result; | 1034 return result; |
| 1034 } | 1035 } |
| 1035 | 1036 |
| 1036 void SchedulerRunIdleTasks(const base::Closure& callback) { | 1037 void SchedulerRunIdleTasks(const base::Closure& callback) { |
| 1037 blink::scheduler::RendererScheduler* scheduler = | 1038 blink::scheduler::RendererScheduler* scheduler = |
| 1038 content::RenderThreadImpl::current()->GetRendererScheduler(); | 1039 content::RenderThreadImpl::current()->GetRendererScheduler(); |
| 1039 blink::scheduler::RunIdleTasksForTesting(scheduler, callback); | 1040 blink::scheduler::RunIdleTasksForTesting(scheduler, callback); |
| 1040 } | 1041 } |
| 1041 | 1042 |
| 1042 } // namespace content | 1043 } // namespace content |
| OLD | NEW |