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

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: remove chrome_util.* 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
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

Powered by Google App Engine
This is Rietveld 408576698