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

Unified Diff: ios/testing/wait_util.h

Issue 2448753002: Refactor wait_util so it isn't coupled to EarlGrey. (Closed)
Patch Set: compile Created 4 years, 2 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/testing/earl_grey/wait_util.mm ('k') | ios/testing/wait_util.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/testing/wait_util.h
diff --git a/ios/testing/earl_grey/wait_util.h b/ios/testing/wait_util.h
similarity index 56%
copy from ios/testing/earl_grey/wait_util.h
copy to ios/testing/wait_util.h
index 33df9252ec54271c8ab1230833b40dd5d0d658a3..f162a74faa63a54861d6741ff23ab80fee8a95c3 100644
--- a/ios/testing/earl_grey/wait_util.h
+++ b/ios/testing/wait_util.h
@@ -2,11 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef IOS_TESTING_EARL_GREY_WAIT_UTIL_H_
-#define IOS_TESTING_EARL_GREY_WAIT_UTIL_H_
+#ifndef IOS_TESTING_WAIT_UTIL_H_
+#define IOS_TESTING_WAIT_UTIL_H_
#import <Foundation/Foundation.h>
+#include "base/ios/block_types.h"
+
namespace testing {
// Constant for UI wait loop in seconds.
@@ -21,15 +23,11 @@ extern const NSTimeInterval kWaitForJSCompletionTimeout;
// Constant for timeout in seconds while waiting for a download to complete.
extern const NSTimeInterval kWaitForDownloadTimeout;
-// Waits until |condition| is true, or induces GREYAssert after |timeout|.
-void WaitUntilCondition(NSTimeInterval timeout, bool (^condition)(void));
-
-// Waits until |condition| is true, or induces GREYAssert after |timeout| with
-// |timeoutDescription| error message.
-void WaitUntilCondition(NSTimeInterval timeout,
- NSString* timeoutDescription,
- bool (^condition)(void));
+// Returns true when condition() becomes true, otherwise returns false after
+// |timeout|.
+bool WaitUntilConditionOrTimeout(NSTimeInterval timeout,
+ ConditionBlock condition);
} // namespace testing
-#endif // IOS_TESTING_EARL_GREY_WAIT_UTIL_H_
+#endif // IOS_TESTING_WAIT_UTIL_H_
« no previous file with comments | « ios/testing/earl_grey/wait_util.mm ('k') | ios/testing/wait_util.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698