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

Side by Side 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: Fix RenderFrameHostManagerTest.CleanUpSwappedOutRVHOnProcessCrash Created 5 years, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "base/command_line.h" 5 #include "base/command_line.h"
6 #include "base/files/file_path.h" 6 #include "base/files/file_path.h"
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "base/test/histogram_tester.h" 8 #include "base/test/histogram_tester.h"
9 #include "base/time/time.h" 9 #include "base/time/time.h"
10 #include "content/browser/frame_host/cross_site_transferring_request.h" 10 #include "content/browser/frame_host/cross_site_transferring_request.h"
(...skipping 1398 matching lines...) Expand 10 before | Expand all | Expand 10 after
1409 // Fake a process crash. 1409 // Fake a process crash.
1410 RenderProcessHost::RendererClosedDetails details( 1410 RenderProcessHost::RendererClosedDetails details(
1411 base::TERMINATION_STATUS_PROCESS_CRASHED, 1411 base::TERMINATION_STATUS_PROCESS_CRASHED,
1412 0); 1412 0);
1413 NotificationService::current()->Notify( 1413 NotificationService::current()->Notify(
1414 NOTIFICATION_RENDERER_PROCESS_CLOSED, 1414 NOTIFICATION_RENDERER_PROCESS_CLOSED,
1415 Source<RenderProcessHost>(rvh1->GetProcess()), 1415 Source<RenderProcessHost>(rvh1->GetProcess()),
1416 Details<RenderProcessHost::RendererClosedDetails>(&details)); 1416 Details<RenderProcessHost::RendererClosedDetails>(&details));
1417 rvh1->set_render_view_created(false); 1417 rvh1->set_render_view_created(false);
1418 1418
1419 // Ensure that the swapped out RenderViewHost has been deleted. 1419 // Ensure that the RenderFrameProxy is deleted.
1420 EXPECT_FALSE(opener1_manager->GetSwappedOutRenderViewHost( 1420 EXPECT_FALSE(
1421 rvh1->GetSiteInstance())); 1421 opener1_manager->GetRenderFrameProxyHost(
1422 rvh1->GetSiteInstance())->is_render_frame_proxy_live());
nasko 2015/02/03 21:29:36 Let's split this into two checks: EXPECT_TRUE for
lazyboy 2015/02/03 23:15:14 Done.
nasko 2015/02/03 23:39:50 I wonder if the test can be made more realistic by
lazyboy 2015/02/03 23:55:41 Done.
1422 1423
1423 // Reload the initial tab. This should recreate the opener's swapped out RVH 1424 // Reload the initial tab. This should recreate the opener's swapped out RVH
1424 // in the original SiteInstance. 1425 // in the original SiteInstance.
1425 contents()->GetController().Reload(true); 1426 contents()->GetController().Reload(true);
1426 contents()->GetMainFrame()->PrepareForCommit(kUrl1); 1427 contents()->GetMainFrame()->PrepareForCommit(kUrl1);
1427 EXPECT_EQ(opener1_manager->GetSwappedOutRenderViewHost( 1428 EXPECT_EQ(opener1_manager->GetSwappedOutRenderViewHost(
1428 rvh1->GetSiteInstance())->GetRoutingID(), 1429 rvh1->GetSiteInstance())->GetRoutingID(),
1429 test_rvh()->opener_route_id()); 1430 test_rvh()->opener_route_id());
1430 } 1431 }
1431 1432
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after
1881 #if 0 1882 #if 0
1882 // TODO(nick): Currently a proxy to the removed frame lingers in the parent. 1883 // TODO(nick): Currently a proxy to the removed frame lingers in the parent.
1883 // Enable this assert below once the proxies to the subframe are correctly 1884 // Enable this assert below once the proxies to the subframe are correctly
1884 // cleaned up after detach. http://crbug.com/444955. 1885 // cleaned up after detach. http://crbug.com/444955.
1885 ASSERT_TRUE(site_instance->HasOneRef()) 1886 ASSERT_TRUE(site_instance->HasOneRef())
1886 << "This SiteInstance should be destroyable now."; 1887 << "This SiteInstance should be destroyable now.";
1887 #endif 1888 #endif
1888 } 1889 }
1889 1890
1890 } // namespace content 1891 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698