| 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/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
| 9 #include "content/browser/frame_host/navigation_entry_impl.h" | 9 #include "content/browser/frame_host/navigation_entry_impl.h" |
| 10 #include "content/browser/renderer_host/render_view_host_factory.h" | 10 #include "content/browser/renderer_host/render_view_host_factory.h" |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 // Make sure we ran SetUp() already. | 144 // Make sure we ran SetUp() already. |
| 145 #if defined(OS_WIN) | 145 #if defined(OS_WIN) |
| 146 DCHECK(ole_initializer_ != NULL); | 146 DCHECK(ole_initializer_ != NULL); |
| 147 #endif | 147 #endif |
| 148 #if defined(USE_AURA) | 148 #if defined(USE_AURA) |
| 149 DCHECK(aura_test_helper_ != NULL); | 149 DCHECK(aura_test_helper_ != NULL); |
| 150 #endif | 150 #endif |
| 151 | 151 |
| 152 // This will be deleted when the WebContentsImpl goes away. | 152 // This will be deleted when the WebContentsImpl goes away. |
| 153 SiteInstance* instance = SiteInstance::Create(browser_context_.get()); | 153 SiteInstance* instance = SiteInstance::Create(browser_context_.get()); |
| 154 instance->GetProcess()->Init(); |
| 154 | 155 |
| 155 return TestWebContents::Create(browser_context_.get(), instance); | 156 return TestWebContents::Create(browser_context_.get(), instance); |
| 156 } | 157 } |
| 157 | 158 |
| 158 void RenderViewHostTestHarness::NavigateAndCommit(const GURL& url) { | 159 void RenderViewHostTestHarness::NavigateAndCommit(const GURL& url) { |
| 159 static_cast<TestWebContents*>(web_contents())->NavigateAndCommit(url); | 160 static_cast<TestWebContents*>(web_contents())->NavigateAndCommit(url); |
| 160 } | 161 } |
| 161 | 162 |
| 162 void RenderViewHostTestHarness::Reload() { | 163 void RenderViewHostTestHarness::Reload() { |
| 163 NavigationEntry* entry = controller().GetLastCommittedEntry(); | 164 NavigationEntry* entry = controller().GetLastCommittedEntry(); |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 BrowserContext* RenderViewHostTestHarness::CreateBrowserContext() { | 246 BrowserContext* RenderViewHostTestHarness::CreateBrowserContext() { |
| 246 return new TestBrowserContext(); | 247 return new TestBrowserContext(); |
| 247 } | 248 } |
| 248 | 249 |
| 249 void RenderViewHostTestHarness::SetRenderProcessHostFactory( | 250 void RenderViewHostTestHarness::SetRenderProcessHostFactory( |
| 250 RenderProcessHostFactory* factory) { | 251 RenderProcessHostFactory* factory) { |
| 251 rvh_test_enabler_.rvh_factory_->set_render_process_host_factory(factory); | 252 rvh_test_enabler_.rvh_factory_->set_render_process_host_factory(factory); |
| 252 } | 253 } |
| 253 | 254 |
| 254 } // namespace content | 255 } // namespace content |
| OLD | NEW |