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_ |