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

Unified Diff: components/proximity_auth/proximity_auth_pref_manager_unittest.cc

Issue 2973243002: Adding pref to store the user-selected proximity threshold. (Closed)
Patch Set: Fixing tests Created 3 years, 5 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: components/proximity_auth/proximity_auth_pref_manager_unittest.cc
diff --git a/components/proximity_auth/proximity_auth_pref_manager_unittest.cc b/components/proximity_auth/proximity_auth_pref_manager_unittest.cc
index 3ae2072b8356e69d0b2852d4e0cc2e65f4fde585..ba860680ad059646ebb8dc2ccb336631b9c25490 100644
--- a/components/proximity_auth/proximity_auth_pref_manager_unittest.cc
+++ b/components/proximity_auth/proximity_auth_pref_manager_unittest.cc
@@ -27,6 +27,9 @@ const char kPublicKey2[] = "public key 2";
const int64_t kPasswordEntryTimestampMs1 = 123456789L;
const int64_t kPasswordEntryTimestampMs2 = 987654321L;
+const int kProximityThreshold1 = 2;
+const int kProximityThreshold2 = 3;
+
} // namespace
class ProximityAuthProximityAuthPrefManagerTest : public testing::Test {
@@ -170,4 +173,13 @@ TEST_F(ProximityAuthProximityAuthPrefManagerTest, LastPasswordEntryTimestamp) {
pref_manager.GetLastPasswordEntryTimestampMs());
}
+TEST_F(ProximityAuthProximityAuthPrefManagerTest, ProximityThreshold) {
+ ProximityAuthPrefManager pref_manager(&pref_service_);
+ EXPECT_EQ(1, pref_manager.GetProximityThreshold());
+ pref_manager.SetProximityThreshold(kProximityThreshold1);
+ EXPECT_EQ(kProximityThreshold1, pref_manager.GetProximityThreshold());
+ pref_manager.SetProximityThreshold(kProximityThreshold2);
+ EXPECT_EQ(kProximityThreshold2, pref_manager.GetProximityThreshold());
+}
+
} // namespace proximity_auth

Powered by Google App Engine
This is Rietveld 408576698