| Index: chrome/browser/browser_focus_uitest.cc
|
| ===================================================================
|
| --- chrome/browser/browser_focus_uitest.cc (revision 96616)
|
| +++ chrome/browser/browser_focus_uitest.cc (working copy)
|
| @@ -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 @@
|
| 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 @@
|
| 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 @@
|
| // 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();
|
|
|