Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1562)

Unified Diff: chrome/browser/chromeos/extensions/quick_unlock_private/quick_unlock_private_api_unittest.cc

Issue 2715823004: Add FingerprintUnlock KeyedService for each profile (Closed)
Patch Set: rebase Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/extensions/quick_unlock_private/quick_unlock_private_api_unittest.cc
diff --git a/chrome/browser/chromeos/extensions/quick_unlock_private/quick_unlock_private_api_unittest.cc b/chrome/browser/chromeos/extensions/quick_unlock_private/quick_unlock_private_api_unittest.cc
index 67d2d5ae48e3b89e116b15544844fc6792270562..20013f9ef37f015fb3eea040f98b56f9baefca09 100644
--- a/chrome/browser/chromeos/extensions/quick_unlock_private/quick_unlock_private_api_unittest.cc
+++ b/chrome/browser/chromeos/extensions/quick_unlock_private/quick_unlock_private_api_unittest.cc
@@ -10,8 +10,8 @@
#include "base/bind.h"
#include "base/memory/ptr_util.h"
-#include "chrome/browser/chromeos/login/quick_unlock/pin_storage.h"
-#include "chrome/browser/chromeos/login/quick_unlock/pin_storage_factory.h"
+#include "chrome/browser/chromeos/login/quick_unlock/quick_unlock_factory.h"
+#include "chrome/browser/chromeos/login/quick_unlock/quick_unlock_storage.h"
#include "chrome/browser/chromeos/login/quick_unlock/quick_unlock_utils.h"
#include "chrome/browser/chromeos/login/users/fake_chrome_user_manager.h"
#include "chrome/browser/chromeos/login/users/scoped_user_manager_enabler.h"
@@ -354,8 +354,8 @@ TEST_F(QuickUnlockPrivateUnitTest, ModeChangeEventOnlyRaisedWhenModesChange) {
// Ensures that quick unlock can be enabled and disabled by checking the result
// of quickUnlockPrivate.GetActiveModes and PinStorage::IsPinSet.
TEST_F(QuickUnlockPrivateUnitTest, SetModesAndGetActiveModes) {
- quick_unlock::PinStorage* pin_storage =
- quick_unlock::PinStorageFactory::GetForProfile(profile());
+ quick_unlock::QuickUnlockStorage* quick_unlock_storage =
+ quick_unlock::QuickUnlockFactory::GetForProfile(profile());
// Update mode to PIN raises an event and updates GetActiveModes.
ExpectModesChanged(
@@ -364,31 +364,31 @@ TEST_F(QuickUnlockPrivateUnitTest, SetModesAndGetActiveModes) {
QuickUnlockModeList{QuickUnlockMode::QUICK_UNLOCK_MODE_PIN}, {"111111"}));
EXPECT_EQ(GetActiveModes(),
QuickUnlockModeList{QuickUnlockMode::QUICK_UNLOCK_MODE_PIN});
- EXPECT_TRUE(pin_storage->IsPinSet());
+ EXPECT_TRUE(quick_unlock_storage->pin_storage()->IsPinSet());
// SetModes can be used to turn off a quick unlock mode.
ExpectModesChanged(QuickUnlockModeList{});
EXPECT_TRUE(SetModes(QuickUnlockModeList{}, CredentialList{}));
EXPECT_EQ(GetActiveModes(), QuickUnlockModeList{});
- EXPECT_FALSE(pin_storage->IsPinSet());
+ EXPECT_FALSE(quick_unlock_storage->pin_storage()->IsPinSet());
}
// Verifies that enabling PIN quick unlock actually talks to the PIN subsystem.
TEST_F(QuickUnlockPrivateUnitTest, VerifyAuthenticationAgainstPIN) {
- quick_unlock::PinStorage* pin_storage =
- quick_unlock::PinStorageFactory::GetForProfile(profile());
+ quick_unlock::QuickUnlockStorage* quick_unlock_storage =
+ quick_unlock::QuickUnlockFactory::GetForProfile(profile());
EXPECT_TRUE(SetModes(QuickUnlockModeList{}, CredentialList{}));
- EXPECT_FALSE(pin_storage->IsPinSet());
+ EXPECT_FALSE(quick_unlock_storage->pin_storage()->IsPinSet());
EXPECT_TRUE(SetModes(
QuickUnlockModeList{QuickUnlockMode::QUICK_UNLOCK_MODE_PIN}, {"111111"}));
- EXPECT_TRUE(pin_storage->IsPinSet());
+ EXPECT_TRUE(quick_unlock_storage->pin_storage()->IsPinSet());
- pin_storage->MarkStrongAuth();
- pin_storage->ResetUnlockAttemptCount();
- EXPECT_TRUE(pin_storage->TryAuthenticatePin("111111"));
- EXPECT_FALSE(pin_storage->TryAuthenticatePin("000000"));
+ quick_unlock_storage->MarkStrongAuth();
+ quick_unlock_storage->pin_storage()->ResetUnlockAttemptCount();
+ EXPECT_TRUE(quick_unlock_storage->TryAuthenticatePin("111111"));
+ EXPECT_FALSE(quick_unlock_storage->TryAuthenticatePin("000000"));
}
// Verifies that the number of modes and the number of passwords given must be

Powered by Google App Engine
This is Rietveld 408576698