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) |
@@ -488,12 +488,17 @@ |
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); |
+ // will wait for. If it's not an empty string, |this| will wait for |
+ // |failure_title| is well. |
+ TitleWatcher(TabContents* tab_contents, const string16& expected_title, |
+ const string16& failure_title); |
virtual ~TitleWatcher(); |
- // Waits until the title for the tab is set to the |expected_title| |
- // passed into the constructor. |
+ // Waits until the title for the tab is set to the |expected_title| or |
+ // |failure_title| passed into the constructor or one of the titles added with |
+ // AddTitle. Returns true if |expected_title| was seen, and false if |
+ // |failure_title| was seen. If both are seen, returns false, however, it's |
+ // probably best not to rely of that to avoid any races. |
Paweł Hajdan Jr.
2011/08/02 20:19:16
How about returning the last seen title when the m
mmenke
2011/08/02 21:04:40
Sounds good to me. Done. Went ahead and switched
|
bool Wait() WARN_UNUSED_RESULT; |
private: |
@@ -504,8 +509,10 @@ |
TabContents* expected_tab_; |
string16 expected_title_; |
+ string16 failure_title_; |
NotificationRegistrar notification_registrar_; |
- bool title_observed_; |
+ bool expected_title_observed_; |
+ bool failure_title_observed_; |
bool quit_loop_on_observation_; |
DISALLOW_COPY_AND_ASSIGN(TitleWatcher); |