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 1046 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1057 scoped_refptr<SiteInstance> blank_instance = | 1057 scoped_refptr<SiteInstance> blank_instance = |
1058 SiteInstance::Create(browser_context()); | 1058 SiteInstance::Create(browser_context()); |
1059 blank_instance->GetProcess()->Init(); | 1059 blank_instance->GetProcess()->Init(); |
1060 | 1060 |
1061 // Create a blank tab. | 1061 // Create a blank tab. |
1062 scoped_ptr<TestWebContents> web_contents1( | 1062 scoped_ptr<TestWebContents> web_contents1( |
1063 TestWebContents::Create(browser_context(), blank_instance)); | 1063 TestWebContents::Create(browser_context(), blank_instance)); |
1064 RenderFrameHostManager* manager1 = | 1064 RenderFrameHostManager* manager1 = |
1065 web_contents1->GetRenderManagerForTesting(); | 1065 web_contents1->GetRenderManagerForTesting(); |
1066 // Test the case that new RVH is considered live. | 1066 // Test the case that new RVH is considered live. |
1067 manager1->current_host()->CreateRenderView(-1, MSG_ROUTING_NONE, -1, | 1067 manager1->current_host()->CreateRenderView( |
1068 FrameReplicationState(), false); | 1068 -1, MSG_ROUTING_NONE, -1, FrameReplicationState(), false); |
1069 EXPECT_TRUE(manager1->current_host()->IsRenderViewLive()); | 1069 EXPECT_TRUE(manager1->current_host()->IsRenderViewLive()); |
1070 EXPECT_TRUE(manager1->current_frame_host()->IsRenderFrameLive()); | 1070 EXPECT_TRUE(manager1->current_frame_host()->IsRenderFrameLive()); |
1071 | 1071 |
1072 // Navigate to a WebUI page. | 1072 // Navigate to a WebUI page. |
1073 const GURL kUrl1("chrome://foo"); | 1073 const GURL kUrl1("chrome://foo"); |
1074 NavigationEntryImpl entry1(NULL /* instance */, -1 /* page_id */, kUrl1, | 1074 NavigationEntryImpl entry1(NULL /* instance */, -1 /* page_id */, kUrl1, |
1075 Referrer(), base::string16() /* title */, | 1075 Referrer(), base::string16() /* title */, |
1076 ui::PAGE_TRANSITION_TYPED, | 1076 ui::PAGE_TRANSITION_TYPED, |
1077 false /* is_renderer_init */); | 1077 false /* is_renderer_init */); |
1078 RenderFrameHostImpl* host1 = NavigateToEntry(manager1, entry1); | 1078 RenderFrameHostImpl* host1 = NavigateToEntry(manager1, entry1); |
(...skipping 12 matching lines...) Expand all Loading... |
1091 EXPECT_TRUE( | 1091 EXPECT_TRUE( |
1092 host1->render_view_host()->GetEnabledBindings() & BINDINGS_POLICY_WEB_UI); | 1092 host1->render_view_host()->GetEnabledBindings() & BINDINGS_POLICY_WEB_UI); |
1093 | 1093 |
1094 // Now simulate clicking a link that opens in a new tab. | 1094 // Now simulate clicking a link that opens in a new tab. |
1095 scoped_ptr<TestWebContents> web_contents2( | 1095 scoped_ptr<TestWebContents> web_contents2( |
1096 TestWebContents::Create(browser_context(), webui_instance)); | 1096 TestWebContents::Create(browser_context(), webui_instance)); |
1097 RenderFrameHostManager* manager2 = | 1097 RenderFrameHostManager* manager2 = |
1098 web_contents2->GetRenderManagerForTesting(); | 1098 web_contents2->GetRenderManagerForTesting(); |
1099 // Make sure the new RVH is considered live. This is usually done in | 1099 // Make sure the new RVH is considered live. This is usually done in |
1100 // RenderWidgetHost::Init when opening a new tab from a link. | 1100 // RenderWidgetHost::Init when opening a new tab from a link. |
1101 manager2->current_host()->CreateRenderView(-1, MSG_ROUTING_NONE, -1, | 1101 manager2->current_host()->CreateRenderView( |
1102 FrameReplicationState(), false); | 1102 -1, MSG_ROUTING_NONE, -1, FrameReplicationState(), false); |
1103 EXPECT_TRUE(manager2->current_host()->IsRenderViewLive()); | 1103 EXPECT_TRUE(manager2->current_host()->IsRenderViewLive()); |
1104 | 1104 |
1105 const GURL kUrl2("chrome://foo/bar"); | 1105 const GURL kUrl2("chrome://foo/bar"); |
1106 NavigationEntryImpl entry2(NULL /* instance */, -1 /* page_id */, kUrl2, | 1106 NavigationEntryImpl entry2(NULL /* instance */, -1 /* page_id */, kUrl2, |
1107 Referrer(), base::string16() /* title */, | 1107 Referrer(), base::string16() /* title */, |
1108 ui::PAGE_TRANSITION_LINK, | 1108 ui::PAGE_TRANSITION_LINK, |
1109 true /* is_renderer_init */); | 1109 true /* is_renderer_init */); |
1110 RenderFrameHostImpl* host2 = NavigateToEntry(manager2, entry2); | 1110 RenderFrameHostImpl* host2 = NavigateToEntry(manager2, entry2); |
1111 | 1111 |
1112 // No cross-process transition happens because we are already in the right | 1112 // No cross-process transition happens because we are already in the right |
(...skipping 1989 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3102 commit_params.should_enforce_strict_mixed_content_checking = false; | 3102 commit_params.should_enforce_strict_mixed_content_checking = false; |
3103 child_host->SendNavigateWithParams(&commit_params); | 3103 child_host->SendNavigateWithParams(&commit_params); |
3104 EXPECT_NO_FATAL_FAILURE(CheckMixedContentIPC( | 3104 EXPECT_NO_FATAL_FAILURE(CheckMixedContentIPC( |
3105 main_test_rfh(), false, proxy_to_parent->GetRoutingID())); | 3105 main_test_rfh(), false, proxy_to_parent->GetRoutingID())); |
3106 EXPECT_FALSE(root->child_at(0) | 3106 EXPECT_FALSE(root->child_at(0) |
3107 ->current_replication_state() | 3107 ->current_replication_state() |
3108 .should_enforce_strict_mixed_content_checking); | 3108 .should_enforce_strict_mixed_content_checking); |
3109 } | 3109 } |
3110 | 3110 |
3111 } // namespace content | 3111 } // namespace content |
OLD | NEW |