| Index: ios/web/public/test/earl_grey/js_test_util.mm
|
| diff --git a/ios/web/public/test/earl_grey/js_test_util.mm b/ios/web/public/test/earl_grey/js_test_util.mm
|
| index b2bdcdf4ea3292d097a5ea2de3842595333e909b..f0a0bce830ecf8101faf16c984f4544f123f464d 100644
|
| --- a/ios/web/public/test/earl_grey/js_test_util.mm
|
| +++ b/ios/web/public/test/earl_grey/js_test_util.mm
|
| @@ -12,6 +12,10 @@
|
| #import "ios/web/interstitials/web_interstitial_impl.h"
|
| #import "ios/web/public/web_state/js/crw_js_injection_receiver.h"
|
|
|
| +#if !defined(__has_feature) || !__has_feature(objc_arc)
|
| +#error "This file requires ARC support."
|
| +#endif
|
| +
|
| using testing::kWaitForJSCompletionTimeout;
|
| using testing::WaitUntilConditionOrTimeout;
|
|
|
| @@ -54,7 +58,7 @@ void WaitUntilWindowIdInjected(WebState* web_state) {
|
|
|
| id ExecuteJavaScript(WebState* web_state,
|
| NSString* javascript,
|
| - NSError** out_error) {
|
| + NSError* __autoreleasing* out_error) {
|
| __block bool did_complete = false;
|
| __block id result = nil;
|
| CRWJSInjectionReceiver* receiver = web_state->GetJSInjectionReceiver();
|
| @@ -72,9 +76,7 @@ id ExecuteJavaScript(WebState* web_state,
|
| });
|
| GREYAssert(suceeded, @"Script execution timed out");
|
|
|
| - if (out_error)
|
| - [*out_error autorelease];
|
| - return [result autorelease];
|
| + return result;
|
| }
|
|
|
| id ExecuteScriptOnInterstitial(WebState* web_state, NSString* script) {
|
| @@ -91,7 +93,7 @@ id ExecuteScriptOnInterstitial(WebState* web_state, NSString* script) {
|
| return did_finish;
|
| });
|
| GREYAssert(suceeded, @"Script execution timed out");
|
| - return [script_result autorelease];
|
| + return script_result;
|
| }
|
|
|
| } // namespace web
|
|
|