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

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

Issue 2545663004: [ios] Fixed memory management in ExecuteScriptOnInterstitial. (Closed)
Patch Set: Created 4 years 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 | « no previous file | no next file » | 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 f6d96f9e54c3689b28fd4aec89faa813611f3a59..b2bdcdf4ea3292d097a5ea2de3842595333e909b 100644
--- a/ios/web/public/test/earl_grey/js_test_util.mm
+++ b/ios/web/public/test/earl_grey/js_test_util.mm
@@ -84,14 +84,14 @@ id ExecuteScriptOnInterstitial(WebState* web_state, NSString* script) {
__block id script_result = nil;
__block bool did_finish = false;
web::ExecuteScriptForTesting(interstitial, script, ^(id result, NSError*) {
- script_result = [[result copy] autorelease];
+ script_result = [result copy];
did_finish = true;
});
BOOL suceeded = WaitUntilConditionOrTimeout(kWaitForJSCompletionTimeout, ^{
return did_finish;
});
GREYAssert(suceeded, @"Script execution timed out");
- return script_result;
+ return [script_result autorelease];
}
} // namespace web
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698