Chromium Code Reviews| Index: content/browser/site_per_process_browsertest.cc |
| diff --git a/content/browser/site_per_process_browsertest.cc b/content/browser/site_per_process_browsertest.cc |
| index 80c4d169bf440321d0aa58edef178fe177dd45d4..42f417e1f00f6707f3602dfb9a4772ba368afc4a 100644 |
| --- a/content/browser/site_per_process_browsertest.cc |
| +++ b/content/browser/site_per_process_browsertest.cc |
| @@ -1289,7 +1289,7 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, |
| // Load cross-site page into iframe. |
| GURL url = embedded_test_server()->GetURL("foo.com", "/title2.html"); |
| - NavigateFrameToURL(root->child_at(0), url); |
| + NavigateFrameToURL(child, url); |
| EXPECT_TRUE(observer.last_navigation_succeeded()); |
| EXPECT_EQ(url, observer.last_navigation_url()); |
| EXPECT_EQ( |
| @@ -1320,7 +1320,7 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, |
| // Load cross-site page into iframe. |
| url = embedded_test_server()->GetURL("bar.com", "/title2.html"); |
| - NavigateFrameToURL(root->child_at(0), url); |
| + NavigateFrameToURL(child, url); |
| EXPECT_TRUE(observer.last_navigation_succeeded()); |
| EXPECT_EQ(url, observer.last_navigation_url()); |
| EXPECT_EQ( |
| @@ -1348,6 +1348,41 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, |
| " +--Site A\n" |
| "Where A = http://a.com/", |
| DepictFrameTree(root)); |
| + |
| + // Load cross-site page into iframe again. |
| + url = embedded_test_server()->GetURL("f00.com", "/title3.html"); |
| + NavigateFrameToURL(child, url); |
| + EXPECT_TRUE(observer.last_navigation_succeeded()); |
| + EXPECT_EQ(url, observer.last_navigation_url()); |
| + EXPECT_EQ( |
| + " Site A ------------ proxies for D\n" |
| + " |--Site D ------- proxies for A\n" |
| + " +--Site A ------- proxies for D\n" |
| + " +--Site A -- proxies for D\n" |
| + "Where A = http://a.com/\n" |
| + " D = http://f00.com/", |
| + DepictFrameTree(root)); |
| + |
| + // Navigate the iframe itself to about:blank using a script executing in its |
| + // own context. It should stay in the same SiteInstance as before, not the |
| + // parent one. |
| + std::string script( |
| + "window.domAutomationController.send(" |
| + "window.location.href = 'about:blank');"); |
| + TestFrameNavigationObserver frame_observer(child); |
| + EXPECT_TRUE(ExecuteScript(child->current_frame_host(), script)); |
| + frame_observer.Wait(); |
| + EXPECT_EQ(about_blank_url, child->current_url()); |
| + |
| + // Ensure that we have navigated using the top level process. |
| + EXPECT_EQ( |
| + " Site A ------------ proxies for D\n" |
| + " |--Site D ------- proxies for A\n" |
| + " +--Site A ------- proxies for D\n" |
| + " +--Site A -- proxies for D\n" |
| + "Where A = http://a.com/\n" |
| + " D = http://f00.com/", |
| + DepictFrameTree(root)); |
|
ncarter (slow)
2016/04/26 18:40:27
lgtm
If you are working on improving the resoluti
|
| } |
| // This test checks that killing a renderer process of a remote frame |