OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "content/browser/frame_host/frame_tree.h" | 6 #include "content/browser/frame_host/frame_tree.h" |
7 #include "content/browser/frame_host/frame_tree_node.h" | 7 #include "content/browser/frame_host/frame_tree_node.h" |
8 #include "content/browser/renderer_host/render_view_host_impl.h" | 8 #include "content/browser/renderer_host/render_view_host_impl.h" |
9 #include "content/browser/web_contents/web_contents_impl.h" | 9 #include "content/browser/web_contents/web_contents_impl.h" |
10 #include "content/public/browser/notification_service.h" | 10 #include "content/public/browser/notification_service.h" |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 GURL::Replacements replace_host; | 240 GURL::Replacements replace_host; |
241 std::string foo_com("foo.com"); | 241 std::string foo_com("foo.com"); |
242 | 242 |
243 // Load cross-site page into iframe. | 243 // Load cross-site page into iframe. |
244 GURL cross_site_url(test_server()->GetURL("files/title2.html")); | 244 GURL cross_site_url(test_server()->GetURL("files/title2.html")); |
245 replace_host.SetHostStr(foo_com); | 245 replace_host.SetHostStr(foo_com); |
246 cross_site_url = cross_site_url.ReplaceComponents(replace_host); | 246 cross_site_url = cross_site_url.ReplaceComponents(replace_host); |
247 NavigateFrameToURL(root->child_at(0), cross_site_url); | 247 NavigateFrameToURL(root->child_at(0), cross_site_url); |
248 | 248 |
249 // Ensure that we have created a new process for the subframe. | 249 // Ensure that we have created a new process for the subframe. |
250 ASSERT_EQ(1U, root->child_count()); | 250 ASSERT_EQ(2U, root->child_count()); |
251 FrameTreeNode* child = root->child_at(0); | 251 FrameTreeNode* child = root->child_at(0); |
252 SiteInstance* child_instance = child->current_frame_host()->GetSiteInstance(); | 252 SiteInstance* child_instance = child->current_frame_host()->GetSiteInstance(); |
253 RenderViewHost* rvh = child->current_frame_host()->render_view_host(); | 253 RenderViewHost* rvh = child->current_frame_host()->render_view_host(); |
254 RenderProcessHost* rph = child->current_frame_host()->GetProcess(); | 254 RenderProcessHost* rph = child->current_frame_host()->GetProcess(); |
255 | 255 |
256 EXPECT_NE(shell()->web_contents()->GetRenderViewHost(), rvh); | 256 EXPECT_NE(shell()->web_contents()->GetRenderViewHost(), rvh); |
257 EXPECT_NE(shell()->web_contents()->GetSiteInstance(), child_instance); | 257 EXPECT_NE(shell()->web_contents()->GetSiteInstance(), child_instance); |
258 EXPECT_NE(shell()->web_contents()->GetRenderProcessHost(), rph); | 258 EXPECT_NE(shell()->web_contents()->GetRenderProcessHost(), rph); |
259 | 259 |
260 // Ensure that the root node has a proxy for the child node's SiteInstance. | 260 // Ensure that the root node has a proxy for the child node's SiteInstance. |
(...skipping 10 matching lines...) Expand all Loading... |
271 // Ensure that the RenderViews and RenderFrames are all live. | 271 // Ensure that the RenderViews and RenderFrames are all live. |
272 EXPECT_TRUE( | 272 EXPECT_TRUE( |
273 root->current_frame_host()->render_view_host()->IsRenderViewLive()); | 273 root->current_frame_host()->render_view_host()->IsRenderViewLive()); |
274 EXPECT_TRUE( | 274 EXPECT_TRUE( |
275 child->current_frame_host()->render_view_host()->IsRenderViewLive()); | 275 child->current_frame_host()->render_view_host()->IsRenderViewLive()); |
276 EXPECT_TRUE(root->current_frame_host()->IsRenderFrameLive()); | 276 EXPECT_TRUE(root->current_frame_host()->IsRenderFrameLive()); |
277 EXPECT_TRUE(root->child_at(0)->current_frame_host()->IsRenderFrameLive()); | 277 EXPECT_TRUE(root->child_at(0)->current_frame_host()->IsRenderFrameLive()); |
278 } | 278 } |
279 | 279 |
280 } // namespace content | 280 } // namespace content |
OLD | NEW |