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 | 8 |
9 #include <tuple> | 9 #include <tuple> |
10 #include <utility> | 10 #include <utility> |
11 | 11 |
12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
13 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
14 #include "base/macros.h" | 14 #include "base/macros.h" |
15 #include "base/memory/ptr_util.h" | 15 #include "base/memory/ptr_util.h" |
16 #include "base/strings/utf_string_conversions.h" | 16 #include "base/strings/utf_string_conversions.h" |
17 #include "base/test/histogram_tester.h" | 17 #include "base/test/histogram_tester.h" |
18 #include "base/time/time.h" | 18 #include "base/time/time.h" |
19 #include "build/build_config.h" | 19 #include "build/build_config.h" |
20 #include "content/browser/frame_host/cross_site_transferring_request.h" | 20 #include "content/browser/frame_host/cross_site_transferring_request.h" |
21 #include "content/browser/frame_host/navigation_controller_impl.h" | 21 #include "content/browser/frame_host/navigation_controller_impl.h" |
22 #include "content/browser/frame_host/navigation_entry_impl.h" | 22 #include "content/browser/frame_host/navigation_entry_impl.h" |
23 #include "content/browser/frame_host/navigation_request.h" | 23 #include "content/browser/frame_host/navigation_request.h" |
24 #include "content/browser/frame_host/navigator.h" | 24 #include "content/browser/frame_host/navigator.h" |
25 #include "content/browser/frame_host/render_frame_proxy_host.h" | 25 #include "content/browser/frame_host/render_frame_proxy_host.h" |
26 #include "content/browser/site_instance_impl.h" | 26 #include "content/browser/site_instance_impl.h" |
27 #include "content/browser/webui/web_ui_controller_factory_registry.h" | 27 #include "content/browser/webui/web_ui_controller_factory_registry.h" |
28 #include "content/common/frame_messages.h" | 28 #include "content/common/frame_messages.h" |
| 29 #include "content/common/frame_owner_properties.h" |
29 #include "content/common/input_messages.h" | 30 #include "content/common/input_messages.h" |
30 #include "content/common/site_isolation_policy.h" | 31 #include "content/common/site_isolation_policy.h" |
31 #include "content/common/view_messages.h" | 32 #include "content/common/view_messages.h" |
32 #include "content/public/browser/notification_details.h" | 33 #include "content/public/browser/notification_details.h" |
33 #include "content/public/browser/notification_service.h" | 34 #include "content/public/browser/notification_service.h" |
34 #include "content/public/browser/notification_source.h" | 35 #include "content/public/browser/notification_source.h" |
35 #include "content/public/browser/notification_types.h" | 36 #include "content/public/browser/notification_types.h" |
36 #include "content/public/browser/render_process_host.h" | 37 #include "content/public/browser/render_process_host.h" |
37 #include "content/public/browser/render_widget_host_iterator.h" | 38 #include "content/public/browser/render_widget_host_iterator.h" |
38 #include "content/public/browser/web_contents_delegate.h" | 39 #include "content/public/browser/web_contents_delegate.h" |
39 #include "content/public/browser/web_contents_observer.h" | 40 #include "content/public/browser/web_contents_observer.h" |
40 #include "content/public/browser/web_ui_controller.h" | 41 #include "content/public/browser/web_ui_controller.h" |
41 #include "content/public/common/bindings_policy.h" | 42 #include "content/public/common/bindings_policy.h" |
42 #include "content/public/common/browser_side_navigation_policy.h" | 43 #include "content/public/common/browser_side_navigation_policy.h" |
43 #include "content/public/common/javascript_message_type.h" | 44 #include "content/public/common/javascript_message_type.h" |
44 #include "content/public/common/url_constants.h" | 45 #include "content/public/common/url_constants.h" |
45 #include "content/public/common/url_utils.h" | 46 #include "content/public/common/url_utils.h" |
46 #include "content/public/test/mock_render_process_host.h" | 47 #include "content/public/test/mock_render_process_host.h" |
47 #include "content/public/test/test_notification_tracker.h" | 48 #include "content/public/test/test_notification_tracker.h" |
48 #include "content/public/test/test_utils.h" | 49 #include "content/public/test/test_utils.h" |
49 #include "content/test/browser_side_navigation_test_utils.h" | 50 #include "content/test/browser_side_navigation_test_utils.h" |
50 #include "content/test/test_content_browser_client.h" | 51 #include "content/test/test_content_browser_client.h" |
51 #include "content/test/test_content_client.h" | 52 #include "content/test/test_content_client.h" |
52 #include "content/test/test_render_frame_host.h" | 53 #include "content/test/test_render_frame_host.h" |
53 #include "content/test/test_render_view_host.h" | 54 #include "content/test/test_render_view_host.h" |
54 #include "content/test/test_web_contents.h" | 55 #include "content/test/test_web_contents.h" |
55 #include "net/base/load_flags.h" | 56 #include "net/base/load_flags.h" |
56 #include "testing/gtest/include/gtest/gtest.h" | 57 #include "testing/gtest/include/gtest/gtest.h" |
57 #include "third_party/WebKit/public/platform/WebInsecureRequestPolicy.h" | 58 #include "third_party/WebKit/public/platform/WebInsecureRequestPolicy.h" |
58 #include "third_party/WebKit/public/web/WebFrameOwnerProperties.h" | |
59 #include "third_party/WebKit/public/web/WebSandboxFlags.h" | 59 #include "third_party/WebKit/public/web/WebSandboxFlags.h" |
60 #include "ui/base/page_transition_types.h" | 60 #include "ui/base/page_transition_types.h" |
61 | 61 |
62 namespace content { | 62 namespace content { |
63 namespace { | 63 namespace { |
64 | 64 |
65 // Helper to check that the provided RenderProcessHost received exactly one | 65 // Helper to check that the provided RenderProcessHost received exactly one |
66 // page focus message with the provided focus and routing ID values. | 66 // page focus message with the provided focus and routing ID values. |
67 void VerifyPageFocusMessage(MockRenderProcessHost* rph, | 67 void VerifyPageFocusMessage(MockRenderProcessHost* rph, |
68 bool expected_focus, | 68 bool expected_focus, |
(...skipping 1873 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1942 // http://crbug.com/444955. | 1942 // http://crbug.com/444955. |
1943 TEST_F(RenderFrameHostManagerTestWithSiteIsolation, DetachPendingChild) { | 1943 TEST_F(RenderFrameHostManagerTestWithSiteIsolation, DetachPendingChild) { |
1944 const GURL kUrlA("http://www.google.com/"); | 1944 const GURL kUrlA("http://www.google.com/"); |
1945 const GURL kUrlB("http://webkit.org/"); | 1945 const GURL kUrlB("http://webkit.org/"); |
1946 | 1946 |
1947 // Create a page with two child frames. | 1947 // Create a page with two child frames. |
1948 contents()->NavigateAndCommit(kUrlA); | 1948 contents()->NavigateAndCommit(kUrlA); |
1949 contents()->GetMainFrame()->OnCreateChildFrame( | 1949 contents()->GetMainFrame()->OnCreateChildFrame( |
1950 contents()->GetMainFrame()->GetProcess()->GetNextRoutingID(), | 1950 contents()->GetMainFrame()->GetProcess()->GetNextRoutingID(), |
1951 blink::WebTreeScopeType::Document, "frame_name", "uniqueName1", | 1951 blink::WebTreeScopeType::Document, "frame_name", "uniqueName1", |
1952 blink::WebSandboxFlags::None, blink::WebFrameOwnerProperties()); | 1952 blink::WebSandboxFlags::None, FrameOwnerProperties()); |
1953 contents()->GetMainFrame()->OnCreateChildFrame( | 1953 contents()->GetMainFrame()->OnCreateChildFrame( |
1954 contents()->GetMainFrame()->GetProcess()->GetNextRoutingID(), | 1954 contents()->GetMainFrame()->GetProcess()->GetNextRoutingID(), |
1955 blink::WebTreeScopeType::Document, "frame_name", "uniqueName2", | 1955 blink::WebTreeScopeType::Document, "frame_name", "uniqueName2", |
1956 blink::WebSandboxFlags::None, blink::WebFrameOwnerProperties()); | 1956 blink::WebSandboxFlags::None, FrameOwnerProperties()); |
1957 RenderFrameHostManager* root_manager = | 1957 RenderFrameHostManager* root_manager = |
1958 contents()->GetFrameTree()->root()->render_manager(); | 1958 contents()->GetFrameTree()->root()->render_manager(); |
1959 RenderFrameHostManager* iframe1 = | 1959 RenderFrameHostManager* iframe1 = |
1960 contents()->GetFrameTree()->root()->child_at(0)->render_manager(); | 1960 contents()->GetFrameTree()->root()->child_at(0)->render_manager(); |
1961 RenderFrameHostManager* iframe2 = | 1961 RenderFrameHostManager* iframe2 = |
1962 contents()->GetFrameTree()->root()->child_at(1)->render_manager(); | 1962 contents()->GetFrameTree()->root()->child_at(1)->render_manager(); |
1963 | 1963 |
1964 // 1) The first navigation. | 1964 // 1) The first navigation. |
1965 NavigationEntryImpl entryA(NULL /* instance */, -1 /* page_id */, kUrlA, | 1965 NavigationEntryImpl entryA(NULL /* instance */, -1 /* page_id */, kUrlA, |
1966 Referrer(), base::string16() /* title */, | 1966 Referrer(), base::string16() /* title */, |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2081 // Reload |contents1|. | 2081 // Reload |contents1|. |
2082 contents1->NavigateAndCommit(kUrl1); | 2082 contents1->NavigateAndCommit(kUrl1); |
2083 EXPECT_TRUE(contents1->GetMainFrame()->IsRenderFrameLive()); | 2083 EXPECT_TRUE(contents1->GetMainFrame()->IsRenderFrameLive()); |
2084 EXPECT_FALSE(contents2->GetMainFrame()->IsRenderFrameLive()); | 2084 EXPECT_FALSE(contents2->GetMainFrame()->IsRenderFrameLive()); |
2085 EXPECT_EQ(contents1->GetSiteInstance(), contents2->GetSiteInstance()); | 2085 EXPECT_EQ(contents1->GetSiteInstance(), contents2->GetSiteInstance()); |
2086 | 2086 |
2087 // |contents1| creates an out of process iframe. | 2087 // |contents1| creates an out of process iframe. |
2088 contents1->GetMainFrame()->OnCreateChildFrame( | 2088 contents1->GetMainFrame()->OnCreateChildFrame( |
2089 contents1->GetMainFrame()->GetProcess()->GetNextRoutingID(), | 2089 contents1->GetMainFrame()->GetProcess()->GetNextRoutingID(), |
2090 blink::WebTreeScopeType::Document, "frame_name", "uniqueName1", | 2090 blink::WebTreeScopeType::Document, "frame_name", "uniqueName1", |
2091 blink::WebSandboxFlags::None, blink::WebFrameOwnerProperties()); | 2091 blink::WebSandboxFlags::None, FrameOwnerProperties()); |
2092 RenderFrameHostManager* iframe = | 2092 RenderFrameHostManager* iframe = |
2093 contents()->GetFrameTree()->root()->child_at(0)->render_manager(); | 2093 contents()->GetFrameTree()->root()->child_at(0)->render_manager(); |
2094 NavigationEntryImpl entry(NULL /* instance */, -1 /* page_id */, kUrl2, | 2094 NavigationEntryImpl entry(NULL /* instance */, -1 /* page_id */, kUrl2, |
2095 Referrer(kUrl1, blink::WebReferrerPolicyDefault), | 2095 Referrer(kUrl1, blink::WebReferrerPolicyDefault), |
2096 base::string16() /* title */, | 2096 base::string16() /* title */, |
2097 ui::PAGE_TRANSITION_LINK, | 2097 ui::PAGE_TRANSITION_LINK, |
2098 false /* is_renderer_init */); | 2098 false /* is_renderer_init */); |
2099 RenderFrameHostImpl* cross_site = NavigateToEntry(iframe, entry); | 2099 RenderFrameHostImpl* cross_site = NavigateToEntry(iframe, entry); |
2100 iframe->DidNavigateFrame(cross_site, true); | 2100 iframe->DidNavigateFrame(cross_site, true); |
2101 | 2101 |
(...skipping 28 matching lines...) Expand all Loading... |
2130 // Make sure the initial process is live so that the pending WebUI navigation | 2130 // Make sure the initial process is live so that the pending WebUI navigation |
2131 // does not commit immediately. Give the page a subframe as well. | 2131 // does not commit immediately. Give the page a subframe as well. |
2132 const GURL kUrl1("http://foo.com"); | 2132 const GURL kUrl1("http://foo.com"); |
2133 RenderFrameHostImpl* main_rfh = contents()->GetMainFrame(); | 2133 RenderFrameHostImpl* main_rfh = contents()->GetMainFrame(); |
2134 NavigateAndCommit(kUrl1); | 2134 NavigateAndCommit(kUrl1); |
2135 EXPECT_TRUE(main_rfh->render_view_host()->IsRenderViewLive()); | 2135 EXPECT_TRUE(main_rfh->render_view_host()->IsRenderViewLive()); |
2136 EXPECT_TRUE(main_rfh->IsRenderFrameLive()); | 2136 EXPECT_TRUE(main_rfh->IsRenderFrameLive()); |
2137 main_rfh->OnCreateChildFrame(main_rfh->GetProcess()->GetNextRoutingID(), | 2137 main_rfh->OnCreateChildFrame(main_rfh->GetProcess()->GetNextRoutingID(), |
2138 blink::WebTreeScopeType::Document, std::string(), | 2138 blink::WebTreeScopeType::Document, std::string(), |
2139 "uniqueName1", blink::WebSandboxFlags::None, | 2139 "uniqueName1", blink::WebSandboxFlags::None, |
2140 blink::WebFrameOwnerProperties()); | 2140 FrameOwnerProperties()); |
2141 RenderFrameHostManager* subframe_rfhm = | 2141 RenderFrameHostManager* subframe_rfhm = |
2142 contents()->GetFrameTree()->root()->child_at(0)->render_manager(); | 2142 contents()->GetFrameTree()->root()->child_at(0)->render_manager(); |
2143 | 2143 |
2144 // Start a pending WebUI navigation in the main frame and verify that the | 2144 // Start a pending WebUI navigation in the main frame and verify that the |
2145 // pending RVH has bindings. | 2145 // pending RVH has bindings. |
2146 const GURL kWebUIUrl("chrome://foo"); | 2146 const GURL kWebUIUrl("chrome://foo"); |
2147 NavigationEntryImpl webui_entry( | 2147 NavigationEntryImpl webui_entry( |
2148 nullptr /* instance */, -1 /* page_id */, kWebUIUrl, Referrer(), | 2148 nullptr /* instance */, -1 /* page_id */, kWebUIUrl, Referrer(), |
2149 base::string16() /* title */, ui::PAGE_TRANSITION_TYPED, | 2149 base::string16() /* title */, ui::PAGE_TRANSITION_TYPED, |
2150 false /* is_renderer_init */); | 2150 false /* is_renderer_init */); |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2290 // root3) should be put on the list of nodes that will need their frame openers | 2290 // root3) should be put on the list of nodes that will need their frame openers |
2291 // set separately in a second pass, since their opener routing IDs won't be | 2291 // set separately in a second pass, since their opener routing IDs won't be |
2292 // available during the first pass of CreateOpenerProxies. | 2292 // available during the first pass of CreateOpenerProxies. |
2293 TEST_F(RenderFrameHostManagerTest, TraverseComplexOpenerChain) { | 2293 TEST_F(RenderFrameHostManagerTest, TraverseComplexOpenerChain) { |
2294 contents()->NavigateAndCommit(GURL("http://tab1.com")); | 2294 contents()->NavigateAndCommit(GURL("http://tab1.com")); |
2295 FrameTree* tree1 = contents()->GetFrameTree(); | 2295 FrameTree* tree1 = contents()->GetFrameTree(); |
2296 FrameTreeNode* root1 = tree1->root(); | 2296 FrameTreeNode* root1 = tree1->root(); |
2297 int process_id = root1->current_frame_host()->GetProcess()->GetID(); | 2297 int process_id = root1->current_frame_host()->GetProcess()->GetID(); |
2298 tree1->AddFrame(root1, process_id, 12, blink::WebTreeScopeType::Document, | 2298 tree1->AddFrame(root1, process_id, 12, blink::WebTreeScopeType::Document, |
2299 std::string(), "uniqueName0", blink::WebSandboxFlags::None, | 2299 std::string(), "uniqueName0", blink::WebSandboxFlags::None, |
2300 blink::WebFrameOwnerProperties()); | 2300 FrameOwnerProperties()); |
2301 tree1->AddFrame(root1, process_id, 13, blink::WebTreeScopeType::Document, | 2301 tree1->AddFrame(root1, process_id, 13, blink::WebTreeScopeType::Document, |
2302 std::string(), "uniqueName1", blink::WebSandboxFlags::None, | 2302 std::string(), "uniqueName1", blink::WebSandboxFlags::None, |
2303 blink::WebFrameOwnerProperties()); | 2303 FrameOwnerProperties()); |
2304 | 2304 |
2305 std::unique_ptr<TestWebContents> tab2( | 2305 std::unique_ptr<TestWebContents> tab2( |
2306 TestWebContents::Create(browser_context(), nullptr)); | 2306 TestWebContents::Create(browser_context(), nullptr)); |
2307 tab2->NavigateAndCommit(GURL("http://tab2.com")); | 2307 tab2->NavigateAndCommit(GURL("http://tab2.com")); |
2308 FrameTree* tree2 = tab2->GetFrameTree(); | 2308 FrameTree* tree2 = tab2->GetFrameTree(); |
2309 FrameTreeNode* root2 = tree2->root(); | 2309 FrameTreeNode* root2 = tree2->root(); |
2310 process_id = root2->current_frame_host()->GetProcess()->GetID(); | 2310 process_id = root2->current_frame_host()->GetProcess()->GetID(); |
2311 tree2->AddFrame(root2, process_id, 22, blink::WebTreeScopeType::Document, | 2311 tree2->AddFrame(root2, process_id, 22, blink::WebTreeScopeType::Document, |
2312 std::string(), "uniqueName2", blink::WebSandboxFlags::None, | 2312 std::string(), "uniqueName2", blink::WebSandboxFlags::None, |
2313 blink::WebFrameOwnerProperties()); | 2313 FrameOwnerProperties()); |
2314 tree2->AddFrame(root2, process_id, 23, blink::WebTreeScopeType::Document, | 2314 tree2->AddFrame(root2, process_id, 23, blink::WebTreeScopeType::Document, |
2315 std::string(), "uniqueName3", blink::WebSandboxFlags::None, | 2315 std::string(), "uniqueName3", blink::WebSandboxFlags::None, |
2316 blink::WebFrameOwnerProperties()); | 2316 FrameOwnerProperties()); |
2317 | 2317 |
2318 std::unique_ptr<TestWebContents> tab3( | 2318 std::unique_ptr<TestWebContents> tab3( |
2319 TestWebContents::Create(browser_context(), nullptr)); | 2319 TestWebContents::Create(browser_context(), nullptr)); |
2320 FrameTree* tree3 = tab3->GetFrameTree(); | 2320 FrameTree* tree3 = tab3->GetFrameTree(); |
2321 FrameTreeNode* root3 = tree3->root(); | 2321 FrameTreeNode* root3 = tree3->root(); |
2322 | 2322 |
2323 std::unique_ptr<TestWebContents> tab4( | 2323 std::unique_ptr<TestWebContents> tab4( |
2324 TestWebContents::Create(browser_context(), nullptr)); | 2324 TestWebContents::Create(browser_context(), nullptr)); |
2325 tab4->NavigateAndCommit(GURL("http://tab4.com")); | 2325 tab4->NavigateAndCommit(GURL("http://tab4.com")); |
2326 FrameTree* tree4 = tab4->GetFrameTree(); | 2326 FrameTree* tree4 = tab4->GetFrameTree(); |
2327 FrameTreeNode* root4 = tree4->root(); | 2327 FrameTreeNode* root4 = tree4->root(); |
2328 process_id = root4->current_frame_host()->GetProcess()->GetID(); | 2328 process_id = root4->current_frame_host()->GetProcess()->GetID(); |
2329 tree4->AddFrame(root4, process_id, 42, blink::WebTreeScopeType::Document, | 2329 tree4->AddFrame(root4, process_id, 42, blink::WebTreeScopeType::Document, |
2330 std::string(), "uniqueName4", blink::WebSandboxFlags::None, | 2330 std::string(), "uniqueName4", blink::WebSandboxFlags::None, |
2331 blink::WebFrameOwnerProperties()); | 2331 FrameOwnerProperties()); |
2332 | 2332 |
2333 root1->child_at(1)->SetOpener(root1->child_at(1)); | 2333 root1->child_at(1)->SetOpener(root1->child_at(1)); |
2334 root1->SetOpener(root2->child_at(1)); | 2334 root1->SetOpener(root2->child_at(1)); |
2335 root2->SetOpener(root3); | 2335 root2->SetOpener(root3); |
2336 root2->child_at(0)->SetOpener(root4); | 2336 root2->child_at(0)->SetOpener(root4); |
2337 root2->child_at(1)->SetOpener(root4); | 2337 root2->child_at(1)->SetOpener(root4); |
2338 root4->child_at(0)->SetOpener(root3); | 2338 root4->child_at(0)->SetOpener(root3); |
2339 | 2339 |
2340 std::vector<FrameTree*> opener_frame_trees; | 2340 std::vector<FrameTree*> opener_frame_trees; |
2341 base::hash_set<FrameTreeNode*> nodes_with_back_links; | 2341 base::hash_set<FrameTreeNode*> nodes_with_back_links; |
(...skipping 28 matching lines...) Expand all Loading... |
2370 const GURL kUrlA("http://a.com/"); | 2370 const GURL kUrlA("http://a.com/"); |
2371 const GURL kUrlB("http://b.com/"); | 2371 const GURL kUrlB("http://b.com/"); |
2372 const GURL kUrlC("http://c.com/"); | 2372 const GURL kUrlC("http://c.com/"); |
2373 | 2373 |
2374 // Set up a page at a.com with three subframes: two for b.com and one for | 2374 // Set up a page at a.com with three subframes: two for b.com and one for |
2375 // c.com. | 2375 // c.com. |
2376 contents()->NavigateAndCommit(kUrlA); | 2376 contents()->NavigateAndCommit(kUrlA); |
2377 main_test_rfh()->OnCreateChildFrame( | 2377 main_test_rfh()->OnCreateChildFrame( |
2378 main_test_rfh()->GetProcess()->GetNextRoutingID(), | 2378 main_test_rfh()->GetProcess()->GetNextRoutingID(), |
2379 blink::WebTreeScopeType::Document, "frame1", "uniqueName1", | 2379 blink::WebTreeScopeType::Document, "frame1", "uniqueName1", |
2380 blink::WebSandboxFlags::None, blink::WebFrameOwnerProperties()); | 2380 blink::WebSandboxFlags::None, FrameOwnerProperties()); |
2381 main_test_rfh()->OnCreateChildFrame( | 2381 main_test_rfh()->OnCreateChildFrame( |
2382 main_test_rfh()->GetProcess()->GetNextRoutingID(), | 2382 main_test_rfh()->GetProcess()->GetNextRoutingID(), |
2383 blink::WebTreeScopeType::Document, "frame2", "uniqueName2", | 2383 blink::WebTreeScopeType::Document, "frame2", "uniqueName2", |
2384 blink::WebSandboxFlags::None, blink::WebFrameOwnerProperties()); | 2384 blink::WebSandboxFlags::None, FrameOwnerProperties()); |
2385 main_test_rfh()->OnCreateChildFrame( | 2385 main_test_rfh()->OnCreateChildFrame( |
2386 main_test_rfh()->GetProcess()->GetNextRoutingID(), | 2386 main_test_rfh()->GetProcess()->GetNextRoutingID(), |
2387 blink::WebTreeScopeType::Document, "frame3", "uniqueName3", | 2387 blink::WebTreeScopeType::Document, "frame3", "uniqueName3", |
2388 blink::WebSandboxFlags::None, blink::WebFrameOwnerProperties()); | 2388 blink::WebSandboxFlags::None, FrameOwnerProperties()); |
2389 | 2389 |
2390 FrameTreeNode* root = contents()->GetFrameTree()->root(); | 2390 FrameTreeNode* root = contents()->GetFrameTree()->root(); |
2391 RenderFrameHostManager* child1 = root->child_at(0)->render_manager(); | 2391 RenderFrameHostManager* child1 = root->child_at(0)->render_manager(); |
2392 RenderFrameHostManager* child2 = root->child_at(1)->render_manager(); | 2392 RenderFrameHostManager* child2 = root->child_at(1)->render_manager(); |
2393 RenderFrameHostManager* child3 = root->child_at(2)->render_manager(); | 2393 RenderFrameHostManager* child3 = root->child_at(2)->render_manager(); |
2394 | 2394 |
2395 // Navigate first two subframes to B. | 2395 // Navigate first two subframes to B. |
2396 NavigationEntryImpl entryB(nullptr /* instance */, -1 /* page_id */, kUrlB, | 2396 NavigationEntryImpl entryB(nullptr /* instance */, -1 /* page_id */, kUrlB, |
2397 Referrer(kUrlA, blink::WebReferrerPolicyDefault), | 2397 Referrer(kUrlA, blink::WebReferrerPolicyDefault), |
2398 base::string16() /* title */, | 2398 base::string16() /* title */, |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2468 | 2468 |
2469 const GURL kUrlA("http://a.com/"); | 2469 const GURL kUrlA("http://a.com/"); |
2470 const GURL kUrlB("http://b.com/"); | 2470 const GURL kUrlB("http://b.com/"); |
2471 const GURL kUrlC("http://c.com/"); | 2471 const GURL kUrlC("http://c.com/"); |
2472 | 2472 |
2473 // Set up a page at a.com with a b.com subframe. | 2473 // Set up a page at a.com with a b.com subframe. |
2474 contents()->NavigateAndCommit(kUrlA); | 2474 contents()->NavigateAndCommit(kUrlA); |
2475 main_test_rfh()->OnCreateChildFrame( | 2475 main_test_rfh()->OnCreateChildFrame( |
2476 main_test_rfh()->GetProcess()->GetNextRoutingID(), | 2476 main_test_rfh()->GetProcess()->GetNextRoutingID(), |
2477 blink::WebTreeScopeType::Document, "frame1", "uniqueName1", | 2477 blink::WebTreeScopeType::Document, "frame1", "uniqueName1", |
2478 blink::WebSandboxFlags::None, blink::WebFrameOwnerProperties()); | 2478 blink::WebSandboxFlags::None, FrameOwnerProperties()); |
2479 | 2479 |
2480 FrameTreeNode* root = contents()->GetFrameTree()->root(); | 2480 FrameTreeNode* root = contents()->GetFrameTree()->root(); |
2481 RenderFrameHostManager* child = root->child_at(0)->render_manager(); | 2481 RenderFrameHostManager* child = root->child_at(0)->render_manager(); |
2482 | 2482 |
2483 // Navigate subframe to B. | 2483 // Navigate subframe to B. |
2484 NavigationEntryImpl entryB(nullptr /* instance */, -1 /* page_id */, kUrlB, | 2484 NavigationEntryImpl entryB(nullptr /* instance */, -1 /* page_id */, kUrlB, |
2485 Referrer(kUrlA, blink::WebReferrerPolicyDefault), | 2485 Referrer(kUrlA, blink::WebReferrerPolicyDefault), |
2486 base::string16() /* title */, | 2486 base::string16() /* title */, |
2487 ui::PAGE_TRANSITION_LINK, | 2487 ui::PAGE_TRANSITION_LINK, |
2488 false /* is_renderer_init */); | 2488 false /* is_renderer_init */); |
(...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3016 const GURL kUrl1("http://www.google.test"); | 3016 const GURL kUrl1("http://www.google.test"); |
3017 const GURL kUrl2("http://www.google2.test"); | 3017 const GURL kUrl2("http://www.google2.test"); |
3018 const GURL kUrl3("http://www.google2.test/foo"); | 3018 const GURL kUrl3("http://www.google2.test/foo"); |
3019 | 3019 |
3020 contents()->NavigateAndCommit(kUrl1); | 3020 contents()->NavigateAndCommit(kUrl1); |
3021 | 3021 |
3022 // Create a child frame and navigate it cross-site. | 3022 // Create a child frame and navigate it cross-site. |
3023 main_test_rfh()->OnCreateChildFrame( | 3023 main_test_rfh()->OnCreateChildFrame( |
3024 main_test_rfh()->GetProcess()->GetNextRoutingID(), | 3024 main_test_rfh()->GetProcess()->GetNextRoutingID(), |
3025 blink::WebTreeScopeType::Document, "frame1", "uniqueName1", | 3025 blink::WebTreeScopeType::Document, "frame1", "uniqueName1", |
3026 blink::WebSandboxFlags::None, blink::WebFrameOwnerProperties()); | 3026 blink::WebSandboxFlags::None, FrameOwnerProperties()); |
3027 | 3027 |
3028 FrameTreeNode* root = contents()->GetFrameTree()->root(); | 3028 FrameTreeNode* root = contents()->GetFrameTree()->root(); |
3029 RenderFrameHostManager* child = root->child_at(0)->render_manager(); | 3029 RenderFrameHostManager* child = root->child_at(0)->render_manager(); |
3030 | 3030 |
3031 // Navigate subframe to kUrl2. | 3031 // Navigate subframe to kUrl2. |
3032 NavigationEntryImpl entry1(nullptr /* instance */, -1 /* page_id */, kUrl2, | 3032 NavigationEntryImpl entry1(nullptr /* instance */, -1 /* page_id */, kUrl2, |
3033 Referrer(kUrl1, blink::WebReferrerPolicyDefault), | 3033 Referrer(kUrl1, blink::WebReferrerPolicyDefault), |
3034 base::string16() /* title */, | 3034 base::string16() /* title */, |
3035 ui::PAGE_TRANSITION_LINK, | 3035 ui::PAGE_TRANSITION_LINK, |
3036 false /* is_renderer_init */); | 3036 false /* is_renderer_init */); |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3094 child_host->SendNavigateWithParams(&commit_params); | 3094 child_host->SendNavigateWithParams(&commit_params); |
3095 EXPECT_NO_FATAL_FAILURE(CheckInsecureRequestPolicyIPC( | 3095 EXPECT_NO_FATAL_FAILURE(CheckInsecureRequestPolicyIPC( |
3096 main_test_rfh(), blink::kLeaveInsecureRequestsAlone, | 3096 main_test_rfh(), blink::kLeaveInsecureRequestsAlone, |
3097 proxy_to_parent->GetRoutingID())); | 3097 proxy_to_parent->GetRoutingID())); |
3098 EXPECT_EQ( | 3098 EXPECT_EQ( |
3099 blink::kLeaveInsecureRequestsAlone, | 3099 blink::kLeaveInsecureRequestsAlone, |
3100 root->child_at(0)->current_replication_state().insecure_request_policy); | 3100 root->child_at(0)->current_replication_state().insecure_request_policy); |
3101 } | 3101 } |
3102 | 3102 |
3103 } // namespace content | 3103 } // namespace content |
OLD | NEW |