Chromium Code Reviews| Index: ios/web/public/test/js_test_util.mm |
| diff --git a/ios/web/public/test/js_test_util.mm b/ios/web/public/test/js_test_util.mm |
| index 00ab99d8776797c96f85963a093c90f63d1e11c6..b4ee0c405efb22b6d57361e728e576b97df2a5a3 100644 |
| --- a/ios/web/public/test/js_test_util.mm |
| +++ b/ios/web/public/test/js_test_util.mm |
| @@ -8,7 +8,7 @@ |
| #include "base/logging.h" |
| #import "base/mac/scoped_nsobject.h" |
| -#import "base/test/ios/wait_util.h" |
| +#import "ios/testing/wait_util.h" |
| #import "ios/web/public/web_state/js/crw_js_injection_manager.h" |
| #import "ios/web/public/web_state/js/crw_js_injection_receiver.h" |
| @@ -24,9 +24,12 @@ id ExecuteJavaScript(CRWJSInjectionManager* manager, NSString* script) { |
| completed = true; |
| }]; |
| - base::test::ios::WaitUntilCondition(^{ |
| - return completed; |
| - }); |
| + BOOL success = testing::WaitUntilConditionOrTimeout( |
| + testing::kWaitForJSCompletionTimeout, ^{ |
| + return completed; |
| + }); |
| + DCHECK(success) |
|
Eugene But (OOO till 7-30)
2017/03/02 21:27:26
Ideally we should not DCHECK in tests. Can we log
michaeldo
2017/03/02 21:34:37
We can log, however I didn't want to change the cu
|
| + << "CRWJSInjectionManager failed to complete javascript execution."; |
| return [[result retain] autorelease]; |
| } |
| @@ -50,9 +53,11 @@ id ExecuteJavaScript(WKWebView* web_view, NSString* script, NSError** error) { |
| *error = [[script_error copy] autorelease]; |
| completed = true; |
| }]; |
| - base::test::ios::WaitUntilCondition(^{ |
| - return completed; |
| - }); |
| + BOOL success = testing::WaitUntilConditionOrTimeout( |
| + testing::kWaitForJSCompletionTimeout, ^{ |
| + return completed; |
| + }); |
| + DCHECK(success) << "WKWebView failed to complete javascript execution."; |
| return [[result retain] autorelease]; |
| } |