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

Unified Diff: content/browser/site_per_process_browsertest.cc

Issue 2901093006: Use has_committed_real_load for main frames in addition to subframes. (Closed)
Patch Set: Created 3 years, 7 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 | content/renderer/render_frame_impl.cc » ('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 c96d8ef434c1d8205c7214845b30e2200b87e8e7..1e75835a2fc5fe068aa73848f24dec8bda958923 100644
--- a/content/browser/site_per_process_browsertest.cc
+++ b/content/browser/site_per_process_browsertest.cc
@@ -10152,4 +10152,40 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, PostTargetSubFrame) {
EXPECT_EQ("my_token=my_value\n", body);
}
+// Verify that a remote-to-local main frame navigation doesn't overwrite
+// the previous history entry. See https://crbug.com/725716.
+IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest,
+ CrossProcessMainFrameNavigationDoesNotOverwriteHistory) {
+ GURL foo_url(embedded_test_server()->GetURL("foo.com", "/title1.html"));
+ GURL bar_url(embedded_test_server()->GetURL("bar.com", "/title2.html"));
+
+ EXPECT_TRUE(NavigateToURL(shell(), foo_url));
+
+ // Open a same-site popup to keep the www.foo.com process alive.
+ OpenPopup(shell(), GURL(url::kAboutBlankURL), "foo");
+
+ // Navigate foo -> bar -> foo.
+ EXPECT_TRUE(NavigateToURL(shell(), bar_url));
+ EXPECT_TRUE(NavigateToURL(shell(), foo_url));
+
+ // There should be three history entries.
+ EXPECT_EQ(3, web_contents()->GetController().GetEntryCount());
+
+ // Go back: this should go to bar.com.
+ {
+ TestNavigationObserver back_observer(web_contents());
+ web_contents()->GetController().GoBack();
+ back_observer.Wait();
+ }
+ EXPECT_EQ(bar_url, web_contents()->GetMainFrame()->GetLastCommittedURL());
+
+ // Go back again. This should go to foo.com.
+ {
+ TestNavigationObserver back_observer(web_contents());
+ web_contents()->GetController().GoBack();
+ back_observer.Wait();
+ }
+ EXPECT_EQ(foo_url, web_contents()->GetMainFrame()->GetLastCommittedURL());
+}
+
} // namespace content
« no previous file with comments | « no previous file | content/renderer/render_frame_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698