OLD | NEW |
---|---|
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef IOS_TESTING_EARL_GREY_WAIT_UTIL_H_ | 5 #ifndef IOS_TESTING_WAIT_UTIL_H_ |
6 #define IOS_TESTING_EARL_GREY_WAIT_UTIL_H_ | 6 #define IOS_TESTING_WAIT_UTIL_H_ |
7 | 7 |
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
| |
8 #import <Foundation/Foundation.h> | 8 #import <Foundation/Foundation.h> |
9 | 9 |
10 namespace testing { | 10 namespace testing { |
11 | 11 |
12 // Constant for UI wait loop in seconds. | 12 // Constant for UI wait loop in seconds. |
13 extern const NSTimeInterval kSpinDelaySeconds; | 13 extern const NSTimeInterval kSpinDelaySeconds; |
14 | 14 |
15 // Constant for timeout in seconds while waiting for UI element. | 15 // Constant for timeout in seconds while waiting for UI element. |
16 extern const NSTimeInterval kWaitForUIElementTimeout; | 16 extern const NSTimeInterval kWaitForUIElementTimeout; |
17 | 17 |
18 // Constant for timeout in seconds while waiting for JavaScript completion. | 18 // Constant for timeout in seconds while waiting for JavaScript completion. |
19 extern const NSTimeInterval kWaitForJSCompletionTimeout; | 19 extern const NSTimeInterval kWaitForJSCompletionTimeout; |
20 | 20 |
21 // Constant for timeout in seconds while waiting for a download to complete. | 21 // Constant for timeout in seconds while waiting for a download to complete. |
22 extern const NSTimeInterval kWaitForDownloadTimeout; | 22 extern const NSTimeInterval kWaitForDownloadTimeout; |
23 | 23 |
24 // Waits until |condition| is true, or induces GREYAssert after |timeout|. | 24 // Returns true when condition() becomes true, otherwise returns false after |
25 void WaitUntilCondition(NSTimeInterval timeout, bool (^condition)(void)); | 25 // |timeout|. |
26 | 26 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
| |
27 // Waits until |condition| is true, or induces GREYAssert after |timeout| with | 27 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.
| |
28 // |timeoutDescription| error message. | |
29 void WaitUntilCondition(NSTimeInterval timeout, | |
30 NSString* timeoutDescription, | |
31 bool (^condition)(void)); | |
32 | 28 |
33 } // namespace testing | 29 } // namespace testing |
34 | 30 |
35 #endif // IOS_TESTING_EARL_GREY_WAIT_UTIL_H_ | 31 #endif // IOS_TESTING_WAIT_UTIL_H_ |
OLD | NEW |