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/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 12 matching lines...) Expand all Loading... |
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) | 31 #if defined(OS_ANDROID) |
32 #include "content/browser/renderer_host/context_provider_factory_impl_android.h" | 32 #include "content/browser/renderer_host/context_provider_factory_impl_android.h" |
33 #include "content/test/mock_gpu_channel_establish_factory.h" | |
34 #endif | 33 #endif |
35 | 34 |
36 #if defined(OS_WIN) | 35 #if defined(OS_WIN) |
37 #include "ui/base/win/scoped_ole_initializer.h" | 36 #include "ui/base/win/scoped_ole_initializer.h" |
38 #endif | 37 #endif |
39 | 38 |
40 #if defined(USE_AURA) | 39 #if defined(USE_AURA) |
41 #include "ui/aura/test/aura_test_helper.h" | 40 #include "ui/aura/test/aura_test_helper.h" |
42 #include "ui/compositor/test/context_factories_for_test.h" | 41 #include "ui/compositor/test/context_factories_for_test.h" |
43 #include "ui/wm/core/default_activation_client.h" | 42 #include "ui/wm/core/default_activation_client.h" |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 ui::MaterialDesignController::Initialize(); | 196 ui::MaterialDesignController::Initialize(); |
198 thread_bundle_.reset(new TestBrowserThreadBundle(thread_bundle_options_)); | 197 thread_bundle_.reset(new TestBrowserThreadBundle(thread_bundle_options_)); |
199 | 198 |
200 #if defined(OS_WIN) | 199 #if defined(OS_WIN) |
201 ole_initializer_.reset(new ui::ScopedOleInitializer()); | 200 ole_initializer_.reset(new ui::ScopedOleInitializer()); |
202 #endif | 201 #endif |
203 #if !defined(OS_ANDROID) | 202 #if !defined(OS_ANDROID) |
204 ImageTransportFactory::InitializeForUnitTests( | 203 ImageTransportFactory::InitializeForUnitTests( |
205 base::WrapUnique(new NoTransportImageTransportFactory)); | 204 base::WrapUnique(new NoTransportImageTransportFactory)); |
206 #else | 205 #else |
207 gpu_channel_factory_ = base::MakeUnique<MockGpuChannelEstablishFactory>(); | |
208 ContextProviderFactoryImpl::Initialize(gpu_channel_factory_.get()); | |
209 ui::ContextProviderFactory::SetInstance( | 206 ui::ContextProviderFactory::SetInstance( |
210 ContextProviderFactoryImpl::GetInstance()); | 207 ContextProviderFactoryImpl::GetInstance()); |
211 #endif | 208 #endif |
212 #if defined(USE_AURA) | 209 #if defined(USE_AURA) |
213 ui::ContextFactory* context_factory = | 210 ui::ContextFactory* context_factory = |
214 ImageTransportFactory::GetInstance()->GetContextFactory(); | 211 ImageTransportFactory::GetInstance()->GetContextFactory(); |
215 | 212 |
216 aura_test_helper_.reset( | 213 aura_test_helper_.reset( |
217 new aura::test::AuraTestHelper(base::MessageLoopForUI::current())); | 214 new aura::test::AuraTestHelper(base::MessageLoopForUI::current())); |
218 aura_test_helper_->SetUp(context_factory); | 215 aura_test_helper_->SetUp(context_factory); |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 FROM_HERE, | 265 FROM_HERE, |
269 browser_context_.release()); | 266 browser_context_.release()); |
270 thread_bundle_.reset(); | 267 thread_bundle_.reset(); |
271 | 268 |
272 #if !defined(OS_ANDROID) | 269 #if !defined(OS_ANDROID) |
273 // RenderWidgetHostView holds on to a reference to SurfaceManager, so it | 270 // RenderWidgetHostView holds on to a reference to SurfaceManager, so it |
274 // must be shut down before the ImageTransportFactory. | 271 // must be shut down before the ImageTransportFactory. |
275 ImageTransportFactory::Terminate(); | 272 ImageTransportFactory::Terminate(); |
276 #else | 273 #else |
277 ui::ContextProviderFactory::SetInstance(nullptr); | 274 ui::ContextProviderFactory::SetInstance(nullptr); |
278 ContextProviderFactoryImpl::Terminate(); | |
279 gpu_channel_factory_.reset(); | |
280 #endif | 275 #endif |
281 } | 276 } |
282 | 277 |
283 BrowserContext* RenderViewHostTestHarness::CreateBrowserContext() { | 278 BrowserContext* RenderViewHostTestHarness::CreateBrowserContext() { |
284 return new TestBrowserContext(); | 279 return new TestBrowserContext(); |
285 } | 280 } |
286 | 281 |
287 void RenderViewHostTestHarness::SetRenderProcessHostFactory( | 282 void RenderViewHostTestHarness::SetRenderProcessHostFactory( |
288 RenderProcessHostFactory* factory) { | 283 RenderProcessHostFactory* factory) { |
289 rvh_test_enabler_.rvh_factory_->set_render_process_host_factory(factory); | 284 rvh_test_enabler_.rvh_factory_->set_render_process_host_factory(factory); |
290 } | 285 } |
291 | 286 |
292 } // namespace content | 287 } // namespace content |
OLD | NEW |