Chromium Code Reviews

Unified Diff: content/browser/webui/web_ui_unittest.cc

Issue 6319001: Support window.opener after a process swap. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add WasSwappedOut message for clean exit. Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Index: content/browser/webui/web_ui_unittest.cc
diff --git a/content/browser/webui/web_ui_unittest.cc b/content/browser/webui/web_ui_unittest.cc
index b81f3a811335d0df59443533ab2428fade23946a..4e6056de07d0cd14f5d9e538d940a93fd9f862b9 100644
--- a/content/browser/webui/web_ui_unittest.cc
+++ b/content/browser/webui/web_ui_unittest.cc
@@ -178,19 +178,28 @@ TEST_F(WebUITest, FocusOnNavigate) {
GURL next_url("http://google.com/");
int next_page_id = page_id + 1;
controller().LoadURL(next_url, GURL(), PageTransition::LINK);
+ TestRenderViewHost* old_rvh = rvh();
+ old_rvh->SendShouldCloseACK(true);
pending_rvh()->SendNavigate(next_page_id, next_url);
+ old_rvh->OnSwapOutACK();
// Navigate back. Should focus the location bar.
int focus_called = tc->focus_called();
ASSERT_TRUE(controller().CanGoBack());
controller().GoBack();
+ old_rvh = rvh();
+ old_rvh->SendShouldCloseACK(true);
pending_rvh()->SendNavigate(page_id, new_tab_url);
+ old_rvh->OnSwapOutACK();
EXPECT_LT(focus_called, tc->focus_called());
// Navigate forward. Shouldn't focus the location bar.
focus_called = tc->focus_called();
ASSERT_TRUE(controller().CanGoForward());
controller().GoForward();
+ old_rvh = rvh();
+ old_rvh->SendShouldCloseACK(true);
pending_rvh()->SendNavigate(next_page_id, next_url);
+ old_rvh->OnSwapOutACK();
EXPECT_EQ(focus_called, tc->focus_called());
}

Powered by Google App Engine