| Index: ios/chrome/test/earl_grey/chrome_earl_grey_ui.mm
|
| diff --git a/ios/chrome/test/earl_grey/chrome_earl_grey_ui.mm b/ios/chrome/test/earl_grey/chrome_earl_grey_ui.mm
|
| index 68be6086c5c027c1fc0569fcbd1a7279b953b995..a04aec389fe0d145456ea54618d19a8775b7cb79 100644
|
| --- a/ios/chrome/test/earl_grey/chrome_earl_grey_ui.mm
|
| +++ b/ios/chrome/test/earl_grey/chrome_earl_grey_ui.mm
|
| @@ -79,4 +79,21 @@ using testing::kWaitForPageLoadTimeout;
|
| performAction:grey_tap()];
|
| }
|
|
|
| ++ (void)waitForToolbarVisible:(BOOL)isVisible {
|
| + const NSTimeInterval kWaitForToolbarAnimationTimeout = 1.0;
|
| + ConditionBlock condition = ^{
|
| + NSError* error = nil;
|
| + id<GREYMatcher> visibleMatcher = isVisible ? grey_notNil() : grey_nil();
|
| + [[EarlGrey selectElementWithMatcher:chrome_test_util::ToolsMenuButton()]
|
| + assertWithMatcher:visibleMatcher
|
| + error:&error];
|
| + return error == nil;
|
| + };
|
| + NSString* errorMessage =
|
| + isVisible ? @"Toolbar was not visible" : @"Toolbar was visible";
|
| + GREYAssert(testing::WaitUntilConditionOrTimeout(
|
| + kWaitForToolbarAnimationTimeout, condition),
|
| + errorMessage);
|
| +}
|
| +
|
| @end
|
|
|