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

Unified Diff: ios/chrome/test/earl_grey/chrome_matchers.mm

Issue 2684023003: [ObjC ARC] Converts ios/chrome/test/earl_grey:test_support to ARC. (Closed)
Patch Set: Add __unsafe_unretained Created 3 years, 10 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/chrome/test/earl_grey/chrome_matchers.mm
diff --git a/ios/chrome/test/earl_grey/chrome_matchers.mm b/ios/chrome/test/earl_grey/chrome_matchers.mm
index 6b01367d728f20fa82e9d5051f5b52cee7d0befe..8525323f5a3ab96aef25edf2f3c08b74edb0eabe 100644
--- a/ios/chrome/test/earl_grey/chrome_matchers.mm
+++ b/ios/chrome/test/earl_grey/chrome_matchers.mm
@@ -23,6 +23,10 @@
#import "ios/web/public/test/earl_grey/web_view_matchers.h"
#include "ui/base/l10n/l10n_util.h"
+#if !defined(__has_feature) || !__has_feature(objc_arc)
+#error "This file requires ARC support."
+#endif
+
namespace {
// Script that returns document.body as a string.
@@ -50,7 +54,7 @@ id ExecuteScriptInStaticController(
}),
@"JavaScript did not complete");
- return [result autorelease];
+ return result;
}
// TODO(crbug.com/684142): This matcher uses too many implementation details,
@@ -68,9 +72,8 @@ id<GREYMatcher> WebViewWithNavDelegateOfClass(Class cls) {
[description appendText:@"navigation delegate"];
};
- return [[[GREYElementMatcherBlock alloc] initWithMatchesBlock:matches
- descriptionBlock:describe]
- autorelease];
+ return [[GREYElementMatcherBlock alloc] initWithMatchesBlock:matches
+ descriptionBlock:describe];
}
id<GREYMatcher> CollectionViewSwitchIsOn(BOOL isOn) {
@@ -86,9 +89,8 @@ id<GREYMatcher> CollectionViewSwitchIsOn(BOOL isOn) {
isOn ? @"ON" : @"OFF"];
[description appendText:name];
};
- return [[[GREYElementMatcherBlock alloc] initWithMatchesBlock:matches
- descriptionBlock:describe]
- autorelease];
+ return [[GREYElementMatcherBlock alloc] initWithMatchesBlock:matches
+ descriptionBlock:describe];
}
} // namespace
@@ -156,9 +158,8 @@ id<GREYMatcher> StaticHtmlViewContainingText(NSString* text) {
return grey_allOf(
WebViewWithNavDelegateOfClass([StaticHtmlViewController class]),
- [[[GREYElementMatcherBlock alloc] initWithMatchesBlock:matches
- descriptionBlock:describe]
- autorelease],
+ [[GREYElementMatcherBlock alloc] initWithMatchesBlock:matches
+ descriptionBlock:describe],
nil);
}

Powered by Google App Engine
This is Rietveld 408576698