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 "content/browser/renderer_host/render_view_host_factory.h" | 7 #include "content/browser/renderer_host/render_view_host_factory.h" |
8 #include "content/browser/renderer_host/test_render_view_host.h" | 8 #include "content/browser/renderer_host/test_render_view_host.h" |
9 #include "content/browser/site_instance_impl.h" | 9 #include "content/browser/site_instance_impl.h" |
10 #include "content/browser/web_contents/navigation_entry_impl.h" | 10 #include "content/browser/web_contents/navigation_entry_impl.h" |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 | 136 |
137 void RenderViewHostTestHarness::TearDown() { | 137 void RenderViewHostTestHarness::TearDown() { |
138 SetContents(NULL); | 138 SetContents(NULL); |
139 #if defined(USE_AURA) | 139 #if defined(USE_AURA) |
140 aura_test_helper_->TearDown(); | 140 aura_test_helper_->TearDown(); |
141 #endif | 141 #endif |
142 // Make sure that we flush any messages related to WebContentsImpl destruction | 142 // Make sure that we flush any messages related to WebContentsImpl destruction |
143 // before we destroy the browser context. | 143 // before we destroy the browser context. |
144 MessageLoop::current()->RunAllPending(); | 144 MessageLoop::current()->RunAllPending(); |
145 | 145 |
| 146 // Delete any RenderProcessHosts before the BrowserContext goes away. |
| 147 if (rvh_test_enabler_.rph_factory_.get()) |
| 148 rvh_test_enabler_.rph_factory_.reset(); |
| 149 |
146 // Release the browser context on the UI thread. | 150 // Release the browser context on the UI thread. |
147 message_loop_.DeleteSoon(FROM_HERE, browser_context_.release()); | 151 message_loop_.DeleteSoon(FROM_HERE, browser_context_.release()); |
148 message_loop_.RunAllPending(); | 152 message_loop_.RunAllPending(); |
149 } | 153 } |
150 | 154 |
151 void RenderViewHostTestHarness::SetRenderProcessHostFactory( | 155 void RenderViewHostTestHarness::SetRenderProcessHostFactory( |
152 RenderProcessHostFactory* factory) { | 156 RenderProcessHostFactory* factory) { |
153 rvh_test_enabler_.rvh_factory_->set_render_process_host_factory(factory); | 157 rvh_test_enabler_.rvh_factory_->set_render_process_host_factory(factory); |
154 } | 158 } |
155 | 159 |
156 } // namespace content | 160 } // namespace content |
OLD | NEW |