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

Unified Diff: content/browser/tab_contents/navigation_controller_unittest.cc

Issue 7790018: Don't update URL bar or SSL icon for pending history navs until they commit. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update comment. Created 9 years, 4 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/tab_contents/navigation_controller.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/tab_contents/navigation_controller_unittest.cc
diff --git a/content/browser/tab_contents/navigation_controller_unittest.cc b/content/browser/tab_contents/navigation_controller_unittest.cc
index 4e1ec10f6662b4ba396379143636eadef36eb26a..08306505e10361c814261467814befaa4bf0d0c5 100644
--- a/content/browser/tab_contents/navigation_controller_unittest.cc
+++ b/content/browser/tab_contents/navigation_controller_unittest.cc
@@ -1724,7 +1724,10 @@ TEST_F(NavigationControllerTest, TransientEntry) {
controller().GoToIndex(1);
// The navigation should have been initiated, transient entry should be gone.
EXPECT_EQ(url1, controller().GetActiveEntry()->url());
+ // Visible entry does not update for history navigations until commit.
+ EXPECT_EQ(url3, controller().GetVisibleEntry()->url());
rvh()->SendNavigate(1, url1);
+ EXPECT_EQ(url1, controller().GetVisibleEntry()->url());
// Add a transient and go to an entry after the current one.
transient_entry = new NavigationEntry;
@@ -1734,9 +1737,11 @@ TEST_F(NavigationControllerTest, TransientEntry) {
controller().GoToIndex(3);
// The navigation should have been initiated, transient entry should be gone.
// Because of the transient entry that is removed, going to index 3 makes us
- // land on url2.
+ // land on url2 (which is visible after the commit).
EXPECT_EQ(url2, controller().GetActiveEntry()->url());
+ EXPECT_EQ(url1, controller().GetVisibleEntry()->url());
rvh()->SendNavigate(2, url2);
+ EXPECT_EQ(url2, controller().GetVisibleEntry()->url());
// Add a transient and go forward.
transient_entry = new NavigationEntry;
@@ -1747,7 +1752,9 @@ TEST_F(NavigationControllerTest, TransientEntry) {
controller().GoForward();
// We should have navigated, transient entry should be gone.
EXPECT_EQ(url3, controller().GetActiveEntry()->url());
+ EXPECT_EQ(url2, controller().GetVisibleEntry()->url());
rvh()->SendNavigate(3, url3);
+ EXPECT_EQ(url3, controller().GetVisibleEntry()->url());
// Ensure the URLS are correct.
EXPECT_EQ(controller().entry_count(), 5);
« no previous file with comments | « content/browser/tab_contents/navigation_controller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698