summaryrefslogtreecommitdiffstats
path: root/chrome/browser/browser_focus_uitest.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/browser_focus_uitest.cc')
-rw-r--r--chrome/browser/browser_focus_uitest.cc39
1 files changed, 7 insertions, 32 deletions
diff --git a/chrome/browser/browser_focus_uitest.cc b/chrome/browser/browser_focus_uitest.cc
index 68eeb54..cd23955 100644
--- a/chrome/browser/browser_focus_uitest.cc
+++ b/chrome/browser/browser_focus_uitest.cc
@@ -14,7 +14,6 @@
#include "chrome/browser/tabs/tab_strip_model.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_window.h"
-#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
#include "chrome/browser/ui/view_ids.h"
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/chrome_paths.h"
@@ -848,23 +847,11 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, FocusOnReload) {
ASSERT_TRUE(test_server()->Start());
// Open the new tab, reload.
- {
- ui_test_utils::WindowedNotificationObserver observer(
- content::NOTIFICATION_LOAD_STOP,
- NotificationService::AllSources());
- browser()->NewTab();
- observer.Wait();
- }
+ browser()->NewTab();
ui_test_utils::RunAllPendingInMessageLoop();
- {
- ui_test_utils::WindowedNotificationObserver observer(
- content::NOTIFICATION_LOAD_STOP,
- Source<NavigationController>(
- &browser()->GetSelectedTabContentsWrapper()->controller()));
- browser()->Reload(CURRENT_TAB);
- observer.Wait();
- }
+ browser()->Reload(CURRENT_TAB);
+ ASSERT_TRUE(ui_test_utils::WaitForNavigationInCurrentTab(browser()));
// Focus should stay on the location bar.
ASSERT_TRUE(IsViewFocused(VIEW_ID_LOCATION_BAR));
@@ -872,14 +859,8 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, FocusOnReload) {
ui_test_utils::NavigateToURL(browser(), test_server()->GetURL(kSimplePage));
browser()->FocusLocationBar();
ASSERT_TRUE(IsViewFocused(VIEW_ID_LOCATION_BAR));
- {
- ui_test_utils::WindowedNotificationObserver observer(
- content::NOTIFICATION_LOAD_STOP,
- Source<NavigationController>(
- &browser()->GetSelectedTabContentsWrapper()->controller()));
- browser()->Reload(CURRENT_TAB);
- observer.Wait();
- }
+ browser()->Reload(CURRENT_TAB);
+ ASSERT_TRUE(ui_test_utils::WaitForNavigationInCurrentTab(browser()));
// Focus should now be on the tab contents.
browser()->ShowDownloadsTab();
@@ -894,14 +875,8 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, DISABLED_FocusOnReloadCrashedTab) {
// Open a regular page, crash, reload.
ui_test_utils::NavigateToURL(browser(), test_server()->GetURL(kSimplePage));
ui_test_utils::CrashTab(browser()->GetSelectedTabContents());
- {
- ui_test_utils::WindowedNotificationObserver observer(
- content::NOTIFICATION_LOAD_STOP,
- Source<NavigationController>(
- &browser()->GetSelectedTabContentsWrapper()->controller()));
- browser()->Reload(CURRENT_TAB);
- observer.Wait();
- }
+ browser()->Reload(CURRENT_TAB);
+ ASSERT_TRUE(ui_test_utils::WaitForNavigationInCurrentTab(browser()));
// Focus should now be on the tab contents.
browser()->ShowDownloadsTab();