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

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

Issue 1890223002: Explicitly initialize secondary renderers for layout tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebasing... 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"
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 BlinkTestRunner* test_runner = BlinkTestRunner::Get(render_view); 104 BlinkTestRunner* test_runner = BlinkTestRunner::Get(render_view);
105 test_runner->Reset(false /* for_new_test */); 105 test_runner->Reset(false /* for_new_test */);
106 106
107 LayoutTestRenderThreadObserver::GetInstance() 107 LayoutTestRenderThreadObserver::GetInstance()
108 ->test_interfaces() 108 ->test_interfaces()
109 ->TestRunner() 109 ->TestRunner()
110 ->InitializeWebViewWithMocks(render_view->GetWebView()); 110 ->InitializeWebViewWithMocks(render_view->GetWebView());
111 111
112 test_runner::WebTestDelegate* delegate = 112 test_runner::WebTestDelegate* delegate =
113 LayoutTestRenderThreadObserver::GetInstance()->test_delegate(); 113 LayoutTestRenderThreadObserver::GetInstance()->test_delegate();
114 if (delegate == static_cast<test_runner::WebTestDelegate*>(test_runner)) 114 if (delegate == static_cast<test_runner::WebTestDelegate*>(test_runner)) {
115 LayoutTestRenderThreadObserver::GetInstance()->SetMainWindow(render_view); 115 // TODO(lukasza): Should this instead by done by BlinkTestRunner,
116 // when it gets notified by the browser that it is the main window?
117
118 // Let test_runner layer know what is the main test window.
119 LayoutTestRenderThreadObserver::GetInstance()
120 ->test_interfaces()
121 ->SetWebView(render_view->GetWebView(), proxy);
122 }
116 } 123 }
117 124
118 WebMediaStreamCenter* 125 WebMediaStreamCenter*
119 LayoutTestContentRendererClient::OverrideCreateWebMediaStreamCenter( 126 LayoutTestContentRendererClient::OverrideCreateWebMediaStreamCenter(
120 WebMediaStreamCenterClient* client) { 127 WebMediaStreamCenterClient* client) {
121 #if defined(ENABLE_WEBRTC) 128 #if defined(ENABLE_WEBRTC)
122 test_runner::WebTestInterfaces* interfaces = 129 test_runner::WebTestInterfaces* interfaces =
123 LayoutTestRenderThreadObserver::GetInstance()->test_interfaces(); 130 LayoutTestRenderThreadObserver::GetInstance()->test_interfaces();
124 return interfaces->CreateMediaStreamCenter(client); 131 return interfaces->CreateMediaStreamCenter(client);
125 #else 132 #else
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 LayoutTestContentRendererClient::CreateMediaStreamRendererFactory() { 186 LayoutTestContentRendererClient::CreateMediaStreamRendererFactory() {
180 #if defined(ENABLE_WEBRTC) 187 #if defined(ENABLE_WEBRTC)
181 return std::unique_ptr<MediaStreamRendererFactory>( 188 return std::unique_ptr<MediaStreamRendererFactory>(
182 new TestMediaStreamRendererFactory()); 189 new TestMediaStreamRendererFactory());
183 #else 190 #else
184 return nullptr; 191 return nullptr;
185 #endif 192 #endif
186 } 193 }
187 194
188 } // namespace content 195 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698