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 <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 1047 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1058 scoped_refptr<SiteInstance> blank_instance = | 1058 scoped_refptr<SiteInstance> blank_instance = |
1059 SiteInstance::Create(browser_context()); | 1059 SiteInstance::Create(browser_context()); |
1060 blank_instance->GetProcess()->Init(); | 1060 blank_instance->GetProcess()->Init(); |
1061 | 1061 |
1062 // Create a blank tab. | 1062 // Create a blank tab. |
1063 std::unique_ptr<TestWebContents> web_contents1( | 1063 std::unique_ptr<TestWebContents> web_contents1( |
1064 TestWebContents::Create(browser_context(), blank_instance)); | 1064 TestWebContents::Create(browser_context(), blank_instance)); |
1065 RenderFrameHostManager* manager1 = | 1065 RenderFrameHostManager* manager1 = |
1066 web_contents1->GetRenderManagerForTesting(); | 1066 web_contents1->GetRenderManagerForTesting(); |
1067 // Test the case that new RVH is considered live. | 1067 // Test the case that new RVH is considered live. |
1068 manager1->current_host()->CreateRenderView(-1, MSG_ROUTING_NONE, -1, | 1068 manager1->current_host()->CreateRenderView( |
1069 FrameReplicationState(), false); | 1069 -1, MSG_ROUTING_NONE, -1, FrameReplicationState(), false); |
alexmos
2016/04/27 23:39:51
nit: no change here other than wrapping, here and
wjmaclean
2016/04/28 13:20:11
Indeed. I don't even remember at what stage this f
| |
1070 EXPECT_TRUE(manager1->current_host()->IsRenderViewLive()); | 1070 EXPECT_TRUE(manager1->current_host()->IsRenderViewLive()); |
1071 EXPECT_TRUE(manager1->current_frame_host()->IsRenderFrameLive()); | 1071 EXPECT_TRUE(manager1->current_frame_host()->IsRenderFrameLive()); |
1072 | 1072 |
1073 // Navigate to a WebUI page. | 1073 // Navigate to a WebUI page. |
1074 const GURL kUrl1("chrome://foo"); | 1074 const GURL kUrl1("chrome://foo"); |
1075 NavigationEntryImpl entry1(NULL /* instance */, -1 /* page_id */, kUrl1, | 1075 NavigationEntryImpl entry1(NULL /* instance */, -1 /* page_id */, kUrl1, |
1076 Referrer(), base::string16() /* title */, | 1076 Referrer(), base::string16() /* title */, |
1077 ui::PAGE_TRANSITION_TYPED, | 1077 ui::PAGE_TRANSITION_TYPED, |
1078 false /* is_renderer_init */); | 1078 false /* is_renderer_init */); |
1079 RenderFrameHostImpl* host1 = NavigateToEntry(manager1, entry1); | 1079 RenderFrameHostImpl* host1 = NavigateToEntry(manager1, entry1); |
(...skipping 12 matching lines...) Expand all Loading... | |
1092 EXPECT_TRUE( | 1092 EXPECT_TRUE( |
1093 host1->render_view_host()->GetEnabledBindings() & BINDINGS_POLICY_WEB_UI); | 1093 host1->render_view_host()->GetEnabledBindings() & BINDINGS_POLICY_WEB_UI); |
1094 | 1094 |
1095 // Now simulate clicking a link that opens in a new tab. | 1095 // Now simulate clicking a link that opens in a new tab. |
1096 std::unique_ptr<TestWebContents> web_contents2( | 1096 std::unique_ptr<TestWebContents> web_contents2( |
1097 TestWebContents::Create(browser_context(), webui_instance)); | 1097 TestWebContents::Create(browser_context(), webui_instance)); |
1098 RenderFrameHostManager* manager2 = | 1098 RenderFrameHostManager* manager2 = |
1099 web_contents2->GetRenderManagerForTesting(); | 1099 web_contents2->GetRenderManagerForTesting(); |
1100 // Make sure the new RVH is considered live. This is usually done in | 1100 // Make sure the new RVH is considered live. This is usually done in |
1101 // RenderWidgetHost::Init when opening a new tab from a link. | 1101 // RenderWidgetHost::Init when opening a new tab from a link. |
1102 manager2->current_host()->CreateRenderView(-1, MSG_ROUTING_NONE, -1, | 1102 manager2->current_host()->CreateRenderView( |
1103 FrameReplicationState(), false); | 1103 -1, MSG_ROUTING_NONE, -1, FrameReplicationState(), false); |
1104 EXPECT_TRUE(manager2->current_host()->IsRenderViewLive()); | 1104 EXPECT_TRUE(manager2->current_host()->IsRenderViewLive()); |
1105 | 1105 |
1106 const GURL kUrl2("chrome://foo/bar"); | 1106 const GURL kUrl2("chrome://foo/bar"); |
1107 NavigationEntryImpl entry2(NULL /* instance */, -1 /* page_id */, kUrl2, | 1107 NavigationEntryImpl entry2(NULL /* instance */, -1 /* page_id */, kUrl2, |
1108 Referrer(), base::string16() /* title */, | 1108 Referrer(), base::string16() /* title */, |
1109 ui::PAGE_TRANSITION_LINK, | 1109 ui::PAGE_TRANSITION_LINK, |
1110 true /* is_renderer_init */); | 1110 true /* is_renderer_init */); |
1111 RenderFrameHostImpl* host2 = NavigateToEntry(manager2, entry2); | 1111 RenderFrameHostImpl* host2 = NavigateToEntry(manager2, entry2); |
1112 | 1112 |
1113 // No cross-process transition happens because we are already in the right | 1113 // No cross-process transition happens because we are already in the right |
(...skipping 1987 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3101 commit_params.should_enforce_strict_mixed_content_checking = false; | 3101 commit_params.should_enforce_strict_mixed_content_checking = false; |
3102 child_host->SendNavigateWithParams(&commit_params); | 3102 child_host->SendNavigateWithParams(&commit_params); |
3103 EXPECT_NO_FATAL_FAILURE(CheckMixedContentIPC( | 3103 EXPECT_NO_FATAL_FAILURE(CheckMixedContentIPC( |
3104 main_test_rfh(), false, proxy_to_parent->GetRoutingID())); | 3104 main_test_rfh(), false, proxy_to_parent->GetRoutingID())); |
3105 EXPECT_FALSE(root->child_at(0) | 3105 EXPECT_FALSE(root->child_at(0) |
3106 ->current_replication_state() | 3106 ->current_replication_state() |
3107 .should_enforce_strict_mixed_content_checking); | 3107 .should_enforce_strict_mixed_content_checking); |
3108 } | 3108 } |
3109 | 3109 |
3110 } // namespace content | 3110 } // namespace content |
OLD | NEW |