Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 3 additions & 12 deletions GoogleSignIn/Tests/Unit/GIDSignInTest.m
Original file line number Diff line number Diff line change
Expand Up @@ -268,10 +268,8 @@ @interface GIDSignInTest : XCTestCase {
// Status returned by saveAuthorization:toKeychainForName:
BOOL _saveAuthorizationReturnValue;

#if TARGET_OS_IOS && !TARGET_OS_MACCATALYST
// Test userDefaults for use with `GIDAppCheck`
NSUserDefaults *_testUserDefaults;
#endif // TARGET_OS_IOS && !TARGET_OS_MACCATALYST
}
@end

Expand Down Expand Up @@ -337,15 +335,12 @@ - (void)setUp {
[_fakeMainBundle fakeAllSchemesSupported];

// Object under test
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:kAppHasRunBeforeKey];
_testUserDefaults = [[NSUserDefaults alloc] initWithSuiteName:kUserDefaultsSuiteName];
[_testUserDefaults setBool:YES forKey:kAppHasRunBeforeKey];

_signIn = [[GIDSignIn alloc] initWithKeychainStore:_keychainStore];
_hint = nil;

#if TARGET_OS_IOS && !TARGET_OS_MACCATALYST
_testUserDefaults = [[NSUserDefaults alloc] initWithSuiteName:kUserDefaultsSuiteName];
#endif // TARGET_OS_IOS && !TARGET_OS_MACCATALYST

__weak GIDSignInTest *weakSelf = self;
_completion = ^(GIDSignInResult *_Nullable signInResult, NSError * _Nullable error) {
GIDSignInTest *strongSelf = weakSelf;
Expand All @@ -372,11 +367,7 @@ - (void)tearDown {
OCMVerifyAll(_presentingWindow);
#endif // TARGET_OS_IOS || TARGET_OS_MACCATALYST

[[NSUserDefaults standardUserDefaults] removeObjectForKey:kAppHasRunBeforeKey];
#if TARGET_OS_IOS && !TARGET_OS_MACCATALYST
[_testUserDefaults removeObjectForKey:kGIDAppCheckPreparedKey];
[_testUserDefaults removeSuiteNamed:kUserDefaultsSuiteName];
#endif // TARGET_OS_IOS && !TARGET_OS_MACCATALYST
[_testUserDefaults removePersistentDomainForName:kUserDefaultsSuiteName];

[_fakeMainBundle stopFaking];
[super tearDown];
Expand Down