Factor out the test web contents from the WebContents unit test so that it can
be used by other tests. Properly hook up the MockRenderProcessHost so it gets
created when initialized by SiteInstances through a factory object. Fix other
bugs with the test harness I found when I switched all the WebContents test
over to using it.
Review URL: http://codereview.chromium.org/18432
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8416 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/tab_contents/site_instance.cc b/chrome/browser/tab_contents/site_instance.cc
index 71a171e..832d8dbf 100644
--- a/chrome/browser/tab_contents/site_instance.cc
+++ b/chrome/browser/tab_contents/site_instance.cc
@@ -28,8 +28,14 @@
browsing_instance_->profile());
// Otherwise (or if that fails), create a new one.
- if (!process)
- process = new BrowserRenderProcessHost(browsing_instance_->profile());
+ if (!process) {
+ if (render_process_host_factory_) {
+ process = render_process_host_factory_->CreateRenderProcessHost(
+ browsing_instance_->profile());
+ } else {
+ process = new BrowserRenderProcessHost(browsing_instance_->profile());
+ }
+ }
// Update our host ID, so all pages in this SiteInstance will use
// the correct process.