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

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: fix blocks 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
« no previous file with comments | « ios/web/public/test/web_view_interaction_test_util.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..91412dcf7f08329bc7956ce3e52c13510dd73ee9 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, ^bool() {
+ return [textField.text isEqualToString:base::SysUTF8ToNSString(text)];
+ });
+ return YES;
};
DescribeToBlock describe = ^(id<GREYDescription> description) {
« no previous file with comments | « ios/web/public/test/web_view_interaction_test_util.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698