Index: crypto/mock_apple_keychain.h |
diff --git a/crypto/mock_apple_keychain.h b/crypto/mock_apple_keychain.h |
index 3948d489755a3049a268772763648fe5d3cf9994..37d4d061d22e632ec574a3f7ccfc593a73614cc4 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); |
+ |
+ static void set_locked(bool locked) { locked_ = locked; } |
Ryan Sleevi
2015/06/26 10:46:38
I feel that, design wise, adding a static member v
vasilii
2015/06/26 12:18:48
You're absolutely right. The original idea was to
|
#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. |
+ static bool locked_; |
+ |
typedef struct KeychainPasswordData { |
KeychainPasswordData() : data(NULL), length(0) {} |
void* data; |