Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 630 GetFrameDeviceScaleFactor(web_contents())); | 630 GetFrameDeviceScaleFactor(web_contents())); |
| 631 | 631 |
| 632 FrameTreeNode* root = web_contents()->GetFrameTree()->root(); | 632 FrameTreeNode* root = web_contents()->GetFrameTree()->root(); |
| 633 FrameTreeNode* child = root->child_at(0); | 633 FrameTreeNode* child = root->child_at(0); |
| 634 EXPECT_EQ(SitePerProcessHighDPIBrowserTest::kDeviceScaleFactor, | 634 EXPECT_EQ(SitePerProcessHighDPIBrowserTest::kDeviceScaleFactor, |
| 635 GetFrameDeviceScaleFactor(child)); | 635 GetFrameDeviceScaleFactor(child)); |
| 636 } | 636 } |
| 637 | 637 |
| 638 // Ensure that navigating subframes in --site-per-process mode works and the | 638 // Ensure that navigating subframes in --site-per-process mode works and the |
| 639 // correct documents are committed. | 639 // correct documents are committed. |
| 640 #if defined(OS_WIN) | 640 IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, CrossSiteIframe) { |
| 641 // This test is flaky on Windows, see https://crbug.com/629419. | |
| 642 #define MAYBE_CrossSiteIframe DISABLED_CrossSiteIframe | |
| 643 #else | |
| 644 #define MAYBE_CrossSiteIframe CrossSiteIframe | |
| 645 #endif | |
| 646 IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, MAYBE_CrossSiteIframe) { | |
| 647 GURL main_url(embedded_test_server()->GetURL( | 641 GURL main_url(embedded_test_server()->GetURL( |
| 648 "a.com", "/cross_site_iframe_factory.html?a(a,a(a,a(a)))")); | 642 "a.com", "/cross_site_iframe_factory.html?a(a,a(a,a(a)))")); |
| 649 NavigateToURL(shell(), main_url); | 643 NavigateToURL(shell(), main_url); |
| 650 | 644 |
| 651 // It is safe to obtain the root frame tree node here, as it doesn't change. | 645 // It is safe to obtain the root frame tree node here, as it doesn't change. |
| 652 FrameTreeNode* root = web_contents()->GetFrameTree()->root(); | 646 FrameTreeNode* root = web_contents()->GetFrameTree()->root(); |
| 653 | 647 |
| 654 TestNavigationObserver observer(shell()->web_contents()); | 648 TestNavigationObserver observer(shell()->web_contents()); |
| 655 | 649 |
| 656 // Load same-site page into iframe. | 650 // Load same-site page into iframe. |
| 657 FrameTreeNode* child = root->child_at(0); | 651 FrameTreeNode* child = root->child_at(0); |
| 658 GURL http_url(embedded_test_server()->GetURL("a.com", "/title1.html")); | 652 GURL http_url(embedded_test_server()->GetURL("a.com", "/title1.html")); |
| 659 NavigateFrameToURL(child, http_url); | 653 NavigateFrameToURL(child, http_url); |
|
Łukasz Anforowicz
2016/11/07 22:08:40
No need for RenderFrameDeletedObserver in-between
Charlie Reis
2016/11/07 22:58:08
This one is same-site, so there's no deletion of a
| |
| 660 EXPECT_EQ(http_url, observer.last_navigation_url()); | 654 EXPECT_EQ(http_url, observer.last_navigation_url()); |
| 661 EXPECT_TRUE(observer.last_navigation_succeeded()); | 655 EXPECT_TRUE(observer.last_navigation_succeeded()); |
| 662 { | 656 { |
| 663 // There should be only one RenderWidgetHost when there are no | 657 // There should be only one RenderWidgetHost when there are no |
| 664 // cross-process iframes. | 658 // cross-process iframes. |
| 665 std::set<RenderWidgetHostView*> views_set = | 659 std::set<RenderWidgetHostView*> views_set = |
| 666 web_contents()->GetRenderWidgetHostViewsInTree(); | 660 web_contents()->GetRenderWidgetHostViewsInTree(); |
| 667 EXPECT_EQ(1U, views_set.size()); | 661 EXPECT_EQ(1U, views_set.size()); |
| 668 } | 662 } |
| 669 | 663 |
| 670 EXPECT_EQ( | 664 EXPECT_EQ( |
| 671 " Site A\n" | 665 " Site A\n" |
| 672 " |--Site A\n" | 666 " |--Site A\n" |
| 673 " +--Site A\n" | 667 " +--Site A\n" |
| 674 " |--Site A\n" | 668 " |--Site A\n" |
| 675 " +--Site A\n" | 669 " +--Site A\n" |
| 676 " +--Site A\n" | 670 " +--Site A\n" |
| 677 "Where A = http://a.com/", | 671 "Where A = http://a.com/", |
| 678 DepictFrameTree(root)); | 672 DepictFrameTree(root)); |
| 679 | 673 |
| 680 // Load cross-site page into iframe. | 674 // Load cross-site page into iframe. |
| 681 GURL url = embedded_test_server()->GetURL("foo.com", "/title2.html"); | 675 GURL url = embedded_test_server()->GetURL("foo.com", "/title2.html"); |
| 682 NavigateFrameToURL(root->child_at(0), url); | 676 { |
| 677 RenderFrameDeletedObserver deleted_observer(child->current_frame_host()); | |
|
Charlie Reis
2016/11/07 18:20:07
The general rule is that we need this around each
| |
| 678 NavigateFrameToURL(root->child_at(0), url); | |
| 679 deleted_observer.WaitUntilDeleted(); | |
| 680 } | |
| 683 // Verify that the navigation succeeded and the expected URL was loaded. | 681 // Verify that the navigation succeeded and the expected URL was loaded. |
| 684 EXPECT_TRUE(observer.last_navigation_succeeded()); | 682 EXPECT_TRUE(observer.last_navigation_succeeded()); |
| 685 EXPECT_EQ(url, observer.last_navigation_url()); | 683 EXPECT_EQ(url, observer.last_navigation_url()); |
| 686 | 684 |
| 687 // Ensure that we have created a new process for the subframe. | 685 // Ensure that we have created a new process for the subframe. |
| 688 ASSERT_EQ(2U, root->child_count()); | 686 ASSERT_EQ(2U, root->child_count()); |
| 689 SiteInstance* site_instance = child->current_frame_host()->GetSiteInstance(); | 687 SiteInstance* site_instance = child->current_frame_host()->GetSiteInstance(); |
| 690 RenderViewHost* rvh = child->current_frame_host()->render_view_host(); | 688 RenderViewHost* rvh = child->current_frame_host()->render_view_host(); |
| 691 RenderProcessHost* rph = child->current_frame_host()->GetProcess(); | 689 RenderProcessHost* rph = child->current_frame_host()->GetProcess(); |
| 692 EXPECT_NE(shell()->web_contents()->GetRenderViewHost(), rvh); | 690 EXPECT_NE(shell()->web_contents()->GetRenderViewHost(), rvh); |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 716 " +--Site A ------- proxies for B\n" | 714 " +--Site A ------- proxies for B\n" |
| 717 " |--Site A -- proxies for B\n" | 715 " |--Site A -- proxies for B\n" |
| 718 " +--Site A -- proxies for B\n" | 716 " +--Site A -- proxies for B\n" |
| 719 " +--Site A -- proxies for B\n" | 717 " +--Site A -- proxies for B\n" |
| 720 "Where A = http://a.com/\n" | 718 "Where A = http://a.com/\n" |
| 721 " B = http://foo.com/", | 719 " B = http://foo.com/", |
| 722 DepictFrameTree(root)); | 720 DepictFrameTree(root)); |
| 723 | 721 |
| 724 // Load another cross-site page into the same iframe. | 722 // Load another cross-site page into the same iframe. |
| 725 url = embedded_test_server()->GetURL("bar.com", "/title3.html"); | 723 url = embedded_test_server()->GetURL("bar.com", "/title3.html"); |
| 726 NavigateFrameToURL(root->child_at(0), url); | 724 { |
| 725 RenderFrameDeletedObserver deleted_observer(child->current_frame_host()); | |
| 726 NavigateFrameToURL(root->child_at(0), url); | |
| 727 deleted_observer.WaitUntilDeleted(); | |
| 728 } | |
| 727 EXPECT_TRUE(observer.last_navigation_succeeded()); | 729 EXPECT_TRUE(observer.last_navigation_succeeded()); |
| 728 EXPECT_EQ(url, observer.last_navigation_url()); | 730 EXPECT_EQ(url, observer.last_navigation_url()); |
| 729 | 731 |
| 730 // Check again that a new process is created and is different from the | 732 // Check again that a new process is created and is different from the |
| 731 // top level one and the previous one. | 733 // top level one and the previous one. |
| 732 ASSERT_EQ(2U, root->child_count()); | 734 ASSERT_EQ(2U, root->child_count()); |
| 733 child = root->child_at(0); | 735 child = root->child_at(0); |
| 734 EXPECT_NE(shell()->web_contents()->GetRenderViewHost(), | 736 EXPECT_NE(shell()->web_contents()->GetRenderViewHost(), |
| 735 child->current_frame_host()->render_view_host()); | 737 child->current_frame_host()->render_view_host()); |
| 736 EXPECT_NE(rvh, child->current_frame_host()->render_view_host()); | 738 EXPECT_NE(rvh, child->current_frame_host()->render_view_host()); |
| (...skipping 973 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1710 EXPECT_EQ( | 1712 EXPECT_EQ( |
| 1711 " Site A ------------ proxies for B C\n" | 1713 " Site A ------------ proxies for B C\n" |
| 1712 " |--Site B ------- proxies for A C\n" | 1714 " |--Site B ------- proxies for A C\n" |
| 1713 " +--Site C ------- proxies for A B\n" | 1715 " +--Site C ------- proxies for A B\n" |
| 1714 "Where A = http://a.com/\n" | 1716 "Where A = http://a.com/\n" |
| 1715 " B = http://foo.com/ (no process)\n" | 1717 " B = http://foo.com/ (no process)\n" |
| 1716 " C = http://bar.com/", | 1718 " C = http://bar.com/", |
| 1717 DepictFrameTree(root)); | 1719 DepictFrameTree(root)); |
| 1718 } | 1720 } |
| 1719 | 1721 |
| 1720 #if defined(OS_WIN) | 1722 IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, NavigateRemoteFrame) { |
| 1721 // This test is flaky on Windows, see https://crbug.com/629419. | |
| 1722 #define MAYBE_NavigateRemoteFrame DISABLED_NavigateRemoteFrame | |
| 1723 #else | |
| 1724 #define MAYBE_NavigateRemoteFrame NavigateRemoteFrame | |
| 1725 #endif | |
| 1726 IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, MAYBE_NavigateRemoteFrame) { | |
| 1727 GURL main_url(embedded_test_server()->GetURL( | 1723 GURL main_url(embedded_test_server()->GetURL( |
| 1728 "a.com", "/cross_site_iframe_factory.html?a(a,a(a,a(a)))")); | 1724 "a.com", "/cross_site_iframe_factory.html?a(a,a(a,a(a)))")); |
| 1729 NavigateToURL(shell(), main_url); | 1725 NavigateToURL(shell(), main_url); |
| 1730 | 1726 |
| 1731 // It is safe to obtain the root frame tree node here, as it doesn't change. | 1727 // It is safe to obtain the root frame tree node here, as it doesn't change. |
| 1732 FrameTreeNode* root = web_contents()->GetFrameTree()->root(); | 1728 FrameTreeNode* root = web_contents()->GetFrameTree()->root(); |
| 1733 | 1729 |
| 1734 TestNavigationObserver observer(shell()->web_contents()); | 1730 TestNavigationObserver observer(shell()->web_contents()); |
| 1735 | 1731 |
| 1736 // Load same-site page into iframe. | 1732 // Load same-site page into iframe. |
| 1737 FrameTreeNode* child = root->child_at(0); | 1733 FrameTreeNode* child = root->child_at(0); |
| 1738 GURL http_url(embedded_test_server()->GetURL("a.com", "/title1.html")); | 1734 GURL http_url(embedded_test_server()->GetURL("a.com", "/title1.html")); |
| 1739 NavigateFrameToURL(child, http_url); | 1735 NavigateFrameToURL(child, http_url); |
|
Łukasz Anforowicz
2016/11/07 22:08:40
I think I understand no need for RenderFrameDelete
Charlie Reis
2016/11/07 22:58:08
We can't, for the same reason as above-- it would
| |
| 1740 EXPECT_EQ(http_url, observer.last_navigation_url()); | 1736 EXPECT_EQ(http_url, observer.last_navigation_url()); |
| 1741 EXPECT_TRUE(observer.last_navigation_succeeded()); | 1737 EXPECT_TRUE(observer.last_navigation_succeeded()); |
| 1742 | 1738 |
| 1743 // Load cross-site page into iframe. | 1739 // Load cross-site page into iframe. |
| 1744 GURL url = embedded_test_server()->GetURL("foo.com", "/title2.html"); | 1740 GURL url = embedded_test_server()->GetURL("foo.com", "/title2.html"); |
| 1745 NavigateFrameToURL(root->child_at(0), url); | 1741 { |
| 1742 RenderFrameDeletedObserver deleted_observer(child->current_frame_host()); | |
| 1743 NavigateFrameToURL(root->child_at(0), url); | |
| 1744 deleted_observer.WaitUntilDeleted(); | |
| 1745 } | |
| 1746 EXPECT_TRUE(observer.last_navigation_succeeded()); | 1746 EXPECT_TRUE(observer.last_navigation_succeeded()); |
| 1747 EXPECT_EQ(url, observer.last_navigation_url()); | 1747 EXPECT_EQ(url, observer.last_navigation_url()); |
| 1748 | 1748 |
| 1749 // Ensure that we have created a new process for the subframe. | 1749 // Ensure that we have created a new process for the subframe. |
| 1750 EXPECT_EQ( | 1750 EXPECT_EQ( |
| 1751 " Site A ------------ proxies for B\n" | 1751 " Site A ------------ proxies for B\n" |
| 1752 " |--Site B ------- proxies for A\n" | 1752 " |--Site B ------- proxies for A\n" |
| 1753 " +--Site A ------- proxies for B\n" | 1753 " +--Site A ------- proxies for B\n" |
| 1754 " |--Site A -- proxies for B\n" | 1754 " |--Site A -- proxies for B\n" |
| 1755 " +--Site A -- proxies for B\n" | 1755 " +--Site A -- proxies for B\n" |
| 1756 " +--Site A -- proxies for B\n" | 1756 " +--Site A -- proxies for B\n" |
| 1757 "Where A = http://a.com/\n" | 1757 "Where A = http://a.com/\n" |
| 1758 " B = http://foo.com/", | 1758 " B = http://foo.com/", |
| 1759 DepictFrameTree(root)); | 1759 DepictFrameTree(root)); |
| 1760 SiteInstance* site_instance = child->current_frame_host()->GetSiteInstance(); | 1760 SiteInstance* site_instance = child->current_frame_host()->GetSiteInstance(); |
| 1761 EXPECT_NE(shell()->web_contents()->GetSiteInstance(), site_instance); | 1761 EXPECT_NE(shell()->web_contents()->GetSiteInstance(), site_instance); |
| 1762 | 1762 |
| 1763 // Emulate the main frame changing the src of the iframe such that it | 1763 // Emulate the main frame changing the src of the iframe such that it |
| 1764 // navigates cross-site. | 1764 // navigates cross-site. |
| 1765 url = embedded_test_server()->GetURL("bar.com", "/title3.html"); | 1765 url = embedded_test_server()->GetURL("bar.com", "/title3.html"); |
| 1766 NavigateIframeToURL(shell()->web_contents(), "child-0", url); | 1766 { |
| 1767 RenderFrameDeletedObserver deleted_observer(child->current_frame_host()); | |
| 1768 NavigateIframeToURL(shell()->web_contents(), "child-0", url); | |
| 1769 deleted_observer.WaitUntilDeleted(); | |
| 1770 } | |
| 1767 EXPECT_TRUE(observer.last_navigation_succeeded()); | 1771 EXPECT_TRUE(observer.last_navigation_succeeded()); |
| 1768 EXPECT_EQ(url, observer.last_navigation_url()); | 1772 EXPECT_EQ(url, observer.last_navigation_url()); |
| 1769 | 1773 |
| 1770 // Check again that a new process is created and is different from the | 1774 // Check again that a new process is created and is different from the |
| 1771 // top level one and the previous one. | 1775 // top level one and the previous one. |
| 1772 EXPECT_EQ( | 1776 EXPECT_EQ( |
| 1773 " Site A ------------ proxies for C\n" | 1777 " Site A ------------ proxies for C\n" |
| 1774 " |--Site C ------- proxies for A\n" | 1778 " |--Site C ------- proxies for A\n" |
| 1775 " +--Site A ------- proxies for C\n" | 1779 " +--Site A ------- proxies for C\n" |
| 1776 " |--Site A -- proxies for C\n" | 1780 " |--Site A -- proxies for C\n" |
| 1777 " +--Site A -- proxies for C\n" | 1781 " +--Site A -- proxies for C\n" |
| 1778 " +--Site A -- proxies for C\n" | 1782 " +--Site A -- proxies for C\n" |
| 1779 "Where A = http://a.com/\n" | 1783 "Where A = http://a.com/\n" |
| 1780 " C = http://bar.com/", | 1784 " C = http://bar.com/", |
| 1781 DepictFrameTree(root)); | 1785 DepictFrameTree(root)); |
| 1782 | 1786 |
| 1783 // Navigate back to the parent's origin and ensure we return to the | 1787 // Navigate back to the parent's origin and ensure we return to the |
| 1784 // parent's process. | 1788 // parent's process. |
| 1785 NavigateFrameToURL(child, http_url); | 1789 { |
| 1790 RenderFrameDeletedObserver deleted_observer(child->current_frame_host()); | |
| 1791 NavigateFrameToURL(child, http_url); | |
| 1792 deleted_observer.WaitUntilDeleted(); | |
| 1793 } | |
| 1786 EXPECT_EQ(http_url, observer.last_navigation_url()); | 1794 EXPECT_EQ(http_url, observer.last_navigation_url()); |
| 1787 EXPECT_TRUE(observer.last_navigation_succeeded()); | 1795 EXPECT_TRUE(observer.last_navigation_succeeded()); |
| 1788 EXPECT_EQ(shell()->web_contents()->GetSiteInstance(), | 1796 EXPECT_EQ(shell()->web_contents()->GetSiteInstance(), |
| 1789 child->current_frame_host()->GetSiteInstance()); | 1797 child->current_frame_host()->GetSiteInstance()); |
| 1790 } | 1798 } |
| 1791 | 1799 |
| 1792 IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, | 1800 IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, |
| 1793 NavigateRemoteFrameToBlankAndDataURLs) { | 1801 NavigateRemoteFrameToBlankAndDataURLs) { |
| 1794 GURL main_url(embedded_test_server()->GetURL( | 1802 GURL main_url(embedded_test_server()->GetURL( |
| 1795 "a.com", "/cross_site_iframe_factory.html?a(a,a(a))")); | 1803 "a.com", "/cross_site_iframe_factory.html?a(a,a(a))")); |
| (...skipping 2445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4241 // wait for reply. | 4249 // wait for reply. |
| 4242 PostMessageAndWaitForReply(child1, "postToSibling('subframe-msg', 2)", | 4250 PostMessageAndWaitForReply(child1, "postToSibling('subframe-msg', 2)", |
| 4243 "\"done-1-2-name\""); | 4251 "\"done-1-2-name\""); |
| 4244 | 4252 |
| 4245 // Verify the total number of received messages for each subframe. | 4253 // Verify the total number of received messages for each subframe. |
| 4246 EXPECT_EQ(1, GetReceivedMessages(child0)); | 4254 EXPECT_EQ(1, GetReceivedMessages(child0)); |
| 4247 EXPECT_EQ(2, GetReceivedMessages(child1)); | 4255 EXPECT_EQ(2, GetReceivedMessages(child1)); |
| 4248 EXPECT_EQ(1, GetReceivedMessages(child2)); | 4256 EXPECT_EQ(1, GetReceivedMessages(child2)); |
| 4249 } | 4257 } |
| 4250 | 4258 |
| 4251 #if defined(OS_WIN) | 4259 IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, RFPHDestruction) { |
| 4252 // This test is flaky on Windows, see https://crbug.com/629419. | |
| 4253 #define MAYBE_RFPHDestruction DISABLED_RFPHDestruction | |
| 4254 #else | |
| 4255 #define MAYBE_RFPHDestruction RFPHDestruction | |
| 4256 #endif | |
| 4257 IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, MAYBE_RFPHDestruction) { | |
| 4258 GURL main_url(embedded_test_server()->GetURL("/site_per_process_main.html")); | 4260 GURL main_url(embedded_test_server()->GetURL("/site_per_process_main.html")); |
| 4259 NavigateToURL(shell(), main_url); | 4261 NavigateToURL(shell(), main_url); |
| 4260 | 4262 |
| 4261 // It is safe to obtain the root frame tree node here, as it doesn't change. | 4263 // It is safe to obtain the root frame tree node here, as it doesn't change. |
| 4262 FrameTreeNode* root = web_contents()->GetFrameTree()->root(); | 4264 FrameTreeNode* root = web_contents()->GetFrameTree()->root(); |
| 4263 | 4265 |
| 4264 TestNavigationObserver observer(shell()->web_contents()); | 4266 TestNavigationObserver observer(shell()->web_contents()); |
| 4265 | 4267 |
| 4266 // Load cross-site page into iframe. | 4268 // Load cross-site page into iframe. |
| 4267 FrameTreeNode* child = root->child_at(0); | 4269 FrameTreeNode* child = root->child_at(0); |
| 4268 GURL url = embedded_test_server()->GetURL("foo.com", "/title2.html"); | 4270 GURL url = embedded_test_server()->GetURL("foo.com", "/title2.html"); |
| 4269 NavigateFrameToURL(root->child_at(0), url); | 4271 { |
| 4272 RenderFrameDeletedObserver deleted_observer(child->current_frame_host()); | |
| 4273 NavigateFrameToURL(root->child_at(0), url); | |
| 4274 deleted_observer.WaitUntilDeleted(); | |
| 4275 } | |
| 4270 EXPECT_TRUE(observer.last_navigation_succeeded()); | 4276 EXPECT_TRUE(observer.last_navigation_succeeded()); |
| 4271 EXPECT_EQ(url, observer.last_navigation_url()); | 4277 EXPECT_EQ(url, observer.last_navigation_url()); |
| 4272 EXPECT_EQ( | 4278 EXPECT_EQ( |
| 4273 " Site A ------------ proxies for B\n" | 4279 " Site A ------------ proxies for B\n" |
| 4274 " |--Site B ------- proxies for A\n" | 4280 " |--Site B ------- proxies for A\n" |
| 4275 " +--Site A ------- proxies for B\n" | 4281 " +--Site A ------- proxies for B\n" |
| 4276 " |--Site A -- proxies for B\n" | 4282 " |--Site A -- proxies for B\n" |
| 4277 " +--Site A -- proxies for B\n" | 4283 " +--Site A -- proxies for B\n" |
| 4278 " +--Site A -- proxies for B\n" | 4284 " +--Site A -- proxies for B\n" |
| 4279 "Where A = http://127.0.0.1/\n" | 4285 "Where A = http://127.0.0.1/\n" |
| 4280 " B = http://foo.com/", | 4286 " B = http://foo.com/", |
| 4281 DepictFrameTree(root)); | 4287 DepictFrameTree(root)); |
| 4282 | 4288 |
| 4283 // Load another cross-site page. | 4289 // Load another cross-site page. |
| 4284 url = embedded_test_server()->GetURL("bar.com", "/title3.html"); | 4290 url = embedded_test_server()->GetURL("bar.com", "/title3.html"); |
| 4285 NavigateIframeToURL(shell()->web_contents(), "test", url); | 4291 { |
| 4292 RenderFrameDeletedObserver deleted_observer(child->current_frame_host()); | |
| 4293 NavigateIframeToURL(shell()->web_contents(), "test", url); | |
| 4294 deleted_observer.WaitUntilDeleted(); | |
| 4295 } | |
| 4286 EXPECT_TRUE(observer.last_navigation_succeeded()); | 4296 EXPECT_TRUE(observer.last_navigation_succeeded()); |
| 4287 EXPECT_EQ(url, observer.last_navigation_url()); | 4297 EXPECT_EQ(url, observer.last_navigation_url()); |
| 4288 EXPECT_EQ( | 4298 EXPECT_EQ( |
| 4289 " Site A ------------ proxies for C\n" | 4299 " Site A ------------ proxies for C\n" |
| 4290 " |--Site C ------- proxies for A\n" | 4300 " |--Site C ------- proxies for A\n" |
| 4291 " +--Site A ------- proxies for C\n" | 4301 " +--Site A ------- proxies for C\n" |
| 4292 " |--Site A -- proxies for C\n" | 4302 " |--Site A -- proxies for C\n" |
| 4293 " +--Site A -- proxies for C\n" | 4303 " +--Site A -- proxies for C\n" |
| 4294 " +--Site A -- proxies for C\n" | 4304 " +--Site A -- proxies for C\n" |
| 4295 "Where A = http://127.0.0.1/\n" | 4305 "Where A = http://127.0.0.1/\n" |
| 4296 " C = http://bar.com/", | 4306 " C = http://bar.com/", |
| 4297 DepictFrameTree(root)); | 4307 DepictFrameTree(root)); |
| 4298 | 4308 |
| 4299 // Navigate back to the parent's origin. | 4309 // Navigate back to the parent's origin. |
| 4300 RenderFrameDeletedObserver deleted_observer(child->current_frame_host()); | 4310 { |
| 4301 url = embedded_test_server()->GetURL("/title1.html"); | 4311 RenderFrameDeletedObserver deleted_observer(child->current_frame_host()); |
| 4302 NavigateFrameToURL(child, url); | 4312 url = embedded_test_server()->GetURL("/title1.html"); |
| 4313 NavigateFrameToURL(child, url); | |
| 4314 // Wait for the old process to exit, to verify that the proxies go away. | |
| 4315 deleted_observer.WaitUntilDeleted(); | |
| 4316 } | |
| 4303 EXPECT_EQ(url, observer.last_navigation_url()); | 4317 EXPECT_EQ(url, observer.last_navigation_url()); |
| 4304 EXPECT_TRUE(observer.last_navigation_succeeded()); | 4318 EXPECT_TRUE(observer.last_navigation_succeeded()); |
| 4305 | 4319 |
| 4306 // Wait for the old process to exit, to verify that the proxies go away. | |
| 4307 deleted_observer.WaitUntilDeleted(); | |
| 4308 EXPECT_EQ( | 4320 EXPECT_EQ( |
| 4309 " Site A\n" | 4321 " Site A\n" |
| 4310 " |--Site A\n" | 4322 " |--Site A\n" |
| 4311 " +--Site A\n" | 4323 " +--Site A\n" |
| 4312 " |--Site A\n" | 4324 " |--Site A\n" |
| 4313 " +--Site A\n" | 4325 " +--Site A\n" |
| 4314 " +--Site A\n" | 4326 " +--Site A\n" |
| 4315 "Where A = http://127.0.0.1/", | 4327 "Where A = http://127.0.0.1/", |
| 4316 DepictFrameTree(root)); | 4328 DepictFrameTree(root)); |
| 4317 } | 4329 } |
| (...skipping 4208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 8526 EXPECT_TRUE(NavigateToURL(shell(), b_url)); | 8538 EXPECT_TRUE(NavigateToURL(shell(), b_url)); |
| 8527 | 8539 |
| 8528 base::string16 expected_title(base::UTF8ToUTF16("foo")); | 8540 base::string16 expected_title(base::UTF8ToUTF16("foo")); |
| 8529 TitleWatcher title_watcher(popup2->web_contents(), expected_title); | 8541 TitleWatcher title_watcher(popup2->web_contents(), expected_title); |
| 8530 EXPECT_TRUE(ExecuteScript( | 8542 EXPECT_TRUE(ExecuteScript( |
| 8531 shell(), "window.open('','popup2').postMessage('foo', '*');")); | 8543 shell(), "window.open('','popup2').postMessage('foo', '*');")); |
| 8532 EXPECT_EQ(expected_title, title_watcher.WaitAndGetTitle()); | 8544 EXPECT_EQ(expected_title, title_watcher.WaitAndGetTitle()); |
| 8533 } | 8545 } |
| 8534 | 8546 |
| 8535 } // namespace content | 8547 } // namespace content |
| OLD | NEW |