Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(96)

Side by Side Diff: content/browser/site_per_process_browsertest.cc

Issue 2541063002: Revert of Remove about:srcdoc url conversion. (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/site_per_process_browsertest.h" 5 #include "content/browser/site_per_process_browsertest.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 8756 matching lines...) Expand 10 before | Expand all | Expand 10 after
8767 8767
8768 // Ensure that an iframe that navigates cross-site doesn't use the same process 8768 // Ensure that an iframe that navigates cross-site doesn't use the same process
8769 // as its parent. Then when its parent navigates it via the "srcdoc" attribute, 8769 // as its parent. Then when its parent navigates it via the "srcdoc" attribute,
8770 // it must reuse its parent's process. 8770 // it must reuse its parent's process.
8771 IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, 8771 IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest,
8772 IframeSrcdocAfterCrossSiteNavigation) { 8772 IframeSrcdocAfterCrossSiteNavigation) {
8773 GURL parent_url(embedded_test_server()->GetURL( 8773 GURL parent_url(embedded_test_server()->GetURL(
8774 "a.com", "/cross_site_iframe_factory.html?a(b)")); 8774 "a.com", "/cross_site_iframe_factory.html?a(b)"));
8775 GURL child_url(embedded_test_server()->GetURL( 8775 GURL child_url(embedded_test_server()->GetURL(
8776 "b.com", "/cross_site_iframe_factory.html?b()")); 8776 "b.com", "/cross_site_iframe_factory.html?b()"));
8777 GURL srcdoc_url(kAboutSrcDocURL); 8777 GURL blank_url(url::kAboutBlankURL);
8778 8778
8779 // #1 Navigate to a page with a cross-site iframe. 8779 // #1 Navigate to a page with a cross-site iframe.
8780 EXPECT_TRUE(NavigateToURL(shell(), parent_url)); 8780 EXPECT_TRUE(NavigateToURL(shell(), parent_url));
8781 8781
8782 // Ensure that the iframe uses its own process. 8782 // Ensure that the iframe uses its own process.
8783 FrameTreeNode* root = web_contents()->GetFrameTree()->root(); 8783 FrameTreeNode* root = web_contents()->GetFrameTree()->root();
8784 ASSERT_EQ(1u, root->child_count()); 8784 ASSERT_EQ(1u, root->child_count());
8785 FrameTreeNode* child = root->child_at(0); 8785 FrameTreeNode* child = root->child_at(0);
8786 EXPECT_EQ(parent_url, root->current_url()); 8786 EXPECT_EQ(parent_url, root->current_url());
8787 EXPECT_EQ(child_url, child->current_url()); 8787 EXPECT_EQ(child_url, child->current_url());
8788 EXPECT_NE(root->current_frame_host()->GetSiteInstance(), 8788 EXPECT_NE(root->current_frame_host()->GetSiteInstance(),
8789 child->current_frame_host()->GetSiteInstance()); 8789 child->current_frame_host()->GetSiteInstance());
8790 EXPECT_NE(root->current_frame_host()->GetProcess(), 8790 EXPECT_NE(root->current_frame_host()->GetProcess(),
8791 child->current_frame_host()->GetProcess()); 8791 child->current_frame_host()->GetProcess());
8792 8792
8793 // #2 Navigate the iframe to its srcdoc attribute. 8793 // #2 Navigate the iframe to its srcdoc attribute.
8794 TestNavigationObserver load_observer(shell()->web_contents()); 8794 TestNavigationObserver load_observer(shell()->web_contents());
8795 EXPECT_TRUE(ExecuteScript( 8795 EXPECT_TRUE(ExecuteScript(
8796 root, "document.getElementById('child-0').srcdoc = 'srcdoc content';")); 8796 root, "document.getElementById('child-0').srcdoc = 'srcdoc content';"));
8797 load_observer.Wait(); 8797 load_observer.Wait();
8798 8798
8799 // Ensure that the iframe reuses its parent's process. 8799 // Ensure that the iframe reuses its parent's process.
8800 EXPECT_EQ(srcdoc_url, child->current_url()); 8800 EXPECT_EQ(blank_url, child->current_url());
8801 EXPECT_EQ(root->current_frame_host()->GetSiteInstance(), 8801 EXPECT_EQ(root->current_frame_host()->GetSiteInstance(),
8802 child->current_frame_host()->GetSiteInstance()); 8802 child->current_frame_host()->GetSiteInstance());
8803 EXPECT_EQ(root->current_frame_host()->GetProcess(), 8803 EXPECT_EQ(root->current_frame_host()->GetProcess(),
8804 child->current_frame_host()->GetProcess()); 8804 child->current_frame_host()->GetProcess());
8805 } 8805 }
8806 8806
8807 } // namespace content 8807 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_process_host_impl.cc ('k') | content/browser/web_contents/web_contents_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698