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

Side by Side Diff: content/public/test/test_renderer_host.cc

Issue 2190033002: content: Add ContextProviderFactory to create a render ContextProvider. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove display_ DCHECK. Created 4 years, 4 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
« no previous file with comments | « content/content_browser.gypi ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/test_renderer_host.h" 5 #include "content/public/test/test_renderer_host.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 10 matching lines...) Expand all
21 #include "content/test/browser_side_navigation_test_utils.h" 21 #include "content/test/browser_side_navigation_test_utils.h"
22 #include "content/test/content_browser_sanity_checker.h" 22 #include "content/test/content_browser_sanity_checker.h"
23 #include "content/test/test_render_frame_host.h" 23 #include "content/test/test_render_frame_host.h"
24 #include "content/test/test_render_frame_host_factory.h" 24 #include "content/test/test_render_frame_host_factory.h"
25 #include "content/test/test_render_view_host.h" 25 #include "content/test/test_render_view_host.h"
26 #include "content/test/test_render_view_host_factory.h" 26 #include "content/test/test_render_view_host_factory.h"
27 #include "content/test/test_web_contents.h" 27 #include "content/test/test_web_contents.h"
28 #include "ui/base/material_design/material_design_controller.h" 28 #include "ui/base/material_design/material_design_controller.h"
29 #include "ui/base/test/material_design_controller_test_api.h" 29 #include "ui/base/test/material_design_controller_test_api.h"
30 30
31 #if defined(OS_ANDROID)
32 #include "content/browser/renderer_host/context_provider_factory_impl_android.h"
33 #endif
34
31 #if defined(OS_WIN) 35 #if defined(OS_WIN)
32 #include "ui/base/win/scoped_ole_initializer.h" 36 #include "ui/base/win/scoped_ole_initializer.h"
33 #endif 37 #endif
34 38
35 #if defined(USE_AURA) 39 #if defined(USE_AURA)
36 #include "ui/aura/test/aura_test_helper.h" 40 #include "ui/aura/test/aura_test_helper.h"
37 #include "ui/compositor/test/context_factories_for_test.h" 41 #include "ui/compositor/test/context_factories_for_test.h"
38 #include "ui/wm/core/default_activation_client.h" 42 #include "ui/wm/core/default_activation_client.h"
39 #endif 43 #endif
40 44
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 ui::test::MaterialDesignControllerTestAPI::Uninitialize(); 195 ui::test::MaterialDesignControllerTestAPI::Uninitialize();
192 ui::MaterialDesignController::Initialize(); 196 ui::MaterialDesignController::Initialize();
193 thread_bundle_.reset(new TestBrowserThreadBundle(thread_bundle_options_)); 197 thread_bundle_.reset(new TestBrowserThreadBundle(thread_bundle_options_));
194 198
195 #if defined(OS_WIN) 199 #if defined(OS_WIN)
196 ole_initializer_.reset(new ui::ScopedOleInitializer()); 200 ole_initializer_.reset(new ui::ScopedOleInitializer());
197 #endif 201 #endif
198 #if !defined(OS_ANDROID) 202 #if !defined(OS_ANDROID)
199 ImageTransportFactory::InitializeForUnitTests( 203 ImageTransportFactory::InitializeForUnitTests(
200 base::WrapUnique(new NoTransportImageTransportFactory)); 204 base::WrapUnique(new NoTransportImageTransportFactory));
205 #else
206 ui::ContextProviderFactory::SetInstance(
207 ContextProviderFactoryImpl::GetInstance());
201 #endif 208 #endif
202 #if defined(USE_AURA) 209 #if defined(USE_AURA)
203 ui::ContextFactory* context_factory = 210 ui::ContextFactory* context_factory =
204 ImageTransportFactory::GetInstance()->GetContextFactory(); 211 ImageTransportFactory::GetInstance()->GetContextFactory();
205 212
206 aura_test_helper_.reset( 213 aura_test_helper_.reset(
207 new aura::test::AuraTestHelper(base::MessageLoopForUI::current())); 214 new aura::test::AuraTestHelper(base::MessageLoopForUI::current()));
208 aura_test_helper_->SetUp(context_factory); 215 aura_test_helper_->SetUp(context_factory);
209 new wm::DefaultActivationClient(aura_test_helper_->root_window()); 216 new wm::DefaultActivationClient(aura_test_helper_->root_window());
210 #endif 217 #endif
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 // depend on |browser_context_|. 263 // depend on |browser_context_|.
257 BrowserThread::DeleteSoon(content::BrowserThread::UI, 264 BrowserThread::DeleteSoon(content::BrowserThread::UI,
258 FROM_HERE, 265 FROM_HERE,
259 browser_context_.release()); 266 browser_context_.release());
260 thread_bundle_.reset(); 267 thread_bundle_.reset();
261 268
262 #if !defined(OS_ANDROID) 269 #if !defined(OS_ANDROID)
263 // RenderWidgetHostView holds on to a reference to SurfaceManager, so it 270 // RenderWidgetHostView holds on to a reference to SurfaceManager, so it
264 // must be shut down before the ImageTransportFactory. 271 // must be shut down before the ImageTransportFactory.
265 ImageTransportFactory::Terminate(); 272 ImageTransportFactory::Terminate();
273 #else
274 ui::ContextProviderFactory::SetInstance(nullptr);
266 #endif 275 #endif
267 } 276 }
268 277
269 BrowserContext* RenderViewHostTestHarness::CreateBrowserContext() { 278 BrowserContext* RenderViewHostTestHarness::CreateBrowserContext() {
270 return new TestBrowserContext(); 279 return new TestBrowserContext();
271 } 280 }
272 281
273 void RenderViewHostTestHarness::SetRenderProcessHostFactory( 282 void RenderViewHostTestHarness::SetRenderProcessHostFactory(
274 RenderProcessHostFactory* factory) { 283 RenderProcessHostFactory* factory) {
275 rvh_test_enabler_.rvh_factory_->set_render_process_host_factory(factory); 284 rvh_test_enabler_.rvh_factory_->set_render_process_host_factory(factory);
276 } 285 }
277 286
278 } // namespace content 287 } // namespace content
OLDNEW
« no previous file with comments | « content/content_browser.gypi ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698