| Index: ios/chrome/browser/signin/chrome_identity_service_observer_bridge_unittest.mm
|
| diff --git a/ios/chrome/browser/signin/chrome_identity_service_observer_bridge_unittest.mm b/ios/chrome/browser/signin/chrome_identity_service_observer_bridge_unittest.mm
|
| index fa0eff59debf22f8ec8e9fdc1611a079d0b830e9..ae034c27e094a74d9f9441a5d0167154e7d18965 100644
|
| --- a/ios/chrome/browser/signin/chrome_identity_service_observer_bridge_unittest.mm
|
| +++ b/ios/chrome/browser/signin/chrome_identity_service_observer_bridge_unittest.mm
|
| @@ -6,20 +6,23 @@
|
|
|
| #include <memory>
|
|
|
| -#include "base/mac/scoped_nsobject.h"
|
| #import "ios/public/provider/chrome/browser/signin/chrome_identity.h"
|
| #include "ios/public/provider/chrome/browser/signin/chrome_identity_service.h"
|
| #include "testing/gtest_mac.h"
|
| #include "testing/platform_test.h"
|
|
|
| +#if !defined(__has_feature) || !__has_feature(objc_arc)
|
| +#error "This file requires ARC support."
|
| +#endif
|
| +
|
| @interface TestChromeIdentityServiceObserver
|
| : NSObject<ChromeIdentityServiceObserver>
|
| @property(nonatomic) BOOL onIdentityListChangedCalled;
|
| @property(nonatomic) BOOL onAccessTokenRefreshFailedCalled;
|
| @property(nonatomic) BOOL onProfileUpdateCalled;
|
| @property(nonatomic) BOOL onChromeIdentityServiceWillBeDestroyedCalled;
|
| -@property(nonatomic, assign) ChromeIdentity* identity;
|
| -@property(nonatomic, readonly) NSDictionary* userInfo;
|
| +@property(nonatomic, weak) ChromeIdentity* identity;
|
| +@property(weak, nonatomic, readonly) NSDictionary* userInfo;
|
| @property(nonatomic, readonly)
|
| ios::ChromeIdentityService::Observer* observerBridge;
|
| @end
|
| @@ -88,7 +91,7 @@ class ChromeIdentityServiceObserverBridgeTest : public PlatformTest {
|
| }
|
|
|
| private:
|
| - base::scoped_nsobject<TestChromeIdentityServiceObserver> test_observer_;
|
| + TestChromeIdentityServiceObserver* test_observer_;
|
| };
|
|
|
| // Tests that |onIdentityListChanged| is forwarded.
|
| @@ -103,7 +106,7 @@ TEST_F(ChromeIdentityServiceObserverBridgeTest, onIdentityListChanged) {
|
|
|
| // Tests that |onAccessTokenRefreshFailed| is forwarded.
|
| TEST_F(ChromeIdentityServiceObserverBridgeTest, onAccessTokenRefreshFailed) {
|
| - base::scoped_nsobject<ChromeIdentity> identity([[ChromeIdentity alloc] init]);
|
| + ChromeIdentity* identity = [[ChromeIdentity alloc] init];
|
| NSDictionary* userInfo = [NSDictionary dictionary];
|
| ASSERT_FALSE(GetTestObserver().onAccessTokenRefreshFailedCalled);
|
| GetObserverBridge()->OnAccessTokenRefreshFailed(identity, userInfo);
|
| @@ -117,7 +120,7 @@ TEST_F(ChromeIdentityServiceObserverBridgeTest, onAccessTokenRefreshFailed) {
|
|
|
| // Tests that |onProfileUpdate| is forwarded.
|
| TEST_F(ChromeIdentityServiceObserverBridgeTest, onProfileUpdate) {
|
| - base::scoped_nsobject<ChromeIdentity> identity([[ChromeIdentity alloc] init]);
|
| + ChromeIdentity* identity = [[ChromeIdentity alloc] init];
|
| ASSERT_FALSE(GetTestObserver().onProfileUpdateCalled);
|
| GetObserverBridge()->OnProfileUpdate(identity);
|
| EXPECT_FALSE(GetTestObserver().onIdentityListChangedCalled);
|
|
|