diff options
Diffstat (limited to 'chrome/test')
-rw-r--r-- | chrome/test/ui/ui_test.cc | 7 | ||||
-rw-r--r-- | chrome/test/ui/ui_test.h | 9 |
2 files changed, 9 insertions, 7 deletions
diff --git a/chrome/test/ui/ui_test.cc b/chrome/test/ui/ui_test.cc index 35f09cf..c3f0c4b 100644 --- a/chrome/test/ui/ui_test.cc +++ b/chrome/test/ui/ui_test.cc @@ -389,14 +389,15 @@ bool UITest::WaitForDownloadShelfVisible(TabProxy* tab) { return false; } -bool UITest::WaitForFindWindowFullyVisible(TabProxy* tab) { +bool UITest::WaitForFindWindowVisibilityChange(TabProxy* tab, + bool wait_for_open) { const int kCycles = 20; for (int i = 0; i < kCycles; i++) { bool visible = false; if (!tab->IsFindWindowFullyVisible(&visible)) return false; // Some error. - if (visible) - return true; // Find window is visible. + if (visible == wait_for_open) + return true; // Find window visibility change complete. // Give it a chance to catch up. Sleep(kWaitForActionMaxMsec / kCycles); diff --git a/chrome/test/ui/ui_test.h b/chrome/test/ui/ui_test.h index 5c1625a..4b9bf600 100644 --- a/chrome/test/ui/ui_test.h +++ b/chrome/test/ui/ui_test.h @@ -130,10 +130,11 @@ class UITest : public testing::Test { // as possible. bool WaitForDownloadShelfVisible(TabProxy* tab); - // Waits until the Find window has become fully visible (and stopped - // animating) in the specified tab. This function can time out (return false) - // if the window doesn't appear within a specific time. - bool WaitForFindWindowFullyVisible(TabProxy* tab); + // Waits until the Find window has become fully visible (if |wait_for_open| is + // true) or fully hidden (if |wait_for_open| is false). This function can time + // out (return false) if the window doesn't appear within a specific time. + bool WaitForFindWindowVisibilityChange(TabProxy* tab, + bool wait_for_open); // Waits until the Bookmark bar has stopped animating and become fully visible // (if |wait_for_open| is true) or fully hidden (if |wait_for_open| is false). |