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

Unified Diff: content/browser/web_contents/web_contents_impl_unittest.cc

Issue 117693002: Make RenderFrameHostManager swap RenderFrameHosts, not RenderViewHosts. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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
« no previous file with comments | « content/browser/web_contents/web_contents_impl.cc ('k') | content/renderer/dom_serializer_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/web_contents/web_contents_impl_unittest.cc
diff --git a/content/browser/web_contents/web_contents_impl_unittest.cc b/content/browser/web_contents/web_contents_impl_unittest.cc
index 72aa6a09f2be6d3055fa532f4400201f03b3be38..c9654e2c34e7f4146caa809d51d413b992869929 100644
--- a/content/browser/web_contents/web_contents_impl_unittest.cc
+++ b/content/browser/web_contents/web_contents_impl_unittest.cc
@@ -423,6 +423,8 @@ TEST_F(WebContentsImplTest, NavigateToExcessivelyLongURL) {
TEST_F(WebContentsImplTest, CrossSiteBoundaries) {
contents()->transition_cross_site = true;
TestRenderViewHost* orig_rvh = test_rvh();
+ RenderFrameHostImpl* orig_rfh =
+ contents()->GetFrameTree()->root()->current_frame_host();
int orig_rvh_delete_count = 0;
orig_rvh->set_delete_counter(&orig_rvh_delete_count);
SiteInstance* instance1 = contents()->GetSiteInstance();
@@ -455,6 +457,8 @@ TEST_F(WebContentsImplTest, CrossSiteBoundaries) {
static_cast<TestRenderViewHost*>(contents()->GetPendingRenderViewHost());
int pending_rvh_delete_count = 0;
pending_rvh->set_delete_counter(&pending_rvh_delete_count);
+ RenderFrameHostImpl* pending_rfh = contents()->GetFrameTree()->root()->
+ render_manager()->pending_frame_host();
// Navigations should be suspended in pending_rvh until ShouldCloseACK.
EXPECT_TRUE(pending_rvh->are_navigations_suspended());
@@ -478,9 +482,9 @@ TEST_F(WebContentsImplTest, CrossSiteBoundaries) {
EXPECT_EQ(url2, contents()->GetVisibleURL());
EXPECT_NE(instance1, instance2);
EXPECT_TRUE(contents()->GetPendingRenderViewHost() == NULL);
- // We keep the original RVH around, swapped out.
+ // We keep the original RFH around, swapped out.
EXPECT_TRUE(contents()->GetRenderManagerForTesting()->IsOnSwappedOutList(
- orig_rvh));
+ orig_rfh));
EXPECT_EQ(orig_rvh_delete_count, 0);
// Going back should switch SiteInstances again. The first SiteInstance is
@@ -503,9 +507,9 @@ TEST_F(WebContentsImplTest, CrossSiteBoundaries) {
EXPECT_FALSE(contents()->cross_navigation_pending());
EXPECT_EQ(goback_rvh, contents()->GetRenderViewHost());
EXPECT_EQ(instance1, contents()->GetSiteInstance());
- // The pending RVH should now be swapped out, not deleted.
+ // The pending RFH should now be swapped out, not deleted.
EXPECT_TRUE(contents()->GetRenderManagerForTesting()->
- IsOnSwappedOutList(pending_rvh));
+ IsOnSwappedOutList(pending_rfh));
EXPECT_EQ(pending_rvh_delete_count, 0);
// Close contents and ensure RVHs are deleted.
@@ -628,6 +632,8 @@ TEST_F(WebContentsImplTest, NavigateDoesNotUseUpSiteInstance) {
contents()->transition_cross_site = true;
TestRenderViewHost* orig_rvh = test_rvh();
+ RenderFrameHostImpl* orig_rfh =
+ contents()->GetFrameTree()->root()->current_frame_host();
int orig_rvh_delete_count = 0;
orig_rvh->set_delete_counter(&orig_rvh_delete_count);
SiteInstanceImpl* orig_instance =
@@ -698,9 +704,9 @@ TEST_F(WebContentsImplTest, NavigateDoesNotUseUpSiteInstance) {
EXPECT_EQ(url2, contents()->GetVisibleURL());
EXPECT_NE(new_instance, orig_instance);
EXPECT_FALSE(contents()->GetPendingRenderViewHost());
- // We keep the original RVH around, swapped out.
+ // We keep the original RFH around, swapped out.
EXPECT_TRUE(contents()->GetRenderManagerForTesting()->IsOnSwappedOutList(
- orig_rvh));
+ orig_rfh));
EXPECT_EQ(orig_rvh_delete_count, 0);
// Close contents and ensure RVHs are deleted.
« no previous file with comments | « content/browser/web_contents/web_contents_impl.cc ('k') | content/renderer/dom_serializer_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698