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

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

Issue 88503002: Have the unload event execute in background on cross-site navigations (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase + addressed some of Nasko's comments Created 6 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/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 8ac7161358eb4f900b9bffbed1b448b04d4e71a5..86af23fbc727a971213c093a66a477ad6c431212 100644
--- a/content/browser/web_contents/web_contents_impl_unittest.cc
+++ b/content/browser/web_contents/web_contents_impl_unittest.cc
@@ -512,6 +512,7 @@ TEST_F(WebContentsImplTest, CrossSiteBoundaries) {
EXPECT_TRUE(contents()->GetRenderManagerForTesting()->
IsOnSwappedOutList(pending_rfh));
EXPECT_EQ(pending_rvh_delete_count, 0);
+ pending_rvh->OnSwappedOut(false);
// Close contents and ensure RVHs are deleted.
DeleteContents();
@@ -709,6 +710,7 @@ TEST_F(WebContentsImplTest, NavigateDoesNotUseUpSiteInstance) {
EXPECT_TRUE(contents()->GetRenderManagerForTesting()->IsOnSwappedOutList(
orig_rfh));
EXPECT_EQ(orig_rvh_delete_count, 0);
+ orig_rvh->OnSwappedOut(false);
// Close contents and ensure RVHs are deleted.
DeleteContents();
@@ -1136,7 +1138,7 @@ TEST_F(WebContentsImplTest, CrossSiteNavigationCanceled) {
EXPECT_TRUE(contents()->cross_navigation_pending());
// Simulate swap out message when the response arrives.
- orig_rvh->set_is_swapped_out(true);
+ orig_rvh->OnSwappedOut(false);
// Suppose the navigation doesn't get a chance to commit, and the user
// navigates in the current RVH's SiteInstance.
@@ -1148,7 +1150,7 @@ TEST_F(WebContentsImplTest, CrossSiteNavigationCanceled) {
SiteInstance* instance2 = contents()->GetSiteInstance();
EXPECT_FALSE(contents()->cross_navigation_pending());
EXPECT_EQ(orig_rvh, rvh());
- EXPECT_FALSE(orig_rvh->is_swapped_out());
+ EXPECT_EQ(RenderViewHostImpl::STATE_LIVE, orig_rvh->rvh_state());
EXPECT_EQ(instance1, instance2);
EXPECT_TRUE(contents()->GetPendingRenderViewHost() == NULL);
}

Powered by Google App Engine
This is Rietveld 408576698