| Index: ios/chrome/browser/ui/settings/password_details_collection_view_controller_unittest.mm
|
| diff --git a/ios/chrome/browser/ui/settings/password_details_collection_view_controller_unittest.mm b/ios/chrome/browser/ui/settings/password_details_collection_view_controller_unittest.mm
|
| index 1b588974ac4ff3670c0542718fb8420d4bad076d..f53bbd87d52cec9569d002f0a86d3cfa40c13d57 100644
|
| --- a/ios/chrome/browser/ui/settings/password_details_collection_view_controller_unittest.mm
|
| +++ b/ios/chrome/browser/ui/settings/password_details_collection_view_controller_unittest.mm
|
| @@ -5,7 +5,6 @@
|
| #import "ios/chrome/browser/ui/settings/password_details_collection_view_controller.h"
|
|
|
| #include "base/mac/foundation_util.h"
|
| -#import "base/mac/scoped_nsobject.h"
|
| #include "base/strings/sys_string_conversions.h"
|
| #include "components/autofill/core/common/password_form.h"
|
| #import "ios/chrome/browser/ui/collection_view/collection_view_controller_test.h"
|
| @@ -18,6 +17,10 @@
|
| #import "testing/gtest_mac.h"
|
| #include "ui/base/l10n/l10n_util.h"
|
|
|
| +#if !defined(__has_feature) || !__has_feature(objc_arc)
|
| +#error "This file requires ARC support."
|
| +#endif
|
| +
|
| @interface MockReauthenticationModule : NSObject<ReauthenticationProtocol>
|
|
|
| @property(nonatomic, copy) NSString* localizedReasonForAuthentication;
|
| @@ -81,11 +84,11 @@ class PasswordDetailsCollectionViewControllerTest
|
| void SetUp() override {
|
| CollectionViewControllerTest::SetUp();
|
| origin_ = @"testorigin.com";
|
| - delegate_.reset([[MockSavePasswordsCollectionViewController alloc] init]);
|
| - reauthenticationModule_.reset([[MockReauthenticationModule alloc] init]);
|
| + delegate_ = [[MockSavePasswordsCollectionViewController alloc] init];
|
| + reauthenticationModule_ = [[MockReauthenticationModule alloc] init];
|
| }
|
|
|
| - CollectionViewController* NewController() override NS_RETURNS_RETAINED {
|
| + CollectionViewController* InstantiateController() override {
|
| return [[PasswordDetailsCollectionViewController alloc]
|
| initWithPasswordForm:*(new autofill::PasswordForm())
|
| delegate:delegate_
|
| @@ -101,8 +104,8 @@ class PasswordDetailsCollectionViewControllerTest
|
| }
|
|
|
| web::TestWebThreadBundle thread_bundle_;
|
| - base::scoped_nsobject<MockSavePasswordsCollectionViewController> delegate_;
|
| - base::scoped_nsobject<MockReauthenticationModule> reauthenticationModule_;
|
| + MockSavePasswordsCollectionViewController* delegate_;
|
| + MockReauthenticationModule* reauthenticationModule_;
|
| NSString* origin_;
|
| };
|
|
|
| @@ -165,7 +168,7 @@ TEST_F(PasswordDetailsCollectionViewControllerTest, ShowPassword) {
|
| EXPECT_TRUE(passwordItem.showingText);
|
| EXPECT_NSEQ(
|
| l10n_util::GetNSString(IDS_IOS_SETTINGS_PASSWORD_REAUTH_REASON_SHOW),
|
| - reauthenticationModule_.get().localizedReasonForAuthentication);
|
| + reauthenticationModule_.localizedReasonForAuthentication);
|
| CheckTextCellTitleWithId(IDS_IOS_SETTINGS_PASSWORD_HIDE_BUTTON,
|
| kPasswordSection, kShowHideButtonItem);
|
| }
|
| @@ -197,7 +200,7 @@ TEST_F(PasswordDetailsCollectionViewControllerTest, CopyPassword) {
|
| EXPECT_NSEQ(kPassword, generalPasteboard.string);
|
| EXPECT_NSEQ(
|
| l10n_util::GetNSString(IDS_IOS_SETTINGS_PASSWORD_REAUTH_REASON_COPY),
|
| - reauthenticationModule_.get().localizedReasonForAuthentication);
|
| + reauthenticationModule_.localizedReasonForAuthentication);
|
| }
|
|
|
| TEST_F(PasswordDetailsCollectionViewControllerTest, DeletePassword) {
|
| @@ -205,7 +208,7 @@ TEST_F(PasswordDetailsCollectionViewControllerTest, DeletePassword) {
|
| [controller() collectionView:[controller() collectionView]
|
| didSelectItemAtIndexPath:[NSIndexPath indexPathForRow:kDeleteButtonItem
|
| inSection:kPasswordSection]];
|
| - EXPECT_EQ(1, delegate_.get().numberOfCallsToDeletePassword);
|
| + EXPECT_EQ(1, delegate_.numberOfCallsToDeletePassword);
|
| }
|
|
|
| } // namespace
|
|
|