OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "content/browser/frame_host/render_frame_host_manager.h" | 5 #include "content/browser/frame_host/render_frame_host_manager.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
760 return; | 760 return; |
761 } | 761 } |
762 | 762 |
763 // Navigate to the first site. | 763 // Navigate to the first site. |
764 NavigateActiveAndCommit(kUrl1); | 764 NavigateActiveAndCommit(kUrl1); |
765 TestRenderFrameHost* initial_rfh = contents()->GetMainFrame(); | 765 TestRenderFrameHost* initial_rfh = contents()->GetMainFrame(); |
766 { | 766 { |
767 RenderFrameHostCreatedObserver observer(contents()); | 767 RenderFrameHostCreatedObserver observer(contents()); |
768 initial_rfh->OnCreateChildFrame( | 768 initial_rfh->OnCreateChildFrame( |
769 initial_rfh->GetProcess()->GetNextRoutingID(), | 769 initial_rfh->GetProcess()->GetNextRoutingID(), |
770 blink::WebTreeScopeType::Document, std::string(), | 770 blink::WebTreeScopeType::Document, std::string(), "uniqueName1", |
771 blink::WebSandboxFlags::None, blink::WebFrameOwnerProperties()); | 771 blink::WebSandboxFlags::None, blink::WebFrameOwnerProperties()); |
772 EXPECT_TRUE(observer.created()); | 772 EXPECT_TRUE(observer.created()); |
773 } | 773 } |
774 | 774 |
775 // Create one more frame in the same SiteInstance where initial_rfh | 775 // Create one more frame in the same SiteInstance where initial_rfh |
776 // exists so that initial_rfh doesn't get deleted on navigation to another | 776 // exists so that initial_rfh doesn't get deleted on navigation to another |
777 // site. | 777 // site. |
778 initial_rfh->GetSiteInstance()->IncrementActiveFrameCount(); | 778 initial_rfh->GetSiteInstance()->IncrementActiveFrameCount(); |
779 | 779 |
780 // Navigate to a cross-site URL. | 780 // Navigate to a cross-site URL. |
781 NavigateActiveAndCommit(kUrl2); | 781 NavigateActiveAndCommit(kUrl2); |
782 EXPECT_TRUE(initial_rfh->is_swapped_out()); | 782 EXPECT_TRUE(initial_rfh->is_swapped_out()); |
783 | 783 |
784 TestRenderFrameHost* dest_rfh = contents()->GetMainFrame(); | 784 TestRenderFrameHost* dest_rfh = contents()->GetMainFrame(); |
785 ASSERT_TRUE(dest_rfh); | 785 ASSERT_TRUE(dest_rfh); |
786 EXPECT_NE(initial_rfh, dest_rfh); | 786 EXPECT_NE(initial_rfh, dest_rfh); |
787 | 787 |
788 { | 788 { |
789 // Since the old RFH is now swapped out, it shouldn't process any messages | 789 // Since the old RFH is now swapped out, it shouldn't process any messages |
790 // to create child frames. | 790 // to create child frames. |
791 RenderFrameHostCreatedObserver observer(contents()); | 791 RenderFrameHostCreatedObserver observer(contents()); |
792 initial_rfh->OnCreateChildFrame( | 792 initial_rfh->OnCreateChildFrame( |
793 initial_rfh->GetProcess()->GetNextRoutingID(), | 793 initial_rfh->GetProcess()->GetNextRoutingID(), |
794 blink::WebTreeScopeType::Document, std::string(), | 794 blink::WebTreeScopeType::Document, std::string(), "uniqueName2", |
795 blink::WebSandboxFlags::None, blink::WebFrameOwnerProperties()); | 795 blink::WebSandboxFlags::None, blink::WebFrameOwnerProperties()); |
796 EXPECT_FALSE(observer.created()); | 796 EXPECT_FALSE(observer.created()); |
797 } | 797 } |
798 } | 798 } |
799 | 799 |
800 TEST_F(RenderFrameHostManagerTest, WhiteListSwapCompositorFrame) { | 800 TEST_F(RenderFrameHostManagerTest, WhiteListSwapCompositorFrame) { |
801 // TODO(nasko): Check with kenrb whether this test can be rewritten and | 801 // TODO(nasko): Check with kenrb whether this test can be rewritten and |
802 // whether it makes sense when swapped out is replaced with proxies. | 802 // whether it makes sense when swapped out is replaced with proxies. |
803 if (SiteIsolationPolicy::IsSwappedOutStateForbidden()) { | 803 if (SiteIsolationPolicy::IsSwappedOutStateForbidden()) { |
804 return; | 804 return; |
(...skipping 1350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2155 // deleted when the node is detached. Motivated by http://crbug.com/441357 and | 2155 // deleted when the node is detached. Motivated by http://crbug.com/441357 and |
2156 // http://crbug.com/444955. | 2156 // http://crbug.com/444955. |
2157 TEST_F(RenderFrameHostManagerTestWithSiteIsolation, DetachPendingChild) { | 2157 TEST_F(RenderFrameHostManagerTestWithSiteIsolation, DetachPendingChild) { |
2158 const GURL kUrlA("http://www.google.com/"); | 2158 const GURL kUrlA("http://www.google.com/"); |
2159 const GURL kUrlB("http://webkit.org/"); | 2159 const GURL kUrlB("http://webkit.org/"); |
2160 | 2160 |
2161 // Create a page with two child frames. | 2161 // Create a page with two child frames. |
2162 contents()->NavigateAndCommit(kUrlA); | 2162 contents()->NavigateAndCommit(kUrlA); |
2163 contents()->GetMainFrame()->OnCreateChildFrame( | 2163 contents()->GetMainFrame()->OnCreateChildFrame( |
2164 contents()->GetMainFrame()->GetProcess()->GetNextRoutingID(), | 2164 contents()->GetMainFrame()->GetProcess()->GetNextRoutingID(), |
2165 blink::WebTreeScopeType::Document, "frame_name", | 2165 blink::WebTreeScopeType::Document, "frame_name", "uniqueName1", |
2166 blink::WebSandboxFlags::None, blink::WebFrameOwnerProperties()); | 2166 blink::WebSandboxFlags::None, blink::WebFrameOwnerProperties()); |
2167 contents()->GetMainFrame()->OnCreateChildFrame( | 2167 contents()->GetMainFrame()->OnCreateChildFrame( |
2168 contents()->GetMainFrame()->GetProcess()->GetNextRoutingID(), | 2168 contents()->GetMainFrame()->GetProcess()->GetNextRoutingID(), |
2169 blink::WebTreeScopeType::Document, "frame_name", | 2169 blink::WebTreeScopeType::Document, "frame_name", "uniqueName2", |
2170 blink::WebSandboxFlags::None, blink::WebFrameOwnerProperties()); | 2170 blink::WebSandboxFlags::None, blink::WebFrameOwnerProperties()); |
2171 RenderFrameHostManager* root_manager = | 2171 RenderFrameHostManager* root_manager = |
2172 contents()->GetFrameTree()->root()->render_manager(); | 2172 contents()->GetFrameTree()->root()->render_manager(); |
2173 RenderFrameHostManager* iframe1 = | 2173 RenderFrameHostManager* iframe1 = |
2174 contents()->GetFrameTree()->root()->child_at(0)->render_manager(); | 2174 contents()->GetFrameTree()->root()->child_at(0)->render_manager(); |
2175 RenderFrameHostManager* iframe2 = | 2175 RenderFrameHostManager* iframe2 = |
2176 contents()->GetFrameTree()->root()->child_at(1)->render_manager(); | 2176 contents()->GetFrameTree()->root()->child_at(1)->render_manager(); |
2177 | 2177 |
2178 // 1) The first navigation. | 2178 // 1) The first navigation. |
2179 NavigationEntryImpl entryA(NULL /* instance */, -1 /* page_id */, kUrlA, | 2179 NavigationEntryImpl entryA(NULL /* instance */, -1 /* page_id */, kUrlA, |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2296 | 2296 |
2297 // Reload |contents1|. | 2297 // Reload |contents1|. |
2298 contents1->NavigateAndCommit(kUrl1); | 2298 contents1->NavigateAndCommit(kUrl1); |
2299 EXPECT_TRUE(contents1->GetMainFrame()->IsRenderFrameLive()); | 2299 EXPECT_TRUE(contents1->GetMainFrame()->IsRenderFrameLive()); |
2300 EXPECT_FALSE(contents2->GetMainFrame()->IsRenderFrameLive()); | 2300 EXPECT_FALSE(contents2->GetMainFrame()->IsRenderFrameLive()); |
2301 EXPECT_EQ(contents1->GetSiteInstance(), contents2->GetSiteInstance()); | 2301 EXPECT_EQ(contents1->GetSiteInstance(), contents2->GetSiteInstance()); |
2302 | 2302 |
2303 // |contents1| creates an out of process iframe. | 2303 // |contents1| creates an out of process iframe. |
2304 contents1->GetMainFrame()->OnCreateChildFrame( | 2304 contents1->GetMainFrame()->OnCreateChildFrame( |
2305 contents1->GetMainFrame()->GetProcess()->GetNextRoutingID(), | 2305 contents1->GetMainFrame()->GetProcess()->GetNextRoutingID(), |
2306 blink::WebTreeScopeType::Document, "frame_name", | 2306 blink::WebTreeScopeType::Document, "frame_name", "uniqueName1", |
2307 blink::WebSandboxFlags::None, blink::WebFrameOwnerProperties()); | 2307 blink::WebSandboxFlags::None, blink::WebFrameOwnerProperties()); |
2308 RenderFrameHostManager* iframe = | 2308 RenderFrameHostManager* iframe = |
2309 contents()->GetFrameTree()->root()->child_at(0)->render_manager(); | 2309 contents()->GetFrameTree()->root()->child_at(0)->render_manager(); |
2310 NavigationEntryImpl entry(NULL /* instance */, -1 /* page_id */, kUrl2, | 2310 NavigationEntryImpl entry(NULL /* instance */, -1 /* page_id */, kUrl2, |
2311 Referrer(kUrl1, blink::WebReferrerPolicyDefault), | 2311 Referrer(kUrl1, blink::WebReferrerPolicyDefault), |
2312 base::string16() /* title */, | 2312 base::string16() /* title */, |
2313 ui::PAGE_TRANSITION_LINK, | 2313 ui::PAGE_TRANSITION_LINK, |
2314 false /* is_renderer_init */); | 2314 false /* is_renderer_init */); |
2315 RenderFrameHostImpl* cross_site = NavigateToEntry(iframe, entry); | 2315 RenderFrameHostImpl* cross_site = NavigateToEntry(iframe, entry); |
2316 iframe->DidNavigateFrame(cross_site, true); | 2316 iframe->DidNavigateFrame(cross_site, true); |
(...skipping 28 matching lines...) Expand all Loading... |
2345 | 2345 |
2346 // Make sure the initial process is live so that the pending WebUI navigation | 2346 // Make sure the initial process is live so that the pending WebUI navigation |
2347 // does not commit immediately. Give the page a subframe as well. | 2347 // does not commit immediately. Give the page a subframe as well. |
2348 const GURL kUrl1("http://foo.com"); | 2348 const GURL kUrl1("http://foo.com"); |
2349 RenderFrameHostImpl* main_rfh = contents()->GetMainFrame(); | 2349 RenderFrameHostImpl* main_rfh = contents()->GetMainFrame(); |
2350 NavigateAndCommit(kUrl1); | 2350 NavigateAndCommit(kUrl1); |
2351 EXPECT_TRUE(main_rfh->render_view_host()->IsRenderViewLive()); | 2351 EXPECT_TRUE(main_rfh->render_view_host()->IsRenderViewLive()); |
2352 EXPECT_TRUE(main_rfh->IsRenderFrameLive()); | 2352 EXPECT_TRUE(main_rfh->IsRenderFrameLive()); |
2353 main_rfh->OnCreateChildFrame(main_rfh->GetProcess()->GetNextRoutingID(), | 2353 main_rfh->OnCreateChildFrame(main_rfh->GetProcess()->GetNextRoutingID(), |
2354 blink::WebTreeScopeType::Document, std::string(), | 2354 blink::WebTreeScopeType::Document, std::string(), |
2355 blink::WebSandboxFlags::None, | 2355 "uniqueName1", blink::WebSandboxFlags::None, |
2356 blink::WebFrameOwnerProperties()); | 2356 blink::WebFrameOwnerProperties()); |
2357 RenderFrameHostManager* subframe_rfhm = | 2357 RenderFrameHostManager* subframe_rfhm = |
2358 contents()->GetFrameTree()->root()->child_at(0)->render_manager(); | 2358 contents()->GetFrameTree()->root()->child_at(0)->render_manager(); |
2359 | 2359 |
2360 // Start a pending WebUI navigation in the main frame and verify that the | 2360 // Start a pending WebUI navigation in the main frame and verify that the |
2361 // pending RVH has bindings. | 2361 // pending RVH has bindings. |
2362 const GURL kWebUIUrl("chrome://foo"); | 2362 const GURL kWebUIUrl("chrome://foo"); |
2363 NavigationEntryImpl webui_entry( | 2363 NavigationEntryImpl webui_entry( |
2364 nullptr /* instance */, -1 /* page_id */, kWebUIUrl, Referrer(), | 2364 nullptr /* instance */, -1 /* page_id */, kWebUIUrl, Referrer(), |
2365 base::string16() /* title */, ui::PAGE_TRANSITION_TYPED, | 2365 base::string16() /* title */, ui::PAGE_TRANSITION_TYPED, |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2505 // four FrameTrees. Nodes 13 (with cycle to itself) and 42 (with back link to | 2505 // four FrameTrees. Nodes 13 (with cycle to itself) and 42 (with back link to |
2506 // root3) should be put on the list of nodes that will need their frame openers | 2506 // root3) should be put on the list of nodes that will need their frame openers |
2507 // set separately in a second pass, since their opener routing IDs won't be | 2507 // set separately in a second pass, since their opener routing IDs won't be |
2508 // available during the first pass of CreateOpenerProxies. | 2508 // available during the first pass of CreateOpenerProxies. |
2509 TEST_F(RenderFrameHostManagerTest, TraverseComplexOpenerChain) { | 2509 TEST_F(RenderFrameHostManagerTest, TraverseComplexOpenerChain) { |
2510 contents()->NavigateAndCommit(GURL("http://tab1.com")); | 2510 contents()->NavigateAndCommit(GURL("http://tab1.com")); |
2511 FrameTree* tree1 = contents()->GetFrameTree(); | 2511 FrameTree* tree1 = contents()->GetFrameTree(); |
2512 FrameTreeNode* root1 = tree1->root(); | 2512 FrameTreeNode* root1 = tree1->root(); |
2513 int process_id = root1->current_frame_host()->GetProcess()->GetID(); | 2513 int process_id = root1->current_frame_host()->GetProcess()->GetID(); |
2514 tree1->AddFrame(root1, process_id, 12, blink::WebTreeScopeType::Document, | 2514 tree1->AddFrame(root1, process_id, 12, blink::WebTreeScopeType::Document, |
2515 std::string(), blink::WebSandboxFlags::None, | 2515 std::string(), "uniqueName0", blink::WebSandboxFlags::None, |
2516 blink::WebFrameOwnerProperties()); | 2516 blink::WebFrameOwnerProperties()); |
2517 tree1->AddFrame(root1, process_id, 13, blink::WebTreeScopeType::Document, | 2517 tree1->AddFrame(root1, process_id, 13, blink::WebTreeScopeType::Document, |
2518 std::string(), blink::WebSandboxFlags::None, | 2518 std::string(), "uniqueName1", blink::WebSandboxFlags::None, |
2519 blink::WebFrameOwnerProperties()); | 2519 blink::WebFrameOwnerProperties()); |
2520 | 2520 |
2521 scoped_ptr<TestWebContents> tab2( | 2521 scoped_ptr<TestWebContents> tab2( |
2522 TestWebContents::Create(browser_context(), nullptr)); | 2522 TestWebContents::Create(browser_context(), nullptr)); |
2523 tab2->NavigateAndCommit(GURL("http://tab2.com")); | 2523 tab2->NavigateAndCommit(GURL("http://tab2.com")); |
2524 FrameTree* tree2 = tab2->GetFrameTree(); | 2524 FrameTree* tree2 = tab2->GetFrameTree(); |
2525 FrameTreeNode* root2 = tree2->root(); | 2525 FrameTreeNode* root2 = tree2->root(); |
2526 process_id = root2->current_frame_host()->GetProcess()->GetID(); | 2526 process_id = root2->current_frame_host()->GetProcess()->GetID(); |
2527 tree2->AddFrame(root2, process_id, 22, blink::WebTreeScopeType::Document, | 2527 tree2->AddFrame(root2, process_id, 22, blink::WebTreeScopeType::Document, |
2528 std::string(), blink::WebSandboxFlags::None, | 2528 std::string(), "uniqueName2", blink::WebSandboxFlags::None, |
2529 blink::WebFrameOwnerProperties()); | 2529 blink::WebFrameOwnerProperties()); |
2530 tree2->AddFrame(root2, process_id, 23, blink::WebTreeScopeType::Document, | 2530 tree2->AddFrame(root2, process_id, 23, blink::WebTreeScopeType::Document, |
2531 std::string(), blink::WebSandboxFlags::None, | 2531 std::string(), "uniqueName3", blink::WebSandboxFlags::None, |
2532 blink::WebFrameOwnerProperties()); | 2532 blink::WebFrameOwnerProperties()); |
2533 | 2533 |
2534 scoped_ptr<TestWebContents> tab3( | 2534 scoped_ptr<TestWebContents> tab3( |
2535 TestWebContents::Create(browser_context(), nullptr)); | 2535 TestWebContents::Create(browser_context(), nullptr)); |
2536 FrameTree* tree3 = tab3->GetFrameTree(); | 2536 FrameTree* tree3 = tab3->GetFrameTree(); |
2537 FrameTreeNode* root3 = tree3->root(); | 2537 FrameTreeNode* root3 = tree3->root(); |
2538 | 2538 |
2539 scoped_ptr<TestWebContents> tab4( | 2539 scoped_ptr<TestWebContents> tab4( |
2540 TestWebContents::Create(browser_context(), nullptr)); | 2540 TestWebContents::Create(browser_context(), nullptr)); |
2541 tab4->NavigateAndCommit(GURL("http://tab4.com")); | 2541 tab4->NavigateAndCommit(GURL("http://tab4.com")); |
2542 FrameTree* tree4 = tab4->GetFrameTree(); | 2542 FrameTree* tree4 = tab4->GetFrameTree(); |
2543 FrameTreeNode* root4 = tree4->root(); | 2543 FrameTreeNode* root4 = tree4->root(); |
2544 process_id = root4->current_frame_host()->GetProcess()->GetID(); | 2544 process_id = root4->current_frame_host()->GetProcess()->GetID(); |
2545 tree4->AddFrame(root4, process_id, 42, blink::WebTreeScopeType::Document, | 2545 tree4->AddFrame(root4, process_id, 42, blink::WebTreeScopeType::Document, |
2546 std::string(), blink::WebSandboxFlags::None, | 2546 std::string(), "uniqueName4", blink::WebSandboxFlags::None, |
2547 blink::WebFrameOwnerProperties()); | 2547 blink::WebFrameOwnerProperties()); |
2548 | 2548 |
2549 root1->child_at(1)->SetOpener(root1->child_at(1)); | 2549 root1->child_at(1)->SetOpener(root1->child_at(1)); |
2550 root1->SetOpener(root2->child_at(1)); | 2550 root1->SetOpener(root2->child_at(1)); |
2551 root2->SetOpener(root3); | 2551 root2->SetOpener(root3); |
2552 root2->child_at(0)->SetOpener(root4); | 2552 root2->child_at(0)->SetOpener(root4); |
2553 root2->child_at(1)->SetOpener(root4); | 2553 root2->child_at(1)->SetOpener(root4); |
2554 root4->child_at(0)->SetOpener(root3); | 2554 root4->child_at(0)->SetOpener(root3); |
2555 | 2555 |
2556 std::vector<FrameTree*> opener_frame_trees; | 2556 std::vector<FrameTree*> opener_frame_trees; |
(...skipping 28 matching lines...) Expand all Loading... |
2585 | 2585 |
2586 const GURL kUrlA("http://a.com/"); | 2586 const GURL kUrlA("http://a.com/"); |
2587 const GURL kUrlB("http://b.com/"); | 2587 const GURL kUrlB("http://b.com/"); |
2588 const GURL kUrlC("http://c.com/"); | 2588 const GURL kUrlC("http://c.com/"); |
2589 | 2589 |
2590 // Set up a page at a.com with three subframes: two for b.com and one for | 2590 // Set up a page at a.com with three subframes: two for b.com and one for |
2591 // c.com. | 2591 // c.com. |
2592 contents()->NavigateAndCommit(kUrlA); | 2592 contents()->NavigateAndCommit(kUrlA); |
2593 main_test_rfh()->OnCreateChildFrame( | 2593 main_test_rfh()->OnCreateChildFrame( |
2594 main_test_rfh()->GetProcess()->GetNextRoutingID(), | 2594 main_test_rfh()->GetProcess()->GetNextRoutingID(), |
2595 blink::WebTreeScopeType::Document, "frame1", | 2595 blink::WebTreeScopeType::Document, "frame1", "uniqueName1", |
2596 blink::WebSandboxFlags::None, blink::WebFrameOwnerProperties()); | 2596 blink::WebSandboxFlags::None, blink::WebFrameOwnerProperties()); |
2597 main_test_rfh()->OnCreateChildFrame( | 2597 main_test_rfh()->OnCreateChildFrame( |
2598 main_test_rfh()->GetProcess()->GetNextRoutingID(), | 2598 main_test_rfh()->GetProcess()->GetNextRoutingID(), |
2599 blink::WebTreeScopeType::Document, "frame2", | 2599 blink::WebTreeScopeType::Document, "frame2", "uniqueName2", |
2600 blink::WebSandboxFlags::None, blink::WebFrameOwnerProperties()); | 2600 blink::WebSandboxFlags::None, blink::WebFrameOwnerProperties()); |
2601 main_test_rfh()->OnCreateChildFrame( | 2601 main_test_rfh()->OnCreateChildFrame( |
2602 main_test_rfh()->GetProcess()->GetNextRoutingID(), | 2602 main_test_rfh()->GetProcess()->GetNextRoutingID(), |
2603 blink::WebTreeScopeType::Document, "frame3", | 2603 blink::WebTreeScopeType::Document, "frame3", "uniqueName3", |
2604 blink::WebSandboxFlags::None, blink::WebFrameOwnerProperties()); | 2604 blink::WebSandboxFlags::None, blink::WebFrameOwnerProperties()); |
2605 | 2605 |
2606 FrameTreeNode* root = contents()->GetFrameTree()->root(); | 2606 FrameTreeNode* root = contents()->GetFrameTree()->root(); |
2607 RenderFrameHostManager* child1 = root->child_at(0)->render_manager(); | 2607 RenderFrameHostManager* child1 = root->child_at(0)->render_manager(); |
2608 RenderFrameHostManager* child2 = root->child_at(1)->render_manager(); | 2608 RenderFrameHostManager* child2 = root->child_at(1)->render_manager(); |
2609 RenderFrameHostManager* child3 = root->child_at(2)->render_manager(); | 2609 RenderFrameHostManager* child3 = root->child_at(2)->render_manager(); |
2610 | 2610 |
2611 // Navigate first two subframes to B. | 2611 // Navigate first two subframes to B. |
2612 NavigationEntryImpl entryB(nullptr /* instance */, -1 /* page_id */, kUrlB, | 2612 NavigationEntryImpl entryB(nullptr /* instance */, -1 /* page_id */, kUrlB, |
2613 Referrer(kUrlA, blink::WebReferrerPolicyDefault), | 2613 Referrer(kUrlA, blink::WebReferrerPolicyDefault), |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2683 return; | 2683 return; |
2684 | 2684 |
2685 const GURL kUrlA("http://a.com/"); | 2685 const GURL kUrlA("http://a.com/"); |
2686 const GURL kUrlB("http://b.com/"); | 2686 const GURL kUrlB("http://b.com/"); |
2687 const GURL kUrlC("http://c.com/"); | 2687 const GURL kUrlC("http://c.com/"); |
2688 | 2688 |
2689 // Set up a page at a.com with a b.com subframe. | 2689 // Set up a page at a.com with a b.com subframe. |
2690 contents()->NavigateAndCommit(kUrlA); | 2690 contents()->NavigateAndCommit(kUrlA); |
2691 main_test_rfh()->OnCreateChildFrame( | 2691 main_test_rfh()->OnCreateChildFrame( |
2692 main_test_rfh()->GetProcess()->GetNextRoutingID(), | 2692 main_test_rfh()->GetProcess()->GetNextRoutingID(), |
2693 blink::WebTreeScopeType::Document, "frame1", | 2693 blink::WebTreeScopeType::Document, "frame1", "uniqueName1", |
2694 blink::WebSandboxFlags::None, blink::WebFrameOwnerProperties()); | 2694 blink::WebSandboxFlags::None, blink::WebFrameOwnerProperties()); |
2695 | 2695 |
2696 FrameTreeNode* root = contents()->GetFrameTree()->root(); | 2696 FrameTreeNode* root = contents()->GetFrameTree()->root(); |
2697 RenderFrameHostManager* child = root->child_at(0)->render_manager(); | 2697 RenderFrameHostManager* child = root->child_at(0)->render_manager(); |
2698 | 2698 |
2699 // Navigate subframe to B. | 2699 // Navigate subframe to B. |
2700 NavigationEntryImpl entryB(nullptr /* instance */, -1 /* page_id */, kUrlB, | 2700 NavigationEntryImpl entryB(nullptr /* instance */, -1 /* page_id */, kUrlB, |
2701 Referrer(kUrlA, blink::WebReferrerPolicyDefault), | 2701 Referrer(kUrlA, blink::WebReferrerPolicyDefault), |
2702 base::string16() /* title */, | 2702 base::string16() /* title */, |
2703 ui::PAGE_TRANSITION_LINK, | 2703 ui::PAGE_TRANSITION_LINK, |
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3169 ProxiesReceiveShouldEnforceStrictMixedContentChecking) { | 3169 ProxiesReceiveShouldEnforceStrictMixedContentChecking) { |
3170 const GURL kUrl1("http://www.google.test"); | 3170 const GURL kUrl1("http://www.google.test"); |
3171 const GURL kUrl2("http://www.google2.test"); | 3171 const GURL kUrl2("http://www.google2.test"); |
3172 const GURL kUrl3("http://www.google2.test/foo"); | 3172 const GURL kUrl3("http://www.google2.test/foo"); |
3173 | 3173 |
3174 contents()->NavigateAndCommit(kUrl1); | 3174 contents()->NavigateAndCommit(kUrl1); |
3175 | 3175 |
3176 // Create a child frame and navigate it cross-site. | 3176 // Create a child frame and navigate it cross-site. |
3177 main_test_rfh()->OnCreateChildFrame( | 3177 main_test_rfh()->OnCreateChildFrame( |
3178 main_test_rfh()->GetProcess()->GetNextRoutingID(), | 3178 main_test_rfh()->GetProcess()->GetNextRoutingID(), |
3179 blink::WebTreeScopeType::Document, "frame1", blink::WebSandboxFlags::None, | 3179 blink::WebTreeScopeType::Document, "frame1", "uniqueName1", |
3180 blink::WebFrameOwnerProperties()); | 3180 blink::WebSandboxFlags::None, blink::WebFrameOwnerProperties()); |
3181 | 3181 |
3182 FrameTreeNode* root = contents()->GetFrameTree()->root(); | 3182 FrameTreeNode* root = contents()->GetFrameTree()->root(); |
3183 RenderFrameHostManager* child = root->child_at(0)->render_manager(); | 3183 RenderFrameHostManager* child = root->child_at(0)->render_manager(); |
3184 | 3184 |
3185 // Navigate subframe to kUrl2. | 3185 // Navigate subframe to kUrl2. |
3186 NavigationEntryImpl entry1(nullptr /* instance */, -1 /* page_id */, kUrl2, | 3186 NavigationEntryImpl entry1(nullptr /* instance */, -1 /* page_id */, kUrl2, |
3187 Referrer(kUrl1, blink::WebReferrerPolicyDefault), | 3187 Referrer(kUrl1, blink::WebReferrerPolicyDefault), |
3188 base::string16() /* title */, | 3188 base::string16() /* title */, |
3189 ui::PAGE_TRANSITION_LINK, | 3189 ui::PAGE_TRANSITION_LINK, |
3190 false /* is_renderer_init */); | 3190 false /* is_renderer_init */); |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3244 commit_params.should_enforce_strict_mixed_content_checking = false; | 3244 commit_params.should_enforce_strict_mixed_content_checking = false; |
3245 child_host->SendNavigateWithParams(&commit_params); | 3245 child_host->SendNavigateWithParams(&commit_params); |
3246 EXPECT_NO_FATAL_FAILURE(CheckMixedContentIPC( | 3246 EXPECT_NO_FATAL_FAILURE(CheckMixedContentIPC( |
3247 main_test_rfh(), false, proxy_to_parent->GetRoutingID())); | 3247 main_test_rfh(), false, proxy_to_parent->GetRoutingID())); |
3248 EXPECT_FALSE(root->child_at(0) | 3248 EXPECT_FALSE(root->child_at(0) |
3249 ->current_replication_state() | 3249 ->current_replication_state() |
3250 .should_enforce_strict_mixed_content_checking); | 3250 .should_enforce_strict_mixed_content_checking); |
3251 } | 3251 } |
3252 | 3252 |
3253 } // namespace content | 3253 } // namespace content |
OLD | NEW |