1616
1717#import " GoogleSignIn/Sources/GIDAuthStateMigration.h"
1818#import " GoogleSignIn/Sources/GIDSignInCallbackSchemes.h"
19- #if TARGET_OS_OSX || TARGET_OS_MACCATALYST
19+ #if TARGET_OS_OSX
2020#import " GoogleSignIn/Tests/Unit/OIDAuthState+Testing.h"
21- #endif // TARGET_OS_OSX || TARGET_OS_MACCATALYST
21+ #endif // TARGET_OS_OSX
2222
2323@import GTMAppAuth;
2424
@@ -84,9 +84,9 @@ @implementation GIDAuthStateMigrationTest {
8484 id _mockNSBundle;
8585 id _mockGIDSignInCallbackSchemes;
8686 id _mockGTMOAuth2Compatibility;
87- #if TARGET_OS_OSX || TARGET_OS_MACCATALYST
87+ #if TARGET_OS_OSX
8888 id _realLegacyGTMKeychainStore;
89- #endif // TARGET_OS_OSX || TARGET_OS_MACCATALYST
89+ #endif // TARGET_OS_OSX
9090}
9191
9292- (void )setUp {
@@ -100,12 +100,12 @@ - (void)setUp {
100100 _mockNSBundle = OCMStrictClassMock ([NSBundle class ]);
101101 _mockGIDSignInCallbackSchemes = OCMStrictClassMock ([GIDSignInCallbackSchemes class ]);
102102 _mockGTMOAuth2Compatibility = OCMStrictClassMock ([GTMOAuth2Compatibility class ]);
103- #if TARGET_OS_OSX || TARGET_OS_MACCATALYST
103+ #if TARGET_OS_OSX
104104 GTMKeychainAttribute *fileBasedKeychain = [GTMKeychainAttribute useFileBasedKeychain ];
105105 NSSet *attributes = [NSSet setWithArray: @[fileBasedKeychain]];
106106 _realLegacyGTMKeychainStore = [[GTMKeychainStore alloc ] initWithItemName: kKeychainName
107107 keychainAttributes: attributes];
108- #endif // TARGET_OS_OSX || TARGET_OS_MACCATALYST
108+ #endif // TARGET_OS_OSX
109109}
110110
111111- (void )tearDown {
@@ -125,16 +125,16 @@ - (void)tearDown {
125125 [_mockGIDSignInCallbackSchemes stopMocking ];
126126 [_mockGTMOAuth2Compatibility verify ];
127127 [_mockGTMOAuth2Compatibility stopMocking ];
128- #if TARGET_OS_OSX || TARGET_OS_MACCATALYST
128+ #if TARGET_OS_OSX
129129 [_realLegacyGTMKeychainStore removeAuthSessionWithError: nil ];
130- #endif // TARGET_OS_OSX || TARGET_OS_MACCATALYST
130+ #endif // TARGET_OS_OSX
131131
132132 [super tearDown ];
133133}
134134
135135#pragma mark - Tests
136136
137- #if TARGET_OS_OSX || TARGET_OS_MACCATALYST
137+ #if TARGET_OS_OSX
138138- (void )testMigrateIfNeeded_NoPreviousMigration_DataProtectedMigration {
139139 [[[_mockUserDefaults stub ] andReturn: _mockUserDefaults] standardUserDefaults ];
140140 [[[_mockUserDefaults expect ] andReturnValue: @NO ] boolForKey: kDataProtectedMigrationCheckPerformedKey ];
@@ -242,17 +242,17 @@ - (void)testExtractAuthorization_HostedDomain {
242242
243243 XCTAssertNotNil (authorization);
244244}
245- #endif // TARGET_OS_OSX || TARGET_OS_MACCATALYST
245+ #endif // TARGET_OS_OSX
246246
247247- (void )testMigrateIfNeeded_HasPreviousMigration {
248248 [[[_mockUserDefaults stub ] andReturn: _mockUserDefaults] standardUserDefaults ];
249- #if TARGET_OS_OSX || TARGET_OS_MACCATALYST
249+ #if TARGET_OS_OSX
250250 [[[_mockUserDefaults expect ] andReturnValue: @YES ] boolForKey: kDataProtectedMigrationCheckPerformedKey ];
251251 [[_mockUserDefaults reject ] setBool: YES forKey: kDataProtectedMigrationCheckPerformedKey ];
252252#else
253253 [[[_mockUserDefaults expect ] andReturnValue: @YES ] boolForKey: kGTMAppAuthMigrationCheckPerformedKey ];
254254 [[_mockUserDefaults reject ] setBool: YES forKey: kGTMAppAuthMigrationCheckPerformedKey ];
255- #endif // TARGET_OS_OSX || TARGET_OS_MACCATALYST
255+ #endif // TARGET_OS_OSX
256256
257257 GIDAuthStateMigration *migration =
258258 [[GIDAuthStateMigration alloc ] initWithKeychainStore: _mockGTMKeychainStore];
@@ -264,11 +264,11 @@ - (void)testMigrateIfNeeded_HasPreviousMigration {
264264
265265- (void )testMigrateIfNeeded_isFreshInstall {
266266 [[[_mockUserDefaults stub ] andReturn: _mockUserDefaults] standardUserDefaults ];
267- #if TARGET_OS_OSX || TARGET_OS_MACCATALYST
267+ #if TARGET_OS_OSX
268268 [[_mockUserDefaults expect ] setBool: YES forKey: kDataProtectedMigrationCheckPerformedKey ];
269269#else
270270 [[_mockUserDefaults expect ] setBool: YES forKey: kGTMAppAuthMigrationCheckPerformedKey ];
271- #endif // TARGET_OS_OSX || TARGET_OS_MACCATALYST
271+ #endif // TARGET_OS_OSX
272272
273273 GIDAuthStateMigration *migration =
274274 [[GIDAuthStateMigration alloc ] initWithKeychainStore: _mockGTMKeychainStore];
0 commit comments