OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/logging.h" | 6 #include "base/logging.h" |
7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "content/browser/frame_host/cross_site_transferring_request.h" | 8 #include "content/browser/frame_host/cross_site_transferring_request.h" |
9 #include "content/browser/frame_host/interstitial_page_impl.h" | 9 #include "content/browser/frame_host/interstitial_page_impl.h" |
10 #include "content/browser/frame_host/navigation_entry_impl.h" | 10 #include "content/browser/frame_host/navigation_entry_impl.h" |
(...skipping 904 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
915 orig_rfh->PrepareForCommit(); | 915 orig_rfh->PrepareForCommit(); |
916 TestRenderFrameHost* pending_rfh = contents()->GetPendingMainFrame(); | 916 TestRenderFrameHost* pending_rfh = contents()->GetPendingMainFrame(); |
917 SiteInstance* instance = pending_rfh->GetSiteInstance(); | 917 SiteInstance* instance = pending_rfh->GetSiteInstance(); |
918 | 918 |
919 // While it is still pending, simulate opening a new tab with the first tab | 919 // While it is still pending, simulate opening a new tab with the first tab |
920 // as its opener. This will call CreateOpenerProxies on the opener to ensure | 920 // as its opener. This will call CreateOpenerProxies on the opener to ensure |
921 // that an RVH exists. | 921 // that an RVH exists. |
922 scoped_ptr<TestWebContents> popup( | 922 scoped_ptr<TestWebContents> popup( |
923 TestWebContents::Create(browser_context(), instance)); | 923 TestWebContents::Create(browser_context(), instance)); |
924 popup->SetOpener(contents()); | 924 popup->SetOpener(contents()); |
925 contents()->GetRenderManager()->CreateOpenerProxies(instance); | 925 contents()->GetRenderManager()->CreateOpenerProxies(instance, nullptr); |
926 | 926 |
927 // If swapped out is forbidden, a new proxy should be created for the opener | 927 // If swapped out is forbidden, a new proxy should be created for the opener |
928 // in |instance|, and we should ensure that its routing ID is returned here. | 928 // in |instance|, and we should ensure that its routing ID is returned here. |
929 // Otherwise, we should find the pending RFH and not create a new proxy. | 929 // Otherwise, we should find the pending RFH and not create a new proxy. |
930 int opener_frame_routing_id = | 930 int opener_frame_routing_id = |
931 popup->GetRenderManager()->GetOpenerRoutingID(instance); | 931 popup->GetRenderManager()->GetOpenerRoutingID(instance); |
932 RenderFrameProxyHost* proxy = | 932 RenderFrameProxyHost* proxy = |
933 contents()->GetRenderManager()->GetRenderFrameProxyHost(instance); | 933 contents()->GetRenderManager()->GetRenderFrameProxyHost(instance); |
934 if (SiteIsolationPolicy::IsSwappedOutStateForbidden()) { | 934 if (SiteIsolationPolicy::IsSwappedOutStateForbidden()) { |
935 EXPECT_TRUE(proxy); | 935 EXPECT_TRUE(proxy); |
(...skipping 2384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3320 MockRenderProcessHost* rph = contents()->GetMainFrame()->GetProcess(); | 3320 MockRenderProcessHost* rph = contents()->GetMainFrame()->GetProcess(); |
3321 EXPECT_EQ(0, rph->bad_msg_count()); | 3321 EXPECT_EQ(0, rph->bad_msg_count()); |
3322 | 3322 |
3323 contents()->OnDidLoadResourceFromMemoryCache( | 3323 contents()->OnDidLoadResourceFromMemoryCache( |
3324 GURL("http://example.test"), "not valid security info", "GET", | 3324 GURL("http://example.test"), "not valid security info", "GET", |
3325 "mime type", RESOURCE_TYPE_MAIN_FRAME); | 3325 "mime type", RESOURCE_TYPE_MAIN_FRAME); |
3326 EXPECT_EQ(1, rph->bad_msg_count()); | 3326 EXPECT_EQ(1, rph->bad_msg_count()); |
3327 } | 3327 } |
3328 | 3328 |
3329 } // namespace content | 3329 } // namespace content |
OLD | NEW |