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

Unified Diff: chrome/test/ui_test_utils.h

Issue 7489019: Fix up various browser tests not to use WaitForNavigation. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 9 years, 5 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
Index: chrome/test/ui_test_utils.h
diff --git a/chrome/test/ui_test_utils.h b/chrome/test/ui_test_utils.h
index 893c16069f2755e469a3c9fbc708df2ebd9fa633..4215d38ebd6165fc47a8779a6662618a4dc55de3 100644
--- a/chrome/test/ui_test_utils.h
+++ b/chrome/test/ui_test_utils.h
@@ -229,10 +229,14 @@ bool IsViewFocused(const Browser* browser, ViewID vid);
void ClickOnView(const Browser* browser, ViewID vid);
// Blocks until a notification for given |type| is received.
+// TODO(gbillock): remove this race hazard.
+// Use WindowedNotificationObserver instead.
void WaitForNotification(int type);
// Blocks until a notification for given |type| from the specified |source|
// is received.
+// TODO(gbillock): remove this race hazard.
+// Use WindowedNotificationObserver instead.
void WaitForNotificationFrom(int type,
const NotificationSource& source);
@@ -404,6 +408,16 @@ class WindowedNotificationObserver : public NotificationObserver {
// NotificationService::AllSources().
WindowedNotificationObserver(int notification_type,
const NotificationSource& source);
+
+ // Convenience constructor which will use the given NavigationController.
+ // Waits for a NOTIFICATION_LOAD_STOP event.
+ explicit WindowedNotificationObserver(const NavigationController& controller);
+
+ // Convenience constructor which will use the NavigationController from
+ // the active tab in the given browser.
+ // Waits for a NOTIFICATION_LOAD_STOP event.
+ explicit WindowedNotificationObserver(const Browser& browser);
Paweł Hajdan Jr. 2011/07/25 18:06:13 Please don't add those "magic constructors" here,
Greg Billock 2011/08/02 18:11:33 I can do that. Shall I make two new subclasses her
Paweł Hajdan Jr. 2011/08/02 20:11:19 Well, do we actually need those ctors? Why not do
+
virtual ~WindowedNotificationObserver();
// Wait until the specified notification occurs. If the notification was

Powered by Google App Engine
This is Rietveld 408576698