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

Unified Diff: ios/testing/wait_util.h

Issue 2448753002: Refactor wait_util so it isn't coupled to EarlGrey. (Closed)
Patch Set: cleanup 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
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..1e8b526e5e977b075c89e87b14827519058078d6 100644
--- a/ios/testing/earl_grey/wait_util.h
+++ b/ios/testing/wait_util.h
@@ -2,8 +2,8 @@
// 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_
Eugene But (OOO till 7-30) 2016/10/25 14:43:38 This is now third wait_util file. And WaitUntilCon
baxley 2016/10/25 18:50:04 I have a bug to delete the one in ios/testing/earl
#import <Foundation/Foundation.h>
@@ -21,15 +21,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,
Eugene But (OOO till 7-30) 2016/10/25 14:43:38 Should we use Chromium types instead (base::TimeDe
baxley 2016/10/25 18:50:04 This adds complexity, since the caller has to crea
+ bool (^condition)(void));
Eugene But (OOO till 7-30) 2016/10/25 14:43:38 Should this be ConditionBlock from block_types.h?
baxley 2016/10/25 18:50:04 Done.
} // namespace testing
-#endif // IOS_TESTING_EARL_GREY_WAIT_UTIL_H_
+#endif // IOS_TESTING_WAIT_UTIL_H_

Powered by Google App Engine
This is Rietveld 408576698