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

Unified Diff: components/proximity_auth/proximity_auth_pref_manager_unittest.cc

Issue 2902093002: [EasyUnlock] Force user to enter their password after 20 hours. (Closed)
Patch Set: fix test Created 3 years, 7 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 77a1147b0e8ecfd417d8735a53d22c15f2a8ae44..3ae2072b8356e69d0b2852d4e0cc2e65f4fde585 100644
--- a/components/proximity_auth/proximity_auth_pref_manager_unittest.cc
+++ b/components/proximity_auth/proximity_auth_pref_manager_unittest.cc
@@ -24,6 +24,9 @@ const char kPublicKey1[] = "public key 1";
const char kBluetoothAddress2[] = "22:33:44:55:66:77";
const char kPublicKey2[] = "public key 2";
+const int64_t kPasswordEntryTimestampMs1 = 123456789L;
+const int64_t kPasswordEntryTimestampMs2 = 987654321L;
+
} // namespace
class ProximityAuthProximityAuthPrefManagerTest : public testing::Test {
@@ -156,4 +159,15 @@ TEST_F(ProximityAuthProximityAuthPrefManagerTest, GetPublicKeys) {
public_keys.end());
}
+TEST_F(ProximityAuthProximityAuthPrefManagerTest, LastPasswordEntryTimestamp) {
+ ProximityAuthPrefManager pref_manager(&pref_service_);
+ EXPECT_EQ(0L, pref_manager.GetLastPasswordEntryTimestampMs());
+ pref_manager.SetLastPasswordEntryTimestampMs(kPasswordEntryTimestampMs1);
+ EXPECT_EQ(kPasswordEntryTimestampMs1,
+ pref_manager.GetLastPasswordEntryTimestampMs());
+ pref_manager.SetLastPasswordEntryTimestampMs(kPasswordEntryTimestampMs2);
+ EXPECT_EQ(kPasswordEntryTimestampMs2,
+ pref_manager.GetLastPasswordEntryTimestampMs());
+}
+
} // namespace proximity_auth
« no previous file with comments | « components/proximity_auth/proximity_auth_pref_manager.cc ('k') | components/proximity_auth/proximity_auth_pref_names.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698