Index: crypto/mock_apple_keychain.h |
diff --git a/crypto/mock_apple_keychain.h b/crypto/mock_apple_keychain.h |
index 3948d489755a3049a268772763648fe5d3cf9994..f73d3a6466ed23c5420ffc001c75d7cf57541f52 100644 |
--- a/crypto/mock_apple_keychain.h |
+++ b/crypto/mock_apple_keychain.h |
@@ -118,6 +118,8 @@ class CRYPTO_EXPORT MockAppleKeychain : public AppleKeychain { |
}; |
// Adds a keychain item with the given info to the test set. |
void AddTestItem(const KeychainTestData& item_data); |
+ |
+ void set_locked(bool locked) { locked_ = locked; } |
#endif // !defined(OS_IOS) |
// |FindGenericPassword()| can return different results depending on user |
@@ -201,6 +203,10 @@ class CRYPTO_EXPORT MockAppleKeychain : public AppleKeychain { |
static const SecKeychainSearchRef kDummySearchRef; |
+ // Simulates the state when the user refuses to unclock the Keychain. |
+ // If true, reading and modifying a password value result in errSecAuthFailed. |
+ bool locked_; |
+ |
typedef struct KeychainPasswordData { |
KeychainPasswordData() : data(NULL), length(0) {} |
void* data; |