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 1871 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1940 // http://crbug.com/444955. | 1940 // http://crbug.com/444955. |
1941 TEST_F(RenderFrameHostManagerTestWithSiteIsolation, DetachPendingChild) { | 1941 TEST_F(RenderFrameHostManagerTestWithSiteIsolation, DetachPendingChild) { |
1942 const GURL kUrlA("http://www.google.com/"); | 1942 const GURL kUrlA("http://www.google.com/"); |
1943 const GURL kUrlB("http://webkit.org/"); | 1943 const GURL kUrlB("http://webkit.org/"); |
1944 | 1944 |
1945 // Create a page with two child frames. | 1945 // Create a page with two child frames. |
1946 contents()->NavigateAndCommit(kUrlA); | 1946 contents()->NavigateAndCommit(kUrlA); |
1947 contents()->GetMainFrame()->OnCreateChildFrame( | 1947 contents()->GetMainFrame()->OnCreateChildFrame( |
1948 contents()->GetMainFrame()->GetProcess()->GetNextRoutingID(), | 1948 contents()->GetMainFrame()->GetProcess()->GetNextRoutingID(), |
1949 blink::WebTreeScopeType::Document, "frame_name", "uniqueName1", | 1949 blink::WebTreeScopeType::Document, "frame_name", "uniqueName1", |
1950 blink::WebSandboxFlags::None, blink::WebFrameOwnerProperties()); | 1950 blink::WebSandboxFlags::None, FrameOwnerProperties()); |
1951 contents()->GetMainFrame()->OnCreateChildFrame( | 1951 contents()->GetMainFrame()->OnCreateChildFrame( |
1952 contents()->GetMainFrame()->GetProcess()->GetNextRoutingID(), | 1952 contents()->GetMainFrame()->GetProcess()->GetNextRoutingID(), |
1953 blink::WebTreeScopeType::Document, "frame_name", "uniqueName2", | 1953 blink::WebTreeScopeType::Document, "frame_name", "uniqueName2", |
1954 blink::WebSandboxFlags::None, blink::WebFrameOwnerProperties()); | 1954 blink::WebSandboxFlags::None, FrameOwnerProperties()); |
1955 RenderFrameHostManager* root_manager = | 1955 RenderFrameHostManager* root_manager = |
1956 contents()->GetFrameTree()->root()->render_manager(); | 1956 contents()->GetFrameTree()->root()->render_manager(); |
1957 RenderFrameHostManager* iframe1 = | 1957 RenderFrameHostManager* iframe1 = |
1958 contents()->GetFrameTree()->root()->child_at(0)->render_manager(); | 1958 contents()->GetFrameTree()->root()->child_at(0)->render_manager(); |
1959 RenderFrameHostManager* iframe2 = | 1959 RenderFrameHostManager* iframe2 = |
1960 contents()->GetFrameTree()->root()->child_at(1)->render_manager(); | 1960 contents()->GetFrameTree()->root()->child_at(1)->render_manager(); |
1961 | 1961 |
1962 // 1) The first navigation. | 1962 // 1) The first navigation. |
1963 NavigationEntryImpl entryA(NULL /* instance */, -1 /* page_id */, kUrlA, | 1963 NavigationEntryImpl entryA(NULL /* instance */, -1 /* page_id */, kUrlA, |
1964 Referrer(), base::string16() /* title */, | 1964 Referrer(), base::string16() /* title */, |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2079 // Reload |contents1|. | 2079 // Reload |contents1|. |
2080 contents1->NavigateAndCommit(kUrl1); | 2080 contents1->NavigateAndCommit(kUrl1); |
2081 EXPECT_TRUE(contents1->GetMainFrame()->IsRenderFrameLive()); | 2081 EXPECT_TRUE(contents1->GetMainFrame()->IsRenderFrameLive()); |
2082 EXPECT_FALSE(contents2->GetMainFrame()->IsRenderFrameLive()); | 2082 EXPECT_FALSE(contents2->GetMainFrame()->IsRenderFrameLive()); |
2083 EXPECT_EQ(contents1->GetSiteInstance(), contents2->GetSiteInstance()); | 2083 EXPECT_EQ(contents1->GetSiteInstance(), contents2->GetSiteInstance()); |
2084 | 2084 |
2085 // |contents1| creates an out of process iframe. | 2085 // |contents1| creates an out of process iframe. |
2086 contents1->GetMainFrame()->OnCreateChildFrame( | 2086 contents1->GetMainFrame()->OnCreateChildFrame( |
2087 contents1->GetMainFrame()->GetProcess()->GetNextRoutingID(), | 2087 contents1->GetMainFrame()->GetProcess()->GetNextRoutingID(), |
2088 blink::WebTreeScopeType::Document, "frame_name", "uniqueName1", | 2088 blink::WebTreeScopeType::Document, "frame_name", "uniqueName1", |
2089 blink::WebSandboxFlags::None, blink::WebFrameOwnerProperties()); | 2089 blink::WebSandboxFlags::None, FrameOwnerProperties()); |
2090 RenderFrameHostManager* iframe = | 2090 RenderFrameHostManager* iframe = |
2091 contents()->GetFrameTree()->root()->child_at(0)->render_manager(); | 2091 contents()->GetFrameTree()->root()->child_at(0)->render_manager(); |
2092 NavigationEntryImpl entry(NULL /* instance */, -1 /* page_id */, kUrl2, | 2092 NavigationEntryImpl entry(NULL /* instance */, -1 /* page_id */, kUrl2, |
2093 Referrer(kUrl1, blink::WebReferrerPolicyDefault), | 2093 Referrer(kUrl1, blink::WebReferrerPolicyDefault), |
2094 base::string16() /* title */, | 2094 base::string16() /* title */, |
2095 ui::PAGE_TRANSITION_LINK, | 2095 ui::PAGE_TRANSITION_LINK, |
2096 false /* is_renderer_init */); | 2096 false /* is_renderer_init */); |
2097 RenderFrameHostImpl* cross_site = NavigateToEntry(iframe, entry); | 2097 RenderFrameHostImpl* cross_site = NavigateToEntry(iframe, entry); |
2098 iframe->DidNavigateFrame(cross_site, true); | 2098 iframe->DidNavigateFrame(cross_site, true); |
2099 | 2099 |
(...skipping 28 matching lines...) Expand all Loading... |
2128 // Make sure the initial process is live so that the pending WebUI navigation | 2128 // Make sure the initial process is live so that the pending WebUI navigation |
2129 // does not commit immediately. Give the page a subframe as well. | 2129 // does not commit immediately. Give the page a subframe as well. |
2130 const GURL kUrl1("http://foo.com"); | 2130 const GURL kUrl1("http://foo.com"); |
2131 RenderFrameHostImpl* main_rfh = contents()->GetMainFrame(); | 2131 RenderFrameHostImpl* main_rfh = contents()->GetMainFrame(); |
2132 NavigateAndCommit(kUrl1); | 2132 NavigateAndCommit(kUrl1); |
2133 EXPECT_TRUE(main_rfh->render_view_host()->IsRenderViewLive()); | 2133 EXPECT_TRUE(main_rfh->render_view_host()->IsRenderViewLive()); |
2134 EXPECT_TRUE(main_rfh->IsRenderFrameLive()); | 2134 EXPECT_TRUE(main_rfh->IsRenderFrameLive()); |
2135 main_rfh->OnCreateChildFrame(main_rfh->GetProcess()->GetNextRoutingID(), | 2135 main_rfh->OnCreateChildFrame(main_rfh->GetProcess()->GetNextRoutingID(), |
2136 blink::WebTreeScopeType::Document, std::string(), | 2136 blink::WebTreeScopeType::Document, std::string(), |
2137 "uniqueName1", blink::WebSandboxFlags::None, | 2137 "uniqueName1", blink::WebSandboxFlags::None, |
2138 blink::WebFrameOwnerProperties()); | 2138 FrameOwnerProperties()); |
2139 RenderFrameHostManager* subframe_rfhm = | 2139 RenderFrameHostManager* subframe_rfhm = |
2140 contents()->GetFrameTree()->root()->child_at(0)->render_manager(); | 2140 contents()->GetFrameTree()->root()->child_at(0)->render_manager(); |
2141 | 2141 |
2142 // Start a pending WebUI navigation in the main frame and verify that the | 2142 // Start a pending WebUI navigation in the main frame and verify that the |
2143 // pending RVH has bindings. | 2143 // pending RVH has bindings. |
2144 const GURL kWebUIUrl("chrome://foo"); | 2144 const GURL kWebUIUrl("chrome://foo"); |
2145 NavigationEntryImpl webui_entry( | 2145 NavigationEntryImpl webui_entry( |
2146 nullptr /* instance */, -1 /* page_id */, kWebUIUrl, Referrer(), | 2146 nullptr /* instance */, -1 /* page_id */, kWebUIUrl, Referrer(), |
2147 base::string16() /* title */, ui::PAGE_TRANSITION_TYPED, | 2147 base::string16() /* title */, ui::PAGE_TRANSITION_TYPED, |
2148 false /* is_renderer_init */); | 2148 false /* is_renderer_init */); |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2288 // root3) should be put on the list of nodes that will need their frame openers | 2288 // root3) should be put on the list of nodes that will need their frame openers |
2289 // set separately in a second pass, since their opener routing IDs won't be | 2289 // set separately in a second pass, since their opener routing IDs won't be |
2290 // available during the first pass of CreateOpenerProxies. | 2290 // available during the first pass of CreateOpenerProxies. |
2291 TEST_F(RenderFrameHostManagerTest, TraverseComplexOpenerChain) { | 2291 TEST_F(RenderFrameHostManagerTest, TraverseComplexOpenerChain) { |
2292 contents()->NavigateAndCommit(GURL("http://tab1.com")); | 2292 contents()->NavigateAndCommit(GURL("http://tab1.com")); |
2293 FrameTree* tree1 = contents()->GetFrameTree(); | 2293 FrameTree* tree1 = contents()->GetFrameTree(); |
2294 FrameTreeNode* root1 = tree1->root(); | 2294 FrameTreeNode* root1 = tree1->root(); |
2295 int process_id = root1->current_frame_host()->GetProcess()->GetID(); | 2295 int process_id = root1->current_frame_host()->GetProcess()->GetID(); |
2296 tree1->AddFrame(root1, process_id, 12, blink::WebTreeScopeType::Document, | 2296 tree1->AddFrame(root1, process_id, 12, blink::WebTreeScopeType::Document, |
2297 std::string(), "uniqueName0", blink::WebSandboxFlags::None, | 2297 std::string(), "uniqueName0", blink::WebSandboxFlags::None, |
2298 blink::WebFrameOwnerProperties()); | 2298 FrameOwnerProperties()); |
2299 tree1->AddFrame(root1, process_id, 13, blink::WebTreeScopeType::Document, | 2299 tree1->AddFrame(root1, process_id, 13, blink::WebTreeScopeType::Document, |
2300 std::string(), "uniqueName1", blink::WebSandboxFlags::None, | 2300 std::string(), "uniqueName1", blink::WebSandboxFlags::None, |
2301 blink::WebFrameOwnerProperties()); | 2301 FrameOwnerProperties()); |
2302 | 2302 |
2303 std::unique_ptr<TestWebContents> tab2( | 2303 std::unique_ptr<TestWebContents> tab2( |
2304 TestWebContents::Create(browser_context(), nullptr)); | 2304 TestWebContents::Create(browser_context(), nullptr)); |
2305 tab2->NavigateAndCommit(GURL("http://tab2.com")); | 2305 tab2->NavigateAndCommit(GURL("http://tab2.com")); |
2306 FrameTree* tree2 = tab2->GetFrameTree(); | 2306 FrameTree* tree2 = tab2->GetFrameTree(); |
2307 FrameTreeNode* root2 = tree2->root(); | 2307 FrameTreeNode* root2 = tree2->root(); |
2308 process_id = root2->current_frame_host()->GetProcess()->GetID(); | 2308 process_id = root2->current_frame_host()->GetProcess()->GetID(); |
2309 tree2->AddFrame(root2, process_id, 22, blink::WebTreeScopeType::Document, | 2309 tree2->AddFrame(root2, process_id, 22, blink::WebTreeScopeType::Document, |
2310 std::string(), "uniqueName2", blink::WebSandboxFlags::None, | 2310 std::string(), "uniqueName2", blink::WebSandboxFlags::None, |
2311 blink::WebFrameOwnerProperties()); | 2311 FrameOwnerProperties()); |
2312 tree2->AddFrame(root2, process_id, 23, blink::WebTreeScopeType::Document, | 2312 tree2->AddFrame(root2, process_id, 23, blink::WebTreeScopeType::Document, |
2313 std::string(), "uniqueName3", blink::WebSandboxFlags::None, | 2313 std::string(), "uniqueName3", blink::WebSandboxFlags::None, |
2314 blink::WebFrameOwnerProperties()); | 2314 FrameOwnerProperties()); |
2315 | 2315 |
2316 std::unique_ptr<TestWebContents> tab3( | 2316 std::unique_ptr<TestWebContents> tab3( |
2317 TestWebContents::Create(browser_context(), nullptr)); | 2317 TestWebContents::Create(browser_context(), nullptr)); |
2318 FrameTree* tree3 = tab3->GetFrameTree(); | 2318 FrameTree* tree3 = tab3->GetFrameTree(); |
2319 FrameTreeNode* root3 = tree3->root(); | 2319 FrameTreeNode* root3 = tree3->root(); |
2320 | 2320 |
2321 std::unique_ptr<TestWebContents> tab4( | 2321 std::unique_ptr<TestWebContents> tab4( |
2322 TestWebContents::Create(browser_context(), nullptr)); | 2322 TestWebContents::Create(browser_context(), nullptr)); |
2323 tab4->NavigateAndCommit(GURL("http://tab4.com")); | 2323 tab4->NavigateAndCommit(GURL("http://tab4.com")); |
2324 FrameTree* tree4 = tab4->GetFrameTree(); | 2324 FrameTree* tree4 = tab4->GetFrameTree(); |
2325 FrameTreeNode* root4 = tree4->root(); | 2325 FrameTreeNode* root4 = tree4->root(); |
2326 process_id = root4->current_frame_host()->GetProcess()->GetID(); | 2326 process_id = root4->current_frame_host()->GetProcess()->GetID(); |
2327 tree4->AddFrame(root4, process_id, 42, blink::WebTreeScopeType::Document, | 2327 tree4->AddFrame(root4, process_id, 42, blink::WebTreeScopeType::Document, |
2328 std::string(), "uniqueName4", blink::WebSandboxFlags::None, | 2328 std::string(), "uniqueName4", blink::WebSandboxFlags::None, |
2329 blink::WebFrameOwnerProperties()); | 2329 FrameOwnerProperties()); |
2330 | 2330 |
2331 root1->child_at(1)->SetOpener(root1->child_at(1)); | 2331 root1->child_at(1)->SetOpener(root1->child_at(1)); |
2332 root1->SetOpener(root2->child_at(1)); | 2332 root1->SetOpener(root2->child_at(1)); |
2333 root2->SetOpener(root3); | 2333 root2->SetOpener(root3); |
2334 root2->child_at(0)->SetOpener(root4); | 2334 root2->child_at(0)->SetOpener(root4); |
2335 root2->child_at(1)->SetOpener(root4); | 2335 root2->child_at(1)->SetOpener(root4); |
2336 root4->child_at(0)->SetOpener(root3); | 2336 root4->child_at(0)->SetOpener(root3); |
2337 | 2337 |
2338 std::vector<FrameTree*> opener_frame_trees; | 2338 std::vector<FrameTree*> opener_frame_trees; |
2339 base::hash_set<FrameTreeNode*> nodes_with_back_links; | 2339 base::hash_set<FrameTreeNode*> nodes_with_back_links; |
(...skipping 28 matching lines...) Expand all Loading... |
2368 const GURL kUrlA("http://a.com/"); | 2368 const GURL kUrlA("http://a.com/"); |
2369 const GURL kUrlB("http://b.com/"); | 2369 const GURL kUrlB("http://b.com/"); |
2370 const GURL kUrlC("http://c.com/"); | 2370 const GURL kUrlC("http://c.com/"); |
2371 | 2371 |
2372 // Set up a page at a.com with three subframes: two for b.com and one for | 2372 // Set up a page at a.com with three subframes: two for b.com and one for |
2373 // c.com. | 2373 // c.com. |
2374 contents()->NavigateAndCommit(kUrlA); | 2374 contents()->NavigateAndCommit(kUrlA); |
2375 main_test_rfh()->OnCreateChildFrame( | 2375 main_test_rfh()->OnCreateChildFrame( |
2376 main_test_rfh()->GetProcess()->GetNextRoutingID(), | 2376 main_test_rfh()->GetProcess()->GetNextRoutingID(), |
2377 blink::WebTreeScopeType::Document, "frame1", "uniqueName1", | 2377 blink::WebTreeScopeType::Document, "frame1", "uniqueName1", |
2378 blink::WebSandboxFlags::None, blink::WebFrameOwnerProperties()); | 2378 blink::WebSandboxFlags::None, FrameOwnerProperties()); |
2379 main_test_rfh()->OnCreateChildFrame( | 2379 main_test_rfh()->OnCreateChildFrame( |
2380 main_test_rfh()->GetProcess()->GetNextRoutingID(), | 2380 main_test_rfh()->GetProcess()->GetNextRoutingID(), |
2381 blink::WebTreeScopeType::Document, "frame2", "uniqueName2", | 2381 blink::WebTreeScopeType::Document, "frame2", "uniqueName2", |
2382 blink::WebSandboxFlags::None, blink::WebFrameOwnerProperties()); | 2382 blink::WebSandboxFlags::None, FrameOwnerProperties()); |
2383 main_test_rfh()->OnCreateChildFrame( | 2383 main_test_rfh()->OnCreateChildFrame( |
2384 main_test_rfh()->GetProcess()->GetNextRoutingID(), | 2384 main_test_rfh()->GetProcess()->GetNextRoutingID(), |
2385 blink::WebTreeScopeType::Document, "frame3", "uniqueName3", | 2385 blink::WebTreeScopeType::Document, "frame3", "uniqueName3", |
2386 blink::WebSandboxFlags::None, blink::WebFrameOwnerProperties()); | 2386 blink::WebSandboxFlags::None, FrameOwnerProperties()); |
2387 | 2387 |
2388 FrameTreeNode* root = contents()->GetFrameTree()->root(); | 2388 FrameTreeNode* root = contents()->GetFrameTree()->root(); |
2389 RenderFrameHostManager* child1 = root->child_at(0)->render_manager(); | 2389 RenderFrameHostManager* child1 = root->child_at(0)->render_manager(); |
2390 RenderFrameHostManager* child2 = root->child_at(1)->render_manager(); | 2390 RenderFrameHostManager* child2 = root->child_at(1)->render_manager(); |
2391 RenderFrameHostManager* child3 = root->child_at(2)->render_manager(); | 2391 RenderFrameHostManager* child3 = root->child_at(2)->render_manager(); |
2392 | 2392 |
2393 // Navigate first two subframes to B. | 2393 // Navigate first two subframes to B. |
2394 NavigationEntryImpl entryB(nullptr /* instance */, -1 /* page_id */, kUrlB, | 2394 NavigationEntryImpl entryB(nullptr /* instance */, -1 /* page_id */, kUrlB, |
2395 Referrer(kUrlA, blink::WebReferrerPolicyDefault), | 2395 Referrer(kUrlA, blink::WebReferrerPolicyDefault), |
2396 base::string16() /* title */, | 2396 base::string16() /* title */, |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2466 | 2466 |
2467 const GURL kUrlA("http://a.com/"); | 2467 const GURL kUrlA("http://a.com/"); |
2468 const GURL kUrlB("http://b.com/"); | 2468 const GURL kUrlB("http://b.com/"); |
2469 const GURL kUrlC("http://c.com/"); | 2469 const GURL kUrlC("http://c.com/"); |
2470 | 2470 |
2471 // Set up a page at a.com with a b.com subframe. | 2471 // Set up a page at a.com with a b.com subframe. |
2472 contents()->NavigateAndCommit(kUrlA); | 2472 contents()->NavigateAndCommit(kUrlA); |
2473 main_test_rfh()->OnCreateChildFrame( | 2473 main_test_rfh()->OnCreateChildFrame( |
2474 main_test_rfh()->GetProcess()->GetNextRoutingID(), | 2474 main_test_rfh()->GetProcess()->GetNextRoutingID(), |
2475 blink::WebTreeScopeType::Document, "frame1", "uniqueName1", | 2475 blink::WebTreeScopeType::Document, "frame1", "uniqueName1", |
2476 blink::WebSandboxFlags::None, blink::WebFrameOwnerProperties()); | 2476 blink::WebSandboxFlags::None, FrameOwnerProperties()); |
2477 | 2477 |
2478 FrameTreeNode* root = contents()->GetFrameTree()->root(); | 2478 FrameTreeNode* root = contents()->GetFrameTree()->root(); |
2479 RenderFrameHostManager* child = root->child_at(0)->render_manager(); | 2479 RenderFrameHostManager* child = root->child_at(0)->render_manager(); |
2480 | 2480 |
2481 // Navigate subframe to B. | 2481 // Navigate subframe to B. |
2482 NavigationEntryImpl entryB(nullptr /* instance */, -1 /* page_id */, kUrlB, | 2482 NavigationEntryImpl entryB(nullptr /* instance */, -1 /* page_id */, kUrlB, |
2483 Referrer(kUrlA, blink::WebReferrerPolicyDefault), | 2483 Referrer(kUrlA, blink::WebReferrerPolicyDefault), |
2484 base::string16() /* title */, | 2484 base::string16() /* title */, |
2485 ui::PAGE_TRANSITION_LINK, | 2485 ui::PAGE_TRANSITION_LINK, |
2486 false /* is_renderer_init */); | 2486 false /* is_renderer_init */); |
(...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3014 const GURL kUrl1("http://www.google.test"); | 3014 const GURL kUrl1("http://www.google.test"); |
3015 const GURL kUrl2("http://www.google2.test"); | 3015 const GURL kUrl2("http://www.google2.test"); |
3016 const GURL kUrl3("http://www.google2.test/foo"); | 3016 const GURL kUrl3("http://www.google2.test/foo"); |
3017 | 3017 |
3018 contents()->NavigateAndCommit(kUrl1); | 3018 contents()->NavigateAndCommit(kUrl1); |
3019 | 3019 |
3020 // Create a child frame and navigate it cross-site. | 3020 // Create a child frame and navigate it cross-site. |
3021 main_test_rfh()->OnCreateChildFrame( | 3021 main_test_rfh()->OnCreateChildFrame( |
3022 main_test_rfh()->GetProcess()->GetNextRoutingID(), | 3022 main_test_rfh()->GetProcess()->GetNextRoutingID(), |
3023 blink::WebTreeScopeType::Document, "frame1", "uniqueName1", | 3023 blink::WebTreeScopeType::Document, "frame1", "uniqueName1", |
3024 blink::WebSandboxFlags::None, blink::WebFrameOwnerProperties()); | 3024 blink::WebSandboxFlags::None, FrameOwnerProperties()); |
3025 | 3025 |
3026 FrameTreeNode* root = contents()->GetFrameTree()->root(); | 3026 FrameTreeNode* root = contents()->GetFrameTree()->root(); |
3027 RenderFrameHostManager* child = root->child_at(0)->render_manager(); | 3027 RenderFrameHostManager* child = root->child_at(0)->render_manager(); |
3028 | 3028 |
3029 // Navigate subframe to kUrl2. | 3029 // Navigate subframe to kUrl2. |
3030 NavigationEntryImpl entry1(nullptr /* instance */, -1 /* page_id */, kUrl2, | 3030 NavigationEntryImpl entry1(nullptr /* instance */, -1 /* page_id */, kUrl2, |
3031 Referrer(kUrl1, blink::WebReferrerPolicyDefault), | 3031 Referrer(kUrl1, blink::WebReferrerPolicyDefault), |
3032 base::string16() /* title */, | 3032 base::string16() /* title */, |
3033 ui::PAGE_TRANSITION_LINK, | 3033 ui::PAGE_TRANSITION_LINK, |
3034 false /* is_renderer_init */); | 3034 false /* is_renderer_init */); |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3092 child_host->SendNavigateWithParams(&commit_params); | 3092 child_host->SendNavigateWithParams(&commit_params); |
3093 EXPECT_NO_FATAL_FAILURE(CheckInsecureRequestPolicyIPC( | 3093 EXPECT_NO_FATAL_FAILURE(CheckInsecureRequestPolicyIPC( |
3094 main_test_rfh(), blink::kLeaveInsecureRequestsAlone, | 3094 main_test_rfh(), blink::kLeaveInsecureRequestsAlone, |
3095 proxy_to_parent->GetRoutingID())); | 3095 proxy_to_parent->GetRoutingID())); |
3096 EXPECT_EQ( | 3096 EXPECT_EQ( |
3097 blink::kLeaveInsecureRequestsAlone, | 3097 blink::kLeaveInsecureRequestsAlone, |
3098 root->child_at(0)->current_replication_state().insecure_request_policy); | 3098 root->child_at(0)->current_replication_state().insecure_request_policy); |
3099 } | 3099 } |
3100 | 3100 |
3101 } // namespace content | 3101 } // namespace content |
OLD | NEW |