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

Unified Diff: content/browser/frame_host/navigation_controller_impl_browsertest.cc

Issue 1245433002: Don't clear the forward history when replacing entries. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add test Created 5 years, 5 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 | « content/browser/frame_host/navigation_controller_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/frame_host/navigation_controller_impl_browsertest.cc
diff --git a/content/browser/frame_host/navigation_controller_impl_browsertest.cc b/content/browser/frame_host/navigation_controller_impl_browsertest.cc
index ba4a49d1d4de3f05005e651f220a64d46afd8550..8a6c268390b96616340672f04479e4680073abc6 100644
--- a/content/browser/frame_host/navigation_controller_impl_browsertest.cc
+++ b/content/browser/frame_host/navigation_controller_impl_browsertest.cc
@@ -186,9 +186,19 @@ IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest,
EXPECT_EQ(1, controller.GetEntryCount());
EXPECT_EQ(1, RendererHistoryLength(shell()));
- EXPECT_TRUE(NavigateToURLAndReplace(shell(), GURL("data:text/html,page2")));
- EXPECT_EQ(1, controller.GetEntryCount());
- EXPECT_EQ(1, RendererHistoryLength(shell()));
+ EXPECT_TRUE(NavigateToURL(shell(), GURL("data:text/html,page2")));
+ EXPECT_EQ(2, controller.GetEntryCount());
+ EXPECT_EQ(2, RendererHistoryLength(shell()));
+
+ // Go back and then replace the first entry.
+ controller.GoBack();
+ EXPECT_TRUE(WaitForLoadStop(shell()->web_contents()));
+ EXPECT_TRUE(controller.CanGoForward());
+
+ EXPECT_TRUE(NavigateToURLAndReplace(shell(), GURL("data:text/html,page1b")));
+ EXPECT_EQ(2, controller.GetEntryCount());
+ EXPECT_EQ(2, RendererHistoryLength(shell()));
+ EXPECT_TRUE(controller.CanGoForward());
Avi (use Gerrit) 2015/07/16 20:00:16 Are you sure that this change keeps testing the sa
Charlie Reis 2015/07/16 20:17:43 Good point. The fact that I only had one addition
// Note that there's no way to access the renderer's notion of the history
// offset via JavaScript. Checking just the history length, though, is enough;
« no previous file with comments | « content/browser/frame_host/navigation_controller_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698