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

Unified Diff: content/browser/site_per_process_browsertest.cc

Issue 1722613002: PlzNavigate: make SitePerProcessBrowserTest.NavigateRemoteAfterError work (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@navigation-policy
Patch Set: Rebase + addressed comments Created 4 years, 10 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | testing/buildbot/filters/browser-side-navigation.linux.content_browsertests.filter » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 a40bef1db90666c0f6d2a55f8a6a3286303932ac..2a4cc3ccf4644a9fa9ec2d8ac56246c2deed5c3c 100644
--- a/content/browser/site_per_process_browsertest.cc
+++ b/content/browser/site_per_process_browsertest.cc
@@ -1342,35 +1342,45 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, NavigateRemoteAfterError) {
->GetFrameTree()
->root();
- TestNavigationObserver observer(shell()->web_contents());
-
// Load same-site page into iframe.
- FrameTreeNode* child = root->child_at(0);
- GURL http_url(embedded_test_server()->GetURL("a.com", "/title1.html"));
- NavigateFrameToURL(child, http_url);
- EXPECT_EQ(http_url, observer.last_navigation_url());
- EXPECT_TRUE(observer.last_navigation_succeeded());
+ {
+ TestNavigationObserver observer(shell()->web_contents());
+ FrameTreeNode* child = root->child_at(0);
+ GURL http_url(embedded_test_server()->GetURL("a.com", "/title1.html"));
+ NavigateFrameToURL(child, http_url);
+ EXPECT_EQ(http_url, observer.last_navigation_url());
+ EXPECT_TRUE(observer.last_navigation_succeeded());
+ observer.Wait();
+ }
// Load cross-site page into iframe.
- GURL url = embedded_test_server()->GetURL("foo.com", "/title2.html");
- NavigateFrameToURL(root->child_at(0), url);
- EXPECT_TRUE(observer.last_navigation_succeeded());
- EXPECT_EQ(url, observer.last_navigation_url());
+ {
+ TestNavigationObserver observer(shell()->web_contents());
+ FrameTreeNode* child = root->child_at(0);
+ GURL url = embedded_test_server()->GetURL("foo.com", "/title2.html");
+ NavigateFrameToURL(root->child_at(0), url);
+ EXPECT_TRUE(observer.last_navigation_succeeded());
+ EXPECT_EQ(url, observer.last_navigation_url());
+ observer.Wait();
- // Ensure that we have created a new process for the subframe.
- EXPECT_EQ(
- " Site A ------------ proxies for B\n"
- " +--Site B ------- proxies for A\n"
- "Where A = http://a.com/\n"
- " B = http://foo.com/",
- DepictFrameTree(root));
- SiteInstance* site_instance = child->current_frame_host()->GetSiteInstance();
- EXPECT_NE(shell()->web_contents()->GetSiteInstance(), site_instance);
+ // Ensure that we have created a new process for the subframe.
+ EXPECT_EQ(
+ " Site A ------------ proxies for B\n"
+ " +--Site B ------- proxies for A\n"
+ "Where A = http://a.com/\n"
+ " B = http://foo.com/",
+ DepictFrameTree(root));
+ SiteInstance* site_instance =
+ child->current_frame_host()->GetSiteInstance();
+ EXPECT_NE(shell()->web_contents()->GetSiteInstance(), site_instance);
+ }
// Stop the test server and try to navigate the remote frame.
- url = embedded_test_server()->GetURL("bar.com", "/title3.html");
- EXPECT_TRUE(embedded_test_server()->ShutdownAndWaitUntilComplete());
- NavigateIframeToURL(shell()->web_contents(), "child-0", url);
+ {
+ GURL url = embedded_test_server()->GetURL("bar.com", "/title3.html");
+ EXPECT_TRUE(embedded_test_server()->ShutdownAndWaitUntilComplete());
+ NavigateIframeToURL(shell()->web_contents(), "child-0", url);
+ }
}
// Ensure that a cross-site page ends up in the correct process when it
« no previous file with comments | « no previous file | testing/buildbot/filters/browser-side-navigation.linux.content_browsertests.filter » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698