Index: content/test/test_renderer_host.cc |
diff --git a/content/test/test_renderer_host.cc b/content/test/test_renderer_host.cc |
index ee1adf2aa98e029b299646773de98e317e810675..b827d687cef6e69d9177cdf6bf4571423f182cf8 100644 |
--- a/content/test/test_renderer_host.cc |
+++ b/content/test/test_renderer_host.cc |
@@ -143,6 +143,10 @@ void RenderViewHostTestHarness::TearDown() { |
// before we destroy the browser context. |
MessageLoop::current()->RunAllPending(); |
+ // Delete any RenderProcessHosts before the BrowserContext goes away. |
+ if (rvh_test_enabler_.rph_factory_.get()) |
+ rvh_test_enabler_.rph_factory_.reset(); |
+ |
// Release the browser context on the UI thread. |
message_loop_.DeleteSoon(FROM_HERE, browser_context_.release()); |
message_loop_.RunAllPending(); |