Chromium Code Reviews| 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 |