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

Unified Diff: chrome/browser/renderer_host/test_render_view_host.cc

Issue 18432: Factor out the test web contents from the WebContents unit test so that it ca... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/renderer_host/test_render_view_host.h ('k') | chrome/browser/tab_contents/site_instance.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/renderer_host/test_render_view_host.cc
===================================================================
--- chrome/browser/renderer_host/test_render_view_host.cc (revision 8331)
+++ chrome/browser/renderer_host/test_render_view_host.cc (working copy)
@@ -3,6 +3,7 @@
// found in the LICENSE file.
#include "chrome/browser/renderer_host/test_render_view_host.h"
+#include "chrome/browser/tab_contents/test_web_contents.h"
TestRenderViewHost::TestRenderViewHost(SiteInstance* instance,
RenderViewHostDelegate* delegate,
@@ -60,15 +61,15 @@
}
void RenderViewHostTestHarness::SetUp() {
+ // See comment above profile_ decl for why we check for NULL here.
+ if (!profile_.get())
+ profile_.reset(new TestingProfile());
+
// This will be deleted when the WebContents goes away.
- SiteInstance* instance = SiteInstance::CreateSiteInstance(&profile_);
+ SiteInstance* instance = SiteInstance::CreateSiteInstance(profile_.get());
- // Make the SiteInstance use our RenderProcessHost as its own.
- process_ = new MockRenderProcessHost(&profile_);
- instance->set_process_host_id(process_->host_id());
-
- contents_ = new WebContents(&profile_, instance, &rvh_factory_, 12, NULL);
- controller_ = new NavigationController(contents_, &profile_);
+ contents_ = new TestWebContents(profile_.get(), instance, &rvh_factory_);
+ controller_ = new NavigationController(contents_, profile_.get());
}
void RenderViewHostTestHarness::TearDown() {
« no previous file with comments | « chrome/browser/renderer_host/test_render_view_host.h ('k') | chrome/browser/tab_contents/site_instance.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698