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

Unified Diff: ios/chrome/browser/ui/alert_coordinator/alert_coordinator_egtest.mm

Issue 2680803003: [ObjC ARC] Converts ios/chrome/browser/ui/alert_coordinator:eg_tests to ARC. (Closed)
Patch Set: 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
« no previous file with comments | « ios/chrome/browser/ui/alert_coordinator/BUILD.gn ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/ui/alert_coordinator/alert_coordinator_egtest.mm
diff --git a/ios/chrome/browser/ui/alert_coordinator/alert_coordinator_egtest.mm b/ios/chrome/browser/ui/alert_coordinator/alert_coordinator_egtest.mm
index 02a83608e52d11eae427de1eb7f4da380870edcc..f8812349ff6c8963590c54957a5be4449af4cfb6 100644
--- a/ios/chrome/browser/ui/alert_coordinator/alert_coordinator_egtest.mm
+++ b/ios/chrome/browser/ui/alert_coordinator/alert_coordinator_egtest.mm
@@ -6,13 +6,16 @@
#import <UIKit/UIKit.h>
#import <XCTest/XCTest.h>
-#import "base/mac/scoped_nsobject.h"
#include "components/strings/grit/components_strings.h"
#import "ios/chrome/browser/ui/alert_coordinator/alert_coordinator.h"
#import "ios/chrome/test/earl_grey/chrome_matchers.h"
#import "ios/chrome/test/earl_grey/chrome_test_case.h"
#import "ios/testing/earl_grey/disabled_test_macros.h"
+#if !defined(__has_feature) || !__has_feature(objc_arc)
+#error "This file requires ARC support."
+#endif
+
namespace {
NSString* kTitle = @"Foo Title";
} // namespace
@@ -39,16 +42,16 @@ NSString* kTitle = @"Foo Title";
UIViewController* topViewController =
[[[UIApplication sharedApplication] keyWindow] rootViewController];
- base::scoped_nsobject<AlertCoordinator> alertCoordinator(
+ AlertCoordinator* alertCoordinator =
[[AlertCoordinator alloc] initWithBaseViewController:topViewController
title:kTitle
- message:nil]);
+ message:nil];
[alertCoordinator start];
GREYAssertTrue([self isPresentingAlert], @"An alert should be presented");
- alertCoordinator.reset();
+ alertCoordinator = nil;
gambard 2017/02/08 16:08:29 The alert coordinator needs to be dealloc here, be
stkhapugin 2017/02/08 17:39:29 Generally, it is incorrect to assume exact object
gambard 2017/02/09 09:06:45 Acknowledged.
GREYAssertFalse([self isPresentingAlert], @"The alert should be removed");
}
@@ -64,10 +67,10 @@ NSString* kTitle = @"Foo Title";
UIViewController* topViewController =
[[[UIApplication sharedApplication] keyWindow] rootViewController];
- base::scoped_nsobject<AlertCoordinator> alertCoordinator(
+ AlertCoordinator* alertCoordinator =
[[AlertCoordinator alloc] initWithBaseViewController:topViewController
title:kTitle
- message:nil]);
+ message:nil];
__block BOOL blockCalled = NO;
« no previous file with comments | « ios/chrome/browser/ui/alert_coordinator/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698