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

Unified Diff: content/browser/tab_contents/render_view_host_manager_unittest.cc

Issue 6973073: Avoid canceling a pending navigation if the old RVH commits right away. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix failing unit tests. Created 9 years, 7 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/tab_contents/render_view_host_manager_unittest.cc
diff --git a/content/browser/tab_contents/render_view_host_manager_unittest.cc b/content/browser/tab_contents/render_view_host_manager_unittest.cc
index 1e31d92d83882774e91a24971770bdcf0e380930..9b5883b5ff5173b09db90fb79b2e13ac8f9d3271 100644
--- a/content/browser/tab_contents/render_view_host_manager_unittest.cc
+++ b/content/browser/tab_contents/render_view_host_manager_unittest.cc
@@ -71,14 +71,20 @@ TEST_F(RenderViewHostManagerTest, NewTabPageProcesses) {
// Load the two URLs in the second tab. Note that the first navigation creates
// a RVH that's not pending (since there is no cross-site transition), so
- // we use the committed one, but the second one is the opposite.
+ // we use the committed one.
contents2.controller().LoadURL(kNtpUrl, GURL(), PageTransition::LINK);
TestRenderViewHost* ntp_rvh2 = static_cast<TestRenderViewHost*>(
contents2.render_manager()->current_host());
+ EXPECT_FALSE(contents2.cross_navigation_pending());
ntp_rvh2->SendNavigate(100, kNtpUrl);
+
+ // The second one is the opposite, creating a cross-site transition and
+ // requiring a beforeunload ack.
contents2.controller().LoadURL(kDestUrl, GURL(), PageTransition::LINK);
TestRenderViewHost* dest_rvh2 = static_cast<TestRenderViewHost*>(
contents2.render_manager()->pending_render_view_host());
+ EXPECT_TRUE(contents2.cross_navigation_pending());
+ ntp_rvh2->SendShouldCloseACK(true);
dest_rvh2->SendNavigate(101, kDestUrl);
ntp_rvh2->OnSwapOutACK();

Powered by Google App Engine
This is Rietveld 408576698