| 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 "base/macros.h" | 6 #include "base/macros.h" |
| 7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 #include "content/browser/frame_host/frame_tree.h" | 8 #include "content/browser/frame_host/frame_tree.h" |
| 9 #include "content/browser/frame_host/frame_tree_node.h" | 9 #include "content/browser/frame_host/frame_tree_node.h" |
| 10 #include "content/browser/renderer_host/render_view_host_impl.h" | 10 #include "content/browser/renderer_host/render_view_host_impl.h" |
| (...skipping 709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 720 void SetUpOnMainThread() override { | 720 void SetUpOnMainThread() override { |
| 721 host_resolver()->AddRule("*", "127.0.0.1"); | 721 host_resolver()->AddRule("*", "127.0.0.1"); |
| 722 SetupCrossSiteRedirector(embedded_test_server()); | 722 SetupCrossSiteRedirector(embedded_test_server()); |
| 723 ASSERT_TRUE(embedded_test_server()->Start()); | 723 ASSERT_TRUE(embedded_test_server()->Start()); |
| 724 } | 724 } |
| 725 | 725 |
| 726 private: | 726 private: |
| 727 DISALLOW_COPY_AND_ASSIGN(IsolateIcelandFrameTreeBrowserTest); | 727 DISALLOW_COPY_AND_ASSIGN(IsolateIcelandFrameTreeBrowserTest); |
| 728 }; | 728 }; |
| 729 | 729 |
| 730 // Regression test for https://crbug.com/644966 | |
| 731 IN_PROC_BROWSER_TEST_F(IsolateIcelandFrameTreeBrowserTest, | |
| 732 ProcessSwitchForIsolatedBlob) { | |
| 733 // Set up an iframe. | |
| 734 WebContents* contents = shell()->web_contents(); | |
| 735 FrameTreeNode* root = | |
| 736 static_cast<WebContentsImpl*>(contents)->GetFrameTree()->root(); | |
| 737 GURL main_url(embedded_test_server()->GetURL( | |
| 738 "a.com", "/cross_site_iframe_factory.html?a(a)")); | |
| 739 EXPECT_TRUE(NavigateToURL(shell(), main_url)); | |
| 740 | |
| 741 // The navigation targets an invalid blob url; that's intentional to trigger | |
| 742 // an error response. The response should commit in a process dedicated to | |
| 743 // http://b.is. | |
| 744 std::string result; | |
| 745 EXPECT_TRUE(ExecuteScriptAndExtractString( | |
| 746 root, | |
| 747 "var iframe_element = document.getElementsByTagName('iframe')[0];" | |
| 748 "iframe_element.onload = () => {" | |
| 749 " domAutomationController.send('done');" | |
| 750 "};" | |
| 751 "iframe_element.src = 'blob:http://b.is:2932/';", | |
| 752 &result)); | |
| 753 WaitForLoadStop(contents); | |
| 754 | |
| 755 // Make sure we did a process transfer back to "b.is". | |
| 756 EXPECT_EQ( | |
| 757 " Site A ------------ proxies for B\n" | |
| 758 " +--Site B ------- proxies for A\n" | |
| 759 "Where A = http://a.com/\n" | |
| 760 " B = http://b.is/", | |
| 761 FrameTreeVisualizer().DepictFrameTree(root)); | |
| 762 } | |
| 763 | |
| 764 } // namespace content | 730 } // namespace content |
| OLD | NEW |