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

Unified Diff: ios/web/public/test/web_view_interaction_test_util.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/public/test/web_view_interaction_test_util.mm
diff --git a/ios/web/public/test/web_view_interaction_test_util.mm b/ios/web/public/test/web_view_interaction_test_util.mm
index 896639a0f6e1a17e4c9e92398ce87ad199ffbc13..c5066c7e6fa9092f836dea18ec4ff2a33134473d 100644
--- a/ios/web/public/test/web_view_interaction_test_util.mm
+++ b/ios/web/public/test/web_view_interaction_test_util.mm
@@ -27,14 +27,9 @@ void TapWebViewElementWithId(web::WebState* web_state,
did_complete = true;
}));
- // TODO(crbug.com/610837): Re-factor wait code into common location.
- NSDate* deadline = [NSDate
- dateWithTimeIntervalSinceNow:testing::kWaitForJSCompletionTimeout];
- while (([[NSDate date] compare:deadline] != NSOrderedDescending) &&
- !did_complete) {
- base::test::ios::SpinRunLoopWithMaxDelay(
- base::TimeDelta::FromSecondsD(testing::kSpinDelaySeconds));
- }
+ testing::WaitUntilCondition(testing::kWaitForJSCompletionTimeout, ^() {
Eugene But (OOO till 7-30) 2016/06/06 21:38:59 Optional NIT: s/^() {/^{
baxley 2016/06/06 22:38:07 Done.
+ return did_complete;
+ });
baxley 2016/06/06 21:20:48 Let me know what you think of the readability here
Eugene But (OOO till 7-30) 2016/06/06 21:38:59 I believe that inline blocks are more readable com
baxley 2016/06/06 22:38:07 Acknowledged.
}
} // namespace test

Powered by Google App Engine
This is Rietveld 408576698