Index: chrome/browser/signin/local_auth_unittest.cc |
diff --git a/chrome/browser/signin/local_auth_unittest.cc b/chrome/browser/signin/local_auth_unittest.cc |
index 8aa0ddde28f38de2a66fbae6d16ba6b38b6659ee..0dc0b50d9ce93d1ddbc023d0dbd8876f7e61df7c 100644 |
--- a/chrome/browser/signin/local_auth_unittest.cc |
+++ b/chrome/browser/signin/local_auth_unittest.cc |
@@ -13,7 +13,7 @@ |
#include "chrome/test/base/testing_browser_process.h" |
#include "chrome/test/base/testing_profile.h" |
#include "chrome/test/base/testing_profile_manager.h" |
-#include "components/os_crypt/os_crypt.h" |
+#include "components/os_crypt/os_crypt_mocker.h" |
#include "components/prefs/pref_service.h" |
#include "components/syncable_prefs/testing_pref_service_syncable.h" |
#include "content/public/test/test_browser_thread_bundle.h" |
@@ -22,6 +22,10 @@ |
class LocalAuthTest : public testing::Test { |
content::TestBrowserThreadBundle thread_bundle_; |
+ |
+ void SetUp() override { OSCryptMocker::SetUpWithSingleton(); } |
vabr (Chromium)
2016/05/24 13:33:44
Could you do this in the constructor and destructo
cfroussios
2016/05/25 13:13:09
Done.
|
+ |
+ void TearDown() override { OSCryptMocker::TearDown(); } |
}; |
TEST_F(LocalAuthTest, SetAndCheckCredentials) { |
@@ -34,10 +38,6 @@ TEST_F(LocalAuthTest, SetAndCheckCredentials) { |
GetProfileAttributesWithPath(prof->GetPath(), &entry)); |
EXPECT_EQ("", entry->GetLocalAuthCredentials()); |
-#if defined(OS_MACOSX) |
- OSCrypt::UseMockKeychain(true); |
-#endif |
- |
std::string password("Some Password"); |
EXPECT_FALSE(LocalAuth::ValidateLocalAuthCredentials(prof, password)); |
@@ -70,10 +70,6 @@ TEST_F(LocalAuthTest, SetUpgradeAndCheckCredentials) { |
ASSERT_TRUE(testing_profile_manager.SetUp()); |
Profile* prof = testing_profile_manager.CreateTestingProfile("p1"); |
-#if defined(OS_MACOSX) |
- OSCrypt::UseMockKeychain(true); |
-#endif |
- |
std::string password("Some Password"); |
ProfileAttributesEntry* entry; |
ASSERT_TRUE(testing_profile_manager.profile_attributes_storage()-> |