Chromium Code Reviews| Index: content/browser/frame_host/render_frame_host_manager_browsertest.cc |
| diff --git a/content/browser/frame_host/render_frame_host_manager_browsertest.cc b/content/browser/frame_host/render_frame_host_manager_browsertest.cc |
| index f30d331b88ced2fe98878bbaad2bd1404257f4ab..59c9a1c7745cc8b29ad7e5861c3048935dccd1d7 100644 |
| --- a/content/browser/frame_host/render_frame_host_manager_browsertest.cc |
| +++ b/content/browser/frame_host/render_frame_host_manager_browsertest.cc |
| @@ -3030,4 +3030,54 @@ IN_PROC_BROWSER_TEST_F(RenderFrameHostManagerTest, LastCommittedOrigin) { |
| } |
| } |
| +// Ensure that loading a page with a cross-site coreferencing iframe |
| +// does not cause an infinite number of nested iframes to be created. |
| +// TODO(davidsac): This test should be broken until issue 527367 is resolved. |
|
alexmos
2016/12/28 00:25:59
I don't see how issue 527367 is related to this te
davidsac (gone - try alexmos)
2017/01/06 00:44:57
Done.
|
| +// Also, a decision of how to handle the issue will determine what FrameTree |
| +// string to expect |
| +IN_PROC_BROWSER_TEST_F(RenderFrameHostManagerTest, CoReferencingFrames) { |
| + // Load a page with a cross-site coreferencing iframe. |
| + StartEmbeddedServer(); |
| + GURL url_1( |
| + embedded_test_server()->GetURL("a.com", "/coreferencingframe_1.html")); |
| + EXPECT_TRUE(NavigateToURL(shell(), url_1)); |
| + |
| + WebContentsImpl* web_contents = |
| + static_cast<WebContentsImpl*>(shell()->web_contents()); |
| + |
| + FrameTreeNode* root = web_contents->GetFrameTree()->root(); |
| + |
| + if (AreAllSitesIsolatedForTesting()) { |
| + // The Frame Tree contains two successful instances of each site plus an |
| + // unsuccessfully-navigated third instance of B with a blank URL. |
| + EXPECT_EQ( |
| + " Site A ------------ proxies for B\n" |
| + " +--Site B ------- proxies for A\n" |
| + " +--Site A -- proxies for B\n" |
| + " +--Site B -- proxies for A\n" |
| + " +--Site B -- proxies for A\n" |
| + "Where A = http://a.com/\n" |
| + " B = http://b.com/", |
| + FrameTreeVisualizer().DepictFrameTree(root)); |
| + } else { |
| + // The Frame Tree contains two successful instances of each site plus an |
|
alexmos
2016/12/28 00:25:59
nit: s/Frame Tree/FrameTree/g (to match class nam
davidsac (gone - try alexmos)
2017/01/06 00:44:57
Done.
|
| + // unsuccessfully-navigated third instance of B with a blank URL. The |
| + // FrameTreeVisualizer depicts all nodes as referencing Site A because |
| + // iframes |
|
alexmos
2016/12/28 00:25:59
nit: unnecessary line break
davidsac (gone - try alexmos)
2017/01/06 00:44:57
Done.
|
| + // are identified with their root site when outside of site-per-process |
| + // mode. |
|
alexmos
2016/12/28 00:25:59
I think you can just put this comment above the if
davidsac (gone - try alexmos)
2017/01/06 00:44:57
Done.
|
| + EXPECT_EQ( |
| + " Site A\n" |
| + " +--Site A\n" |
| + " +--Site A\n" |
| + " +--Site A\n" |
| + " +--Site A\nWhere A = http://a.com/", |
|
alexmos
2016/12/28 00:25:59
nit: line break after \n
davidsac (gone - try alexmos)
2017/01/06 00:44:57
Done.
|
| + FrameTreeVisualizer().DepictFrameTree(root)); |
| + } |
| + |
| + EXPECT_EQ( |
| + root->child_at(0)->child_at(0)->child_at(0)->child_at(0)->current_url(), |
|
alexmos
2016/12/28 00:25:59
You can use GURL::is_empty() for this, along with
davidsac (gone - try alexmos)
2017/01/06 00:44:57
Done.
|
| + ""); |
| +} |
| + |
| } // namespace content |