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

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

Issue 1202593002: Move browser-to-renderer opener plumbing to frame routing IDs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@opener-create-opener-render-views
Patch Set: More cleanup Created 5 years, 5 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 d056e6ddfd6902bfd982d40b288436386f038e91..2fa4c809af8e84ea3af93c886713bdabc36ebd2f 100644
--- a/content/browser/web_contents/web_contents_impl_unittest.cc
+++ b/content/browser/web_contents/web_contents_impl_unittest.cc
@@ -912,16 +912,20 @@ TEST_F(WebContentsImplTest, FindOpenerRVHWhenPending) {
url2, Referrer(), ui::PAGE_TRANSITION_TYPED, std::string());
orig_rfh->PrepareForCommit();
TestRenderFrameHost* pending_rfh = contents()->GetPendingMainFrame();
+ SiteInstance* instance = pending_rfh->GetSiteInstance();
// While it is still pending, simulate opening a new tab with the first tab
// as its opener. This will call CreateOpenerProxies on the opener to ensure
// that an RVH exists.
- int opener_routing_id = contents()->GetRenderManager()->CreateOpenerProxies(
- pending_rfh->GetSiteInstance());
-
- // We should find the pending RVH and not create a new one.
- EXPECT_EQ(pending_rfh->GetRenderViewHost()->GetRoutingID(),
- opener_routing_id);
+ scoped_ptr<TestWebContents> popup(
+ TestWebContents::Create(browser_context(), instance));
+ popup->SetOpener(contents());
+ contents()->GetRenderManager()->CreateOpenerProxies(instance);
+
+ // We should find the pending RFH and not create a new one.
nasko 2015/07/07 16:26:21 This is only valid in regular chrome, not with --s
alexmos 2015/07/08 04:42:18 Done - see my earlier discussion.
nasko 2015/07/08 09:35:19 Acknowledged.
+ int opener_frame_routing_id =
+ popup->GetRenderManager()->GetOpenerRoutingID(instance);
+ EXPECT_EQ(pending_rfh->GetRoutingID(), opener_frame_routing_id);
}
// Tests that WebContentsImpl uses the current URL, not the SiteInstance's site,

Powered by Google App Engine
This is Rietveld 408576698