Index: chrome/browser/browser_focus_uitest.cc |
diff --git a/chrome/browser/browser_focus_uitest.cc b/chrome/browser/browser_focus_uitest.cc |
index 5e6fc06b4c63bdf128f6e5a8ab3e4c6920dbc809..f3fb650b3aec63812956e370211561b83b733fa1 100644 |
--- a/chrome/browser/browser_focus_uitest.cc |
+++ b/chrome/browser/browser_focus_uitest.cc |
@@ -846,11 +846,20 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, FocusOnReload) { |
ASSERT_TRUE(test_server()->Start()); |
// Open the new tab, reload. |
- browser()->NewTab(); |
+ { |
+ ui_test_utils::WindowedNotificationObserver observer( |
+ content::NOTIFICATION_LOAD_STOP, |
+ NotificationService::AllSources()); |
+ browser()->NewTab(); |
+ observer.Wait(); |
+ } |
ui_test_utils::RunAllPendingInMessageLoop(); |
- browser()->Reload(CURRENT_TAB); |
- ASSERT_TRUE(ui_test_utils::WaitForNavigationInCurrentTab(browser())); |
+ { |
+ ui_test_utils::WindowedNotificationObserver observer(*browser()); |
+ browser()->Reload(CURRENT_TAB); |
+ observer.Wait(); |
+ } |
// Focus should stay on the location bar. |
ASSERT_TRUE(IsViewFocused(VIEW_ID_LOCATION_BAR)); |
@@ -858,8 +867,11 @@ 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)); |
- browser()->Reload(CURRENT_TAB); |
- ASSERT_TRUE(ui_test_utils::WaitForNavigationInCurrentTab(browser())); |
+ { |
+ ui_test_utils::WindowedNotificationObserver observer(*browser()); |
+ browser()->Reload(CURRENT_TAB); |
+ observer.Wait(); |
+ } |
// Focus should now be on the tab contents. |
browser()->ShowDownloadsTab(); |
@@ -874,8 +886,11 @@ 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()); |
- browser()->Reload(CURRENT_TAB); |
- ASSERT_TRUE(ui_test_utils::WaitForNavigationInCurrentTab(browser())); |
+ { |
+ ui_test_utils::WindowedNotificationObserver observer(*browser()); |
+ browser()->Reload(CURRENT_TAB); |
+ observer.Wait(); |
+ } |
// Focus should now be on the tab contents. |
browser()->ShowDownloadsTab(); |