Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(547)

Unified Diff: ios/chrome/test/earl_grey/chrome_earl_grey_ui.mm

Issue 2751523004: Move EarlGrey helper to check toolbar visibility into ChromeEarlGreyUI. (Closed)
Patch Set: return void Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ios/chrome/test/earl_grey/chrome_earl_grey_ui.h ('k') | ios/chrome/test/earl_grey/chrome_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « ios/chrome/test/earl_grey/chrome_earl_grey_ui.h ('k') | ios/chrome/test/earl_grey/chrome_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698