Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(36)

Side by Side Diff: content/shell/renderer/layout_test/layout_test_content_renderer_client.cc

Issue 1841833005: Revert of Extract WebFrameClient implementation out of WebTestProxyBase. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2014 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/layout_test_content_renderer_client .h" 5 #include "content/shell/renderer/layout_test/layout_test_content_renderer_client .h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/debug/debugger.h" 9 #include "base/debug/debugger.h"
10 #include "components/test_runner/mock_credential_manager_client.h" 10 #include "components/test_runner/mock_credential_manager_client.h"
11 #include "components/test_runner/web_frame_test_proxy.h"
12 #include "components/test_runner/web_test_interfaces.h" 11 #include "components/test_runner/web_test_interfaces.h"
13 #include "components/test_runner/web_test_proxy.h" 12 #include "components/test_runner/web_test_proxy.h"
14 #include "components/web_cache/renderer/web_cache_render_process_observer.h" 13 #include "components/web_cache/renderer/web_cache_render_process_observer.h"
15 #include "content/public/common/content_constants.h" 14 #include "content/public/common/content_constants.h"
16 #include "content/public/common/content_switches.h" 15 #include "content/public/common/content_switches.h"
17 #include "content/public/renderer/render_view.h" 16 #include "content/public/renderer/render_view.h"
18 #include "content/public/test/layouttest_support.h" 17 #include "content/public/test/layouttest_support.h"
19 #include "content/shell/common/shell_switches.h" 18 #include "content/shell/common/shell_switches.h"
20 #include "content/shell/renderer/layout_test/blink_test_helpers.h" 19 #include "content/shell/renderer/layout_test/blink_test_helpers.h"
21 #include "content/shell/renderer/layout_test/blink_test_runner.h" 20 #include "content/shell/renderer/layout_test/blink_test_runner.h"
(...skipping 17 matching lines...) Expand all
39 using blink::WebMediaStreamCenter; 38 using blink::WebMediaStreamCenter;
40 using blink::WebMediaStreamCenterClient; 39 using blink::WebMediaStreamCenterClient;
41 using blink::WebPlugin; 40 using blink::WebPlugin;
42 using blink::WebPluginParams; 41 using blink::WebPluginParams;
43 using blink::WebRTCPeerConnectionHandler; 42 using blink::WebRTCPeerConnectionHandler;
44 using blink::WebRTCPeerConnectionHandlerClient; 43 using blink::WebRTCPeerConnectionHandlerClient;
45 using blink::WebThemeEngine; 44 using blink::WebThemeEngine;
46 45
47 namespace content { 46 namespace content {
48 47
49 namespace {
50
51 void WebTestProxyCreated(RenderView* render_view,
52 test_runner::WebTestProxyBase* proxy) {
53 BlinkTestRunner* test_runner = new BlinkTestRunner(render_view);
54 test_runner->set_proxy(proxy);
55 if (!LayoutTestRenderProcessObserver::GetInstance()->test_delegate()) {
56 LayoutTestRenderProcessObserver::GetInstance()->SetTestDelegate(
57 test_runner);
58 }
59 proxy->SetInterfaces(
60 LayoutTestRenderProcessObserver::GetInstance()->test_interfaces());
61 test_runner->proxy()->SetDelegate(
62 LayoutTestRenderProcessObserver::GetInstance()->test_delegate());
63 }
64
65 void WebFrameTestProxyCreated(RenderFrame* render_frame,
66 test_runner::WebFrameTestProxyBase* proxy) {
67 proxy->set_test_client(LayoutTestRenderProcessObserver::GetInstance()
68 ->test_interfaces()
69 ->GetWebFrameTestClient());
70 }
71
72 } // namespace
73
74 LayoutTestContentRendererClient::LayoutTestContentRendererClient() { 48 LayoutTestContentRendererClient::LayoutTestContentRendererClient() {
75 EnableWebTestProxyCreation(base::Bind(&WebTestProxyCreated), 49 EnableWebTestProxyCreation(
76 base::Bind(&WebFrameTestProxyCreated)); 50 base::Bind(&LayoutTestContentRendererClient::WebTestProxyCreated,
51 base::Unretained(this)));
77 } 52 }
78 53
79 LayoutTestContentRendererClient::~LayoutTestContentRendererClient() { 54 LayoutTestContentRendererClient::~LayoutTestContentRendererClient() {
80 } 55 }
81 56
82 void LayoutTestContentRendererClient::RenderThreadStarted() { 57 void LayoutTestContentRendererClient::RenderThreadStarted() {
83 ShellContentRendererClient::RenderThreadStarted(); 58 ShellContentRendererClient::RenderThreadStarted();
84 shell_observer_.reset(new LayoutTestRenderProcessObserver()); 59 shell_observer_.reset(new LayoutTestRenderProcessObserver());
85 } 60 }
86 61
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 scoped_ptr<MediaStreamRendererFactory> 144 scoped_ptr<MediaStreamRendererFactory>
170 LayoutTestContentRendererClient::CreateMediaStreamRendererFactory() { 145 LayoutTestContentRendererClient::CreateMediaStreamRendererFactory() {
171 #if defined(ENABLE_WEBRTC) 146 #if defined(ENABLE_WEBRTC)
172 return scoped_ptr<MediaStreamRendererFactory>( 147 return scoped_ptr<MediaStreamRendererFactory>(
173 new TestMediaStreamRendererFactory()); 148 new TestMediaStreamRendererFactory());
174 #else 149 #else
175 return nullptr; 150 return nullptr;
176 #endif 151 #endif
177 } 152 }
178 153
154 void LayoutTestContentRendererClient::WebTestProxyCreated(
155 RenderView* render_view,
156 test_runner::WebTestProxyBase* proxy) {
157 BlinkTestRunner* test_runner = new BlinkTestRunner(render_view);
158 test_runner->set_proxy(proxy);
159 if (!LayoutTestRenderProcessObserver::GetInstance()->test_delegate()) {
160 LayoutTestRenderProcessObserver::GetInstance()->SetTestDelegate(
161 test_runner);
162 }
163 proxy->SetInterfaces(
164 LayoutTestRenderProcessObserver::GetInstance()->test_interfaces());
165 test_runner->proxy()->SetDelegate(
166 LayoutTestRenderProcessObserver::GetInstance()->test_delegate());
167 }
168
179 } // namespace content 169 } // namespace content
OLDNEW
« no previous file with comments | « content/shell/renderer/layout_test/layout_test_content_renderer_client.h ('k') | content/test/layouttest_support.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698