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

Unified Diff: chrome/test/ui_test_utils.h

Issue 7046053: Add PrerenderUnload browser test (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove include Created 9 years, 6 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/test/data/prerender/prerender_loader_with_unload.html ('k') | chrome/test/ui_test_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/ui_test_utils.h
diff --git a/chrome/test/ui_test_utils.h b/chrome/test/ui_test_utils.h
index fefbb4feadd7b0f7832df0087adab1e890bad41d..cb3483155885b2e2323b55c391ce93a90e91c940 100644
--- a/chrome/test/ui_test_utils.h
+++ b/chrome/test/ui_test_utils.h
@@ -471,6 +471,34 @@ class WindowedNotificationObserverWithDetails
DISALLOW_COPY_AND_ASSIGN(WindowedNotificationObserverWithDetails);
};
+// Watches title changes on a tab, blocking until an expected title is set.
+class TitleWatcher : public NotificationObserver {
+ public:
+ // |tab_contents| must be non-NULL and needs to stay alive for the
+ // entire lifetime of |this|. |expected_title| is the title that |this|
+ // will wait for.
+ TitleWatcher(TabContents* tab_contents, const string16& expected_title);
+ ~TitleWatcher();
+
+ // Waits until the title for the tab is set to the |expected_title|
+ // passed into the constructor.
+ bool Wait() WARN_UNUSED_RESULT;
+
+ private:
+ // NotificationObserver
+ virtual void Observe(NotificationType type,
+ const NotificationSource& source,
+ const NotificationDetails& details) OVERRIDE;
+
+ TabContents* expected_tab_;
+ string16 expected_title_;
+ NotificationRegistrar notification_registrar_;
+ bool title_observed_;
+ bool quit_loop_on_observation_;
+
+ DISALLOW_COPY_AND_ASSIGN(TitleWatcher);
+};
+
// See SendKeyPressAndWait. This function additionally performs a check on the
// NotificationDetails using the provided Details<U>.
template <class U>
« no previous file with comments | « chrome/test/data/prerender/prerender_loader_with_unload.html ('k') | chrome/test/ui_test_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698