| 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" |
| 11 #include "content/browser/site_instance_impl.h" | 11 #include "content/browser/site_instance_impl.h" |
| 12 #include "content/public/browser/browser_thread.h" | 12 #include "content/public/browser/browser_thread.h" |
| 13 #include "content/public/browser/web_contents.h" | 13 #include "content/public/browser/web_contents.h" |
| 14 #include "content/public/test/mock_render_process_host.h" | 14 #include "content/public/test/mock_render_process_host.h" |
| 15 #include "content/public/test/test_browser_context.h" | 15 #include "content/public/test/test_browser_context.h" |
| 16 #include "content/test/test_render_frame_host_factory.h" | 16 #include "content/test/test_render_frame_host_factory.h" |
| 17 #include "content/test/test_render_view_host.h" | 17 #include "content/test/test_render_view_host.h" |
| 18 #include "content/test/test_render_view_host_factory.h" | 18 #include "content/test/test_render_view_host_factory.h" |
| 19 #include "content/test/test_web_contents.h" | 19 #include "content/test/test_web_contents.h" |
| 20 | 20 |
| 21 #if defined(OS_WIN) | 21 #if defined(OS_WIN) |
| 22 #include "ui/base/win/scoped_ole_initializer.h" | 22 #include "ui/base/win/scoped_ole_initializer.h" |
| 23 #endif | 23 #endif |
| 24 | 24 |
| 25 #if defined(USE_AURA) | 25 #if defined(USE_AURA) |
| 26 #include "ui/aura/test/aura_test_helper.h" | 26 #include "ui/aura/test/aura_test_helper.h" |
| 27 #include "ui/compositor/test/context_factories_for_test.h" | 27 #include "ui/compositor/test/context_factories_for_test.h" |
| 28 #include "ui/wm/core/default_activation_client.h" |
| 28 #endif | 29 #endif |
| 29 | 30 |
| 30 namespace content { | 31 namespace content { |
| 31 | 32 |
| 32 // RenderViewHostTester ------------------------------------------------------- | 33 // RenderViewHostTester ------------------------------------------------------- |
| 33 | 34 |
| 34 // static | 35 // static |
| 35 RenderViewHostTester* RenderViewHostTester::For(RenderViewHost* host) { | 36 RenderViewHostTester* RenderViewHostTester::For(RenderViewHost* host) { |
| 36 return static_cast<TestRenderViewHost*>(host); | 37 return static_cast<TestRenderViewHost*>(host); |
| 37 } | 38 } |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 ole_initializer_.reset(new ui::ScopedOleInitializer()); | 168 ole_initializer_.reset(new ui::ScopedOleInitializer()); |
| 168 #endif | 169 #endif |
| 169 #if defined(USE_AURA) | 170 #if defined(USE_AURA) |
| 170 // The ContextFactory must exist before any Compositors are created. | 171 // The ContextFactory must exist before any Compositors are created. |
| 171 bool enable_pixel_output = false; | 172 bool enable_pixel_output = false; |
| 172 ui::InitializeContextFactoryForTests(enable_pixel_output); | 173 ui::InitializeContextFactoryForTests(enable_pixel_output); |
| 173 | 174 |
| 174 aura_test_helper_.reset( | 175 aura_test_helper_.reset( |
| 175 new aura::test::AuraTestHelper(base::MessageLoopForUI::current())); | 176 new aura::test::AuraTestHelper(base::MessageLoopForUI::current())); |
| 176 aura_test_helper_->SetUp(); | 177 aura_test_helper_->SetUp(); |
| 178 new wm::DefaultActivationClient(aura_test_helper_->root_window()); |
| 177 #endif | 179 #endif |
| 178 | 180 |
| 179 DCHECK(!browser_context_); | 181 DCHECK(!browser_context_); |
| 180 browser_context_.reset(CreateBrowserContext()); | 182 browser_context_.reset(CreateBrowserContext()); |
| 181 | 183 |
| 182 SetContents(CreateTestWebContents()); | 184 SetContents(CreateTestWebContents()); |
| 183 } | 185 } |
| 184 | 186 |
| 185 void RenderViewHostTestHarness::TearDown() { | 187 void RenderViewHostTestHarness::TearDown() { |
| 186 SetContents(NULL); | 188 SetContents(NULL); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 213 BrowserContext* RenderViewHostTestHarness::CreateBrowserContext() { | 215 BrowserContext* RenderViewHostTestHarness::CreateBrowserContext() { |
| 214 return new TestBrowserContext(); | 216 return new TestBrowserContext(); |
| 215 } | 217 } |
| 216 | 218 |
| 217 void RenderViewHostTestHarness::SetRenderProcessHostFactory( | 219 void RenderViewHostTestHarness::SetRenderProcessHostFactory( |
| 218 RenderProcessHostFactory* factory) { | 220 RenderProcessHostFactory* factory) { |
| 219 rvh_test_enabler_.rvh_factory_->set_render_process_host_factory(factory); | 221 rvh_test_enabler_.rvh_factory_->set_render_process_host_factory(factory); |
| 220 } | 222 } |
| 221 | 223 |
| 222 } // namespace content | 224 } // namespace content |
| OLD | NEW |