summaryrefslogtreecommitdiffstats
path: root/content/browser/tab_contents/navigation_controller_unittest.cc
diff options
context:
space:
mode:
authorcreis@chromium.org <creis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-07 21:36:46 +0000
committercreis@chromium.org <creis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-07 21:36:46 +0000
commit83c2e233067108fb212ba4082ee02a9bff90d98d (patch)
tree487ac4ff37b79edb0917a5b0660c0d479b94696c /content/browser/tab_contents/navigation_controller_unittest.cc
parentdd4393148b9bded2cfbc54c2c91f7da5c6450ce0 (diff)
downloadchromium_src-83c2e233067108fb212ba4082ee02a9bff90d98d.zip
chromium_src-83c2e233067108fb212ba4082ee02a9bff90d98d.tar.gz
chromium_src-83c2e233067108fb212ba4082ee02a9bff90d98d.tar.bz2
Fix UI quirks when doing a history navigation to a slow page.
This fixes two related issues: 1) The forward button is not immediately disabled when going forward to a slow page, even though the user cannot go forward any more. 2) When cancelling a history navigation to a slow page by performing another history navigation, the throbber remains stuck indicating a load in progress. Also included are tests for each of these issues. Patch from Karl Koscher <supersat@chromium.org> BUG=94747 TEST=Go forward to slow URL, then back. Review URL: http://codereview.chromium.org/8136024 Patch from Karl Koscher <supersat@chromium.org>. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@104571 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/tab_contents/navigation_controller_unittest.cc')
-rw-r--r--content/browser/tab_contents/navigation_controller_unittest.cc24
1 files changed, 24 insertions, 0 deletions
diff --git a/content/browser/tab_contents/navigation_controller_unittest.cc b/content/browser/tab_contents/navigation_controller_unittest.cc
index 39b6603..f856cbe 100644
--- a/content/browser/tab_contents/navigation_controller_unittest.cc
+++ b/content/browser/tab_contents/navigation_controller_unittest.cc
@@ -2114,6 +2114,30 @@ TEST_F(NavigationControllerTest, PruneAllButActiveForTransient) {
EXPECT_EQ(controller().GetTransientEntry()->url(), transient_url);
}
+// Test to ensure that when we do a history navigation back to the current
+// committed page (e.g., going forward to a slow-loading page, then pressing
+// the back button), we just stop the navigation to prevent the throbber from
+// running continuously. Otherwise, the RenderViewHost forces the throbber to
+// start, but WebKit essentially ignores the navigation and never sends a
+// message to stop the throbber.
+TEST_F(NavigationControllerTest, StopOnHistoryNavigationToCurrentPage) {
+ const GURL url0("http://foo/0");
+ const GURL url1("http://foo/1");
+
+ NavigateAndCommit(url0);
+ NavigateAndCommit(url1);
+
+ // Go back to the original page, then forward to the slow page, then back
+ controller().GoBack();
+ contents()->CommitPendingNavigation();
+
+ controller().GoForward();
+ EXPECT_EQ(1, controller().pending_entry_index());
+
+ controller().GoBack();
+ EXPECT_EQ(-1, controller().pending_entry_index());
+}
+
/* TODO(brettw) These test pass on my local machine but fail on the XP buildbot
(but not Vista) cleaning up the directory after they run.
This should be fixed.