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; |