summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/browser_browsertest.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 /chrome/browser/ui/browser_browsertest.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 'chrome/browser/ui/browser_browsertest.cc')
-rw-r--r--chrome/browser/ui/browser_browsertest.cc29
1 files changed, 29 insertions, 0 deletions
diff --git a/chrome/browser/ui/browser_browsertest.cc b/chrome/browser/ui/browser_browsertest.cc
index 10ebfc0..387bdf4 100644
--- a/chrome/browser/ui/browser_browsertest.cc
+++ b/chrome/browser/ui/browser_browsertest.cc
@@ -1066,6 +1066,35 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, StartMinimized) {
}
}
+// Makes sure the forward button is disabled immediately when navigating
+// forward to a slow-to-commit page.
+IN_PROC_BROWSER_TEST_F(BrowserTest, ForwardDisabledOnForward) {
+ GURL blank_url(chrome::kAboutBlankURL);
+ ui_test_utils::NavigateToURL(browser(), blank_url);
+
+ ui_test_utils::NavigateToURL(browser(),
+ ui_test_utils::GetTestUrl(FilePath(FilePath::kCurrentDirectory),
+ FilePath(kTitle1File)));
+
+ ui_test_utils::WindowedNotificationObserver back_nav_load_observer(
+ content::NOTIFICATION_LOAD_STOP,
+ Source<NavigationController>(
+ &browser()->GetSelectedTabContents()->controller()));
+ browser()->GoBack(CURRENT_TAB);
+ back_nav_load_observer.Wait();
+ EXPECT_TRUE(browser()->command_updater()->IsCommandEnabled(IDC_FORWARD));
+
+ ui_test_utils::WindowedNotificationObserver forward_nav_load_observer(
+ content::NOTIFICATION_LOAD_STOP,
+ Source<NavigationController>(
+ &browser()->GetSelectedTabContents()->controller()));
+ browser()->GoForward(CURRENT_TAB);
+ // This check will happen before the navigation completes, since the browser
+ // won't process the renderer's response until the Wait() call below.
+ EXPECT_FALSE(browser()->command_updater()->IsCommandEnabled(IDC_FORWARD));
+ forward_nav_load_observer.Wait();
+}
+
// TODO(ben): this test was never enabled. It has bit-rotted since being added.
// It originally lived in browser_unittest.cc, but has been moved here to make
// room for real browser unit tests.