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

Unified Diff: ios/web/public/test/earl_grey/js_test_util.mm

Issue 2886573002: [ObjC ARC] Converts ios/web:earl_grey_test_support to ARC. (Closed)
Patch Set: remove unecessary if statement Created 3 years, 7 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
« no previous file with comments | « ios/web/public/test/earl_grey/js_test_util.h ('k') | ios/web/public/test/earl_grey/web_view_actions.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « ios/web/public/test/earl_grey/js_test_util.h ('k') | ios/web/public/test/earl_grey/web_view_actions.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698