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

Unified Diff: chrome/browser/chromeos/login/quick_unlock/pin_storage_unittest.cc

Issue 2715823004: Add FingerprintUnlock KeyedService for each profile (Closed)
Patch Set: Incorporate comments 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/login/quick_unlock/pin_storage_unittest.cc
diff --git a/chrome/browser/chromeos/login/quick_unlock/pin_storage_unittest.cc b/chrome/browser/chromeos/login/quick_unlock/pin_storage_unittest.cc
index 37ce31a3ffcb9f18835bba8db54bfdd1b337e5b3..04117f793a2d5e53789946fd16f6c65e95b66133 100644
--- a/chrome/browser/chromeos/login/quick_unlock/pin_storage_unittest.cc
+++ b/chrome/browser/chromeos/login/quick_unlock/pin_storage_unittest.cc
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#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/common/pref_names.h"
#include "chrome/test/base/testing_profile.h"
@@ -75,7 +75,8 @@ TEST_F(PinStorageUnitTest, PinStorageWritesToPrefs) {
EXPECT_EQ("", prefs->GetString(prefs::kQuickUnlockPinSecret));
quick_unlock::PinStorage* pin_storage =
- quick_unlock::PinStorageFactory::GetForProfile(profile_.get());
+ quick_unlock::QuickUnlockFactory::GetForProfile(profile_.get())
+ ->pin_storage();
PinStorageTestApi pin_storage_test(pin_storage);
pin_storage->SetPin("1111");
@@ -99,7 +100,8 @@ TEST_F(PinStorageUnitTest, PinStorageWritesToPrefs) {
// 3. Resetting unlock attempt count correctly sets attempt count to 0.
TEST_F(PinStorageUnitTest, UnlockAttemptCount) {
quick_unlock::PinStorage* pin_storage =
- quick_unlock::PinStorageFactory::GetForProfile(profile_.get());
+ quick_unlock::QuickUnlockFactory::GetForProfile(profile_.get())
+ ->pin_storage();
EXPECT_EQ(0, pin_storage->unlock_attempt_count());
@@ -116,7 +118,8 @@ TEST_F(PinStorageUnitTest, UnlockAttemptCount) {
// value.
TEST_F(PinStorageUnitTest, TimeSinceLastStrongAuthReturnsPositiveValue) {
quick_unlock::PinStorage* pin_storage =
- quick_unlock::PinStorageFactory::GetForProfile(profile_.get());
+ quick_unlock::QuickUnlockFactory::GetForProfile(profile_.get())
+ ->pin_storage();
PinStorageTestApi pin_storage_test(pin_storage);
EXPECT_FALSE(pin_storage_test.HasStrongAuthInfo());
@@ -135,7 +138,8 @@ TEST_F(PinStorageUnitTest, TimeSinceLastStrongAuthReturnsPositiveValue) {
// storage will request password reconfirmation as expected.
TEST_F(PinStorageUnitTest, QuickUnlockPasswordConfirmationFrequencyPreference) {
quick_unlock::PinStorage* pin_storage =
- quick_unlock::PinStorageFactory::GetForProfile(profile_.get());
+ quick_unlock::QuickUnlockFactory::GetForProfile(profile_.get())
+ ->pin_storage();
PrefService* pref_service = profile_->GetPrefs();
PinStorageTestApi test_api(pin_storage);
@@ -190,7 +194,8 @@ TEST_F(PinStorageUnitTest, QuickUnlockPasswordConfirmationFrequencyPreference) {
// Verifies that the correct pin can be used to authenticate.
TEST_F(PinStorageUnitTest, AuthenticationSucceedsWithRightPin) {
quick_unlock::PinStorage* pin_storage =
- quick_unlock::PinStorageFactory::GetForProfile(profile_.get());
+ quick_unlock::QuickUnlockFactory::GetForProfile(profile_.get())
+ ->pin_storage();
pin_storage->SetPin("1111");
@@ -202,7 +207,8 @@ TEST_F(PinStorageUnitTest, AuthenticationSucceedsWithRightPin) {
// authentication attempts have been made.
TEST_F(PinStorageUnitTest, AuthenticationFailsFromTooManyAttempts) {
quick_unlock::PinStorage* pin_storage =
- quick_unlock::PinStorageFactory::GetForProfile(profile_.get());
+ quick_unlock::QuickUnlockFactory::GetForProfile(profile_.get())
+ ->pin_storage();
pin_storage->SetPin("1111");
@@ -221,7 +227,8 @@ TEST_F(PinStorageUnitTest, AuthenticationFailsFromTooManyAttempts) {
// long since a strong-auth/password authentication.
TEST_F(PinStorageUnitTest, AuthenticationFailsFromTimeout) {
quick_unlock::PinStorage* pin_storage =
- quick_unlock::PinStorageFactory::GetForProfile(profile_.get());
+ quick_unlock::QuickUnlockFactory::GetForProfile(profile_.get())
+ ->pin_storage();
PinStorageTestApi pin_storage_test(pin_storage);
pin_storage->SetPin("1111");

Powered by Google App Engine
This is Rietveld 408576698