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

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

Issue 6319001: Support window.opener after a process swap. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge with trunk. 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
« no previous file with comments | « content/browser/tab_contents/tab_contents.cc ('k') | content/common/content_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/tab_contents/test_tab_contents.cc
diff --git a/content/browser/tab_contents/test_tab_contents.cc b/content/browser/tab_contents/test_tab_contents.cc
index 33a5a2b3f10cec2ce3d5ebfdd445cbb78f8b3950..18860fc076ddd72c4e229693231d6dd8f3336ec0 100644
--- a/content/browser/tab_contents/test_tab_contents.cc
+++ b/content/browser/tab_contents/test_tab_contents.cc
@@ -85,9 +85,10 @@ void TestTabContents::CommitPendingNavigation() {
// notifying that it has unloaded so the pending RVH is resumed and can
// navigate.
ProceedWithCrossSiteNavigation();
+ RenderViewHost* old_rvh = render_manager_.current_host();
TestRenderViewHost* rvh = pending_rvh();
if (!rvh)
- rvh = static_cast<TestRenderViewHost*>(render_manager_.current_host());
+ rvh = static_cast<TestRenderViewHost*>(old_rvh);
const NavigationEntry* entry = controller().pending_entry();
DCHECK(entry);
@@ -98,6 +99,11 @@ void TestTabContents::CommitPendingNavigation() {
static_cast<MockRenderProcessHost*>(rvh->process())->max_page_id() + 1;
}
rvh->SendNavigate(page_id, entry->url());
+
+ // Simulate the SwapOut_ACK that fires if you commit a cross-site navigation
+ // without making any network requests.
+ if (old_rvh != rvh)
+ old_rvh->OnSwapOutACK();
}
void TestTabContents::ProceedWithCrossSiteNavigation() {
« no previous file with comments | « content/browser/tab_contents/tab_contents.cc ('k') | content/common/content_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698