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

Unified Diff: ios/web/public/test/web_test_with_web_state.mm

Issue 2920303003: [ObjC ARC] Converts ios/web/public/test:test to ARC. (Closed)
Patch Set: unsafe_unretained Created 3 years, 6 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
Index: ios/web/public/test/web_test_with_web_state.mm
diff --git a/ios/web/public/test/web_test_with_web_state.mm b/ios/web/public/test/web_test_with_web_state.mm
index 963c6356fb79dcbcd319065f1905774c0f0c3b0f..cdad4473d8a31f212a58fbb69e1253a34e657928 100644
--- a/ios/web/public/test/web_test_with_web_state.mm
+++ b/ios/web/public/test/web_test_with_web_state.mm
@@ -13,6 +13,10 @@
#import "ios/web/web_state/ui/crw_web_controller.h"
#import "ios/web/web_state/web_state_impl.h"
+#if !defined(__has_feature) || !__has_feature(objc_arc)
+#error "This file requires ARC support."
+#endif
+
namespace {
// Returns CRWWebController for the given |web_state|.
CRWWebController* GetWebController(web::WebState* web_state) {
@@ -127,18 +131,18 @@ void WebTestWithWebState::WaitForCondition(ConditionBlock condition) {
}
id WebTestWithWebState::ExecuteJavaScript(NSString* script) {
- __block base::scoped_nsprotocol<id> executionResult;
+ __block id executionResult;
__block bool executionCompleted = false;
[GetWebController(web_state())
executeJavaScript:script
completionHandler:^(id result, NSError* error) {
- executionResult.reset([result copy]);
+ executionResult = [result copy];
executionCompleted = true;
}];
base::test::ios::WaitUntilCondition(^{
return executionCompleted;
});
- return [[executionResult retain] autorelease];
+ return executionResult;
}
void WebTestWithWebState::DestroyWebState() {

Powered by Google App Engine
This is Rietveld 408576698