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 "base/run_loop.h" | 7 #include "base/run_loop.h" |
8 #include "content/browser/frame_host/navigation_entry_impl.h" | 8 #include "content/browser/frame_host/navigation_entry_impl.h" |
9 #include "content/browser/renderer_host/render_view_host_factory.h" | 9 #include "content/browser/renderer_host/render_view_host_factory.h" |
10 #include "content/browser/renderer_host/render_widget_host_impl.h" | 10 #include "content/browser/renderer_host/render_widget_host_impl.h" |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 | 163 |
164 void RenderViewHostTestHarness::SetUp() { | 164 void RenderViewHostTestHarness::SetUp() { |
165 thread_bundle_.reset(new TestBrowserThreadBundle(thread_bundle_options_)); | 165 thread_bundle_.reset(new TestBrowserThreadBundle(thread_bundle_options_)); |
166 | 166 |
167 #if defined(OS_WIN) | 167 #if defined(OS_WIN) |
168 ole_initializer_.reset(new ui::ScopedOleInitializer()); | 168 ole_initializer_.reset(new ui::ScopedOleInitializer()); |
169 #endif | 169 #endif |
170 #if defined(USE_AURA) | 170 #if defined(USE_AURA) |
171 // The ContextFactory must exist before any Compositors are created. | 171 // The ContextFactory must exist before any Compositors are created. |
172 bool enable_pixel_output = false; | 172 bool enable_pixel_output = false; |
173 ui::InitializeContextFactoryForTests(enable_pixel_output); | 173 ui::ContextFactory* context_factory = |
| 174 ui::InitializeContextFactoryForTests(enable_pixel_output); |
174 | 175 |
175 aura_test_helper_.reset( | 176 aura_test_helper_.reset( |
176 new aura::test::AuraTestHelper(base::MessageLoopForUI::current())); | 177 new aura::test::AuraTestHelper(base::MessageLoopForUI::current())); |
177 aura_test_helper_->SetUp(); | 178 aura_test_helper_->SetUp(context_factory); |
178 new wm::DefaultActivationClient(aura_test_helper_->root_window()); | 179 new wm::DefaultActivationClient(aura_test_helper_->root_window()); |
179 #endif | 180 #endif |
180 | 181 |
181 DCHECK(!browser_context_); | 182 DCHECK(!browser_context_); |
182 browser_context_.reset(CreateBrowserContext()); | 183 browser_context_.reset(CreateBrowserContext()); |
183 | 184 |
184 SetContents(CreateTestWebContents()); | 185 SetContents(CreateTestWebContents()); |
185 } | 186 } |
186 | 187 |
187 void RenderViewHostTestHarness::TearDown() { | 188 void RenderViewHostTestHarness::TearDown() { |
(...skipping 27 matching lines...) Expand all Loading... |
215 BrowserContext* RenderViewHostTestHarness::CreateBrowserContext() { | 216 BrowserContext* RenderViewHostTestHarness::CreateBrowserContext() { |
216 return new TestBrowserContext(); | 217 return new TestBrowserContext(); |
217 } | 218 } |
218 | 219 |
219 void RenderViewHostTestHarness::SetRenderProcessHostFactory( | 220 void RenderViewHostTestHarness::SetRenderProcessHostFactory( |
220 RenderProcessHostFactory* factory) { | 221 RenderProcessHostFactory* factory) { |
221 rvh_test_enabler_.rvh_factory_->set_render_process_host_factory(factory); | 222 rvh_test_enabler_.rvh_factory_->set_render_process_host_factory(factory); |
222 } | 223 } |
223 | 224 |
224 } // namespace content | 225 } // namespace content |
OLD | NEW |