Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8752)

Unified Diff: chrome/browser/ui/find_bar/find_bar_host_browsertest.cc

Issue 7633032: Revert 96593 - Fix up various browser tests not to use WaitForNavigation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ssl/ssl_browser_tests.cc ('k') | chrome/test/base/ui_test_utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/find_bar/find_bar_host_browsertest.cc
===================================================================
--- chrome/browser/ui/find_bar/find_bar_host_browsertest.cc (revision 96616)
+++ chrome/browser/ui/find_bar/find_bar_host_browsertest.cc (working copy)
@@ -581,12 +581,8 @@
EXPECT_TRUE(fully_visible);
// Reload the tab and make sure Find window doesn't go away.
- ui_test_utils::WindowedNotificationObserver observer(
- content::NOTIFICATION_LOAD_STOP,
- Source<NavigationController>(
- &browser()->GetSelectedTabContentsWrapper()->controller()));
browser()->Reload(CURRENT_TAB);
- observer.Wait();
+ ui_test_utils::WaitForNavigationInCurrentTab(browser());
EXPECT_TRUE(GetFindBarWindowInfo(&position, &fully_visible));
EXPECT_TRUE(fully_visible);
@@ -1052,10 +1048,9 @@
// Open a new incognito window and navigate to the same page.
Profile* incognito_profile = browser()->profile()->GetOffTheRecordProfile();
Browser* incognito_browser = Browser::Create(incognito_profile);
- ui_test_utils::WindowedNotificationObserver observer(
- content::NOTIFICATION_LOAD_STOP, NotificationService::AllSources());
incognito_browser->AddSelectedTabWithURL(url, PageTransition::START_PAGE);
- observer.Wait();
+ ui_test_utils::WaitForNavigation(
+ &incognito_browser->GetSelectedTabContents()->controller());
incognito_browser->window()->Show();
// Open the find box and make sure that it is prepopulated with "page".
@@ -1098,11 +1093,8 @@
EXPECT_EQ(ordinal, 1);
// End the find session, click on the link.
- ui_test_utils::WindowedNotificationObserver observer(
- content::NOTIFICATION_LOAD_STOP,
- Source<NavigationController>(&tab->controller()));
tab->find_tab_helper()->StopFinding(FindBarController::kActivateSelection);
- observer.Wait();
+ EXPECT_TRUE(ui_test_utils::WaitForNavigationInCurrentTab(browser()));
}
// Tests that FindBar fits within a narrow browser window.
@@ -1110,12 +1102,12 @@
Browser::CreateParams params(Browser::TYPE_POPUP, browser()->profile());
params.initial_bounds = gfx::Rect(0, 0, 250, 500);
Browser* popup = Browser::CreateWithParams(params);
- ui_test_utils::WindowedNotificationObserver observer(
- content::NOTIFICATION_LOAD_STOP, NotificationService::AllSources());
popup->AddSelectedTabWithURL(GURL(chrome::kAboutBlankURL),
PageTransition::LINK);
+
// Wait for the page to finish loading.
- observer.Wait();
+ ui_test_utils::WaitForNavigation(
+ &popup->GetSelectedTabContents()->controller());
popup->window()->Show();
// On GTK, bounds change is asynchronous.
« no previous file with comments | « chrome/browser/ssl/ssl_browser_tests.cc ('k') | chrome/test/base/ui_test_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698