Chromium Code Reviews| 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 7926b4c424c15870e49e6e68e28669036f5662ec..be6b234a5bd2b54094fb6844c8f541810d92e1d4 100644 |
| --- a/content/browser/web_contents/web_contents_impl_unittest.cc |
| +++ b/content/browser/web_contents/web_contents_impl_unittest.cc |
| @@ -183,7 +183,7 @@ class TestInterstitialPage : public InterstitialPageImpl { |
| virtual RenderViewHost* CreateRenderViewHost() OVERRIDE { |
| return new TestRenderViewHost( |
|
Charlie Reis
2013/12/17 19:39:22
This TestRVH was leaking in the test, since we now
|
| SiteInstance::Create(web_contents()->GetBrowserContext()), |
| - this, this, this, MSG_ROUTING_NONE, MSG_ROUTING_NONE, false); |
| + this, this, MSG_ROUTING_NONE, MSG_ROUTING_NONE, false); |
| } |
| virtual WebContentsView* CreateWebContentsView() OVERRIDE { |
| @@ -428,6 +428,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(); |
| @@ -460,6 +462,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()); |
| @@ -483,9 +487,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 |
| @@ -508,9 +512,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. |
| @@ -633,6 +637,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 = |
| @@ -703,9 +709,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. |