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

Unified Diff: chrome/test/base/ui_test_utils.h

Issue 7553009: Add some browser tests for net-internals (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Just test result of first test 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/base/ui_test_utils.h
===================================================================
--- chrome/test/base/ui_test_utils.h (revision 94917)
+++ chrome/test/base/ui_test_utils.h (working copy)
@@ -10,6 +10,7 @@
#include <queue>
#include <set>
#include <string>
+#include <vector>
#include "base/basictypes.h"
#include "base/message_loop.h"
@@ -492,10 +493,14 @@
TitleWatcher(TabContents* tab_contents, const string16& expected_title);
virtual ~TitleWatcher();
- // Waits until the title for the tab is set to the |expected_title|
- // passed into the constructor.
- bool Wait() WARN_UNUSED_RESULT;
+ // Adds another title to watch for.
+ void AddTitle(const string16& expected_title);
Paweł Hajdan Jr. 2011/08/02 21:45:57 nit: Let's rename this to AlsoWaitForTitle.
mmenke 2011/08/03 15:44:17 Done.
+ // Waits until the title matches either expected_title or one of the titles
+ // added with AddTitle. Returns the value of the most recently seen matching
+ // title.
+ const string16& Wait() WARN_UNUSED_RESULT;
Paweł Hajdan Jr. 2011/08/02 21:45:57 nit: Let's rename this to WaitAndGetTitle.
mmenke 2011/08/03 15:44:17 Done.
+
private:
// NotificationObserver
virtual void Observe(int type,
@@ -503,9 +508,13 @@
const NotificationDetails& details) OVERRIDE;
TabContents* expected_tab_;
- string16 expected_title_;
+ std::vector<string16> expected_titles_;
NotificationRegistrar notification_registrar_;
- bool title_observed_;
+
+ // The most recently observed expected title, if any.
+ string16 observed_title_;
+
+ bool expected_title_observed_;
bool quit_loop_on_observation_;
DISALLOW_COPY_AND_ASSIGN(TitleWatcher);

Powered by Google App Engine
This is Rietveld 408576698