| Index: ios/chrome/test/earl_grey/chrome_earl_grey.mm
|
| diff --git a/ios/chrome/test/earl_grey/chrome_earl_grey.mm b/ios/chrome/test/earl_grey/chrome_earl_grey.mm
|
| index 16ec1cf07b940db82769fc6c92bdcdd8259f802f..ffcfa516ad3b3d3a812db944a3de8698fd7cc1e5 100644
|
| --- a/ios/chrome/test/earl_grey/chrome_earl_grey.mm
|
| +++ b/ios/chrome/test/earl_grey/chrome_earl_grey.mm
|
| @@ -17,9 +17,14 @@
|
| #import "ios/web/public/web_state/js/crw_js_injection_receiver.h"
|
| #import "ios/web/public/web_state/web_state.h"
|
|
|
| +#if !defined(__has_feature) || !__has_feature(objc_arc)
|
| +#error "This file requires ARC support."
|
| +#endif
|
| +
|
| namespace chrome_test_util {
|
|
|
| -id ExecuteJavaScript(NSString* javascript, NSError** out_error) {
|
| +id ExecuteJavaScript(NSString* javascript,
|
| + NSError* __unsafe_unretained* out_error) {
|
| __block bool did_complete = false;
|
| __block id result = nil;
|
| __block NSError* temp_error = nil;
|
| @@ -41,10 +46,11 @@ id ExecuteJavaScript(NSString* javascript, NSError** out_error) {
|
| [condition waitWithTimeout:testing::kWaitForJSCompletionTimeout];
|
| if (!did_complete)
|
| return nil;
|
| - [temp_error autorelease];
|
| - if (out_error)
|
| - *out_error = temp_error;
|
| - return [result autorelease];
|
| + if (out_error) {
|
| + NSError* __autoreleasing auto_released_error = temp_error;
|
| + *out_error = auto_released_error;
|
| + }
|
| + return result;
|
| }
|
|
|
| } // namespace chrome_test_util
|
|
|