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

Unified Diff: ios/chrome/test/earl_grey/chrome_test_case.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_test_case.mm
diff --git a/ios/chrome/test/earl_grey/chrome_test_case.mm b/ios/chrome/test/earl_grey/chrome_test_case.mm
index 9cf8d365f15f6898fc018e8281f0ddc77c34390e..9e5a45bf387dbe3049b7a1b5df016fe77a854d68 100644
--- a/ios/chrome/test/earl_grey/chrome_test_case.mm
+++ b/ios/chrome/test/earl_grey/chrome_test_case.mm
@@ -17,6 +17,10 @@
#import "ios/chrome/test/app/tab_test_util.h"
#import "ios/web/public/test/http_server.h"
+#if !defined(__has_feature) || !__has_feature(objc_arc)
+#error "This file requires ARC support."
+#endif
+
namespace {
NSString* const kFlakyEarlGreyTestTargetSuffix = @"_flaky_egtests";
@@ -76,7 +80,7 @@ const CFTimeInterval kDrainTimeout = 5;
@interface ChromeTestCase () {
// Block to be executed during object tearDown.
- base::mac::ScopedBlock<ProceduralBlock> _tearDownHandler;
+ ProceduralBlock _tearDownHandler;
BOOL _isHTTPServerStopped;
BOOL _isMockAuthenticationDisabled;
@@ -157,7 +161,7 @@ const CFTimeInterval kDrainTimeout = 5;
[super setUp];
_isHTTPServerStopped = NO;
_isMockAuthenticationDisabled = NO;
- _tearDownHandler.reset();
+ _tearDownHandler = nil;
chrome_test_util::OpenNewTab();
[[GREYUIThreadExecutor sharedInstance] drainUntilIdle];
@@ -168,7 +172,7 @@ const CFTimeInterval kDrainTimeout = 5;
// server are running.
- (void)tearDown {
if (_tearDownHandler) {
- _tearDownHandler.get()();
+ _tearDownHandler();
}
// Clear any remaining test accounts and signed in users.
@@ -197,7 +201,7 @@ const CFTimeInterval kDrainTimeout = 5;
- (void)setTearDownHandler:(ProceduralBlock)tearDownHandler {
// Enforce that only one |_tearDownHandler| is set per test.
DCHECK(!_tearDownHandler);
- _tearDownHandler.reset([tearDownHandler copy]);
+ _tearDownHandler = [tearDownHandler copy];
}
+ (void)removeAnyOpenMenusAndInfoBars {

Powered by Google App Engine
This is Rietveld 408576698