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

Unified Diff: content/browser/frame_host/render_frame_host_manager_unittest.cc

Issue 782093002: Ensure that before creating proxy of site A, RVH of site A is initialized. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: sync @tott Created 5 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
Index: content/browser/frame_host/render_frame_host_manager_unittest.cc
diff --git a/content/browser/frame_host/render_frame_host_manager_unittest.cc b/content/browser/frame_host/render_frame_host_manager_unittest.cc
index 079c6c4a3e1ea1b9d31f970bc5f0c7aec142dcb6..7b9cf27a7e2a9ff18024fae7c92b70432ed8e669 100644
--- a/content/browser/frame_host/render_frame_host_manager_unittest.cc
+++ b/content/browser/frame_host/render_frame_host_manager_unittest.cc
@@ -1410,15 +1410,25 @@ TEST_F(RenderFrameHostManagerTest, CleanUpSwappedOutRVHOnProcessCrash) {
RenderProcessHost::RendererClosedDetails details(
base::TERMINATION_STATUS_PROCESS_CRASHED,
0);
+ // TODO(nasko): Investigate whether this test can be made more realistic by
+ // not faking the notification and just doing the RenderProcessGone. This
+ // should also get rid of faking |set_render_view_created()| call below.
NotificationService::current()->Notify(
NOTIFICATION_RENDERER_PROCESS_CLOSED,
Source<RenderProcessHost>(rvh1->GetProcess()),
Details<RenderProcessHost::RendererClosedDetails>(&details));
rvh1->set_render_view_created(false);
- // Ensure that the swapped out RenderViewHost has been deleted.
- EXPECT_FALSE(opener1_manager->GetSwappedOutRenderViewHost(
- rvh1->GetSiteInstance()));
+ // Ensure that the RenderFrameProxyHost stays around and the RenderFrameProxy
+ // is deleted.
+ RenderFrameProxyHost* render_frame_proxy_host =
+ opener1_manager->GetRenderFrameProxyHost(rvh1->GetSiteInstance());
+ EXPECT_TRUE(render_frame_proxy_host);
+ EXPECT_FALSE(render_frame_proxy_host->is_render_frame_proxy_live());
+
+ // Expect the swapped out RVH to exist.
+ EXPECT_TRUE(opener1_manager->GetSwappedOutRenderViewHost(
+ rvh1->GetSiteInstance()));
// Reload the initial tab. This should recreate the opener's swapped out RVH
// in the original SiteInstance.
« no previous file with comments | « content/browser/frame_host/render_frame_host_manager.cc ('k') | content/browser/frame_host/render_frame_proxy_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698