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); |