Skip to content

Commit

Permalink
Add availability check for useDataProtection in test so all platforms…
Browse files Browse the repository at this point in the history
… pass
  • Loading branch information
mdmathias committed Jan 31, 2024
1 parent 25a950c commit c30b646
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,15 @@ class GTMOAuth2CompatibilityTests: XCTestCase {
private lazy var testPersistenceString: String = {
return "access_token=\(TestingConstants.testAccessToken)&refresh_token=\(TestingConstants.testRefreshToken)&scope=\(TestingConstants.testScope2)&serviceProvider=\(TestingConstants.testServiceProvider)&userEmail=foo%40foo.com&userEmailIsVerified=y&userID=\(TestingConstants.testUserID)"
}()
private let keychainHelperWithAttributes = KeychainHelperFake(
keychainAttributes: [.useDataProtectionKeychain,
.keychainAccessGroup(name: TestingConstants.testAccessGroup)]
)
private lazy var keychainStoreWithAttributes: KeychainStore = {
let attributes: Set<KeychainAttribute>
if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) {
attributes = [.useDataProtectionKeychain,
.keychainAccessGroup(name: TestingConstants.testAccessGroup)]
} else {
attributes = [.keychainAccessGroup(name: TestingConstants.testAccessGroup)]
}
let keychainHelperWithAttributes = KeychainHelperFake(keychainAttributes: attributes)
return KeychainStore(
itemName: TestingConstants.testKeychainItemName,
keychainHelper: keychainHelperWithAttributes
Expand Down

0 comments on commit c30b646

Please sign in to comment.