| 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..8ab8484425d37cda06f13201298d9226af635f6f 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,18 @@ using testing::kWaitForPageLoadTimeout;
|
| performAction:grey_tap()];
|
| }
|
|
|
| ++ (BOOL)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;
|
| + };
|
| + return testing::WaitUntilConditionOrTimeout(kWaitForToolbarAnimationTimeout,
|
| + condition);
|
| +}
|
| +
|
| @end
|
|
|