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

Unified Diff: ios/web/shell/test/earl_grey/shell_matchers.mm

Issue 2044433003: Create EarlGrey wait utility. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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/web/shell/test/earl_grey/shell_matchers.mm
diff --git a/ios/web/shell/test/earl_grey/shell_matchers.mm b/ios/web/shell/test/earl_grey/shell_matchers.mm
index 6763f9ca8235ab10213d3d200ab2ff6769d579e2..d490a5ba0d51af1c23e50faa8ec4f332b0fe0a46 100644
--- a/ios/web/shell/test/earl_grey/shell_matchers.mm
+++ b/ios/web/shell/test/earl_grey/shell_matchers.mm
@@ -54,16 +54,10 @@ id<GREYMatcher> addressField() {
return NO;
}
UITextField* textField = base::mac::ObjCCastStrict<UITextField>(view);
- NSDate* deadline =
- [NSDate dateWithTimeIntervalSinceNow:testing::kWaitForUIElementTimeout];
- while ([[NSDate date] compare:deadline] != NSOrderedDescending) {
- if ([textField.text isEqualToString:base::SysUTF8ToNSString(text)]) {
- return YES;
- }
- base::test::ios::SpinRunLoopWithMaxDelay(
- base::TimeDelta::FromSecondsD(testing::kSpinDelaySeconds));
- }
- return NO;
+ testing::WaitUntilCondition(testing::kWaitForUIElementTimeout, ^() {
Eugene But (OOO till 7-30) 2016/06/06 21:38:59 I don't think this will compile on 32-bit platform
baxley 2016/06/06 22:38:08 Nice catch! Done.
+ return [textField.text isEqualToString:base::SysUTF8ToNSString(text)];
+ });
+ return YES;
};
DescribeToBlock describe = ^(id<GREYDescription> description) {

Powered by Google App Engine
This is Rietveld 408576698