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

Unified Diff: components/autofill/core/browser/webdata/autofill_table_unittest.cc

Issue 2008253003: Explicitly set modification_date when loading server entries from db. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add comments to implementation file Created 4 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
« no previous file with comments | « components/autofill/core/browser/webdata/autofill_table.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/autofill/core/browser/webdata/autofill_table_unittest.cc
diff --git a/components/autofill/core/browser/webdata/autofill_table_unittest.cc b/components/autofill/core/browser/webdata/autofill_table_unittest.cc
index 5243b1a09332a9cc426aab5fc9a36f6094efea67..b16166e192922960180a7c1407cb85cb653ff7f0 100644
--- a/components/autofill/core/browser/webdata/autofill_table_unittest.cc
+++ b/components/autofill/core/browser/webdata/autofill_table_unittest.cc
@@ -1741,6 +1741,9 @@ TEST_F(AutofillTableTest, SetServerCardUpdateUsageStats) {
EXPECT_EQ(masked_card.server_id(), outputs[0]->server_id());
EXPECT_EQ(1U, outputs[0]->use_count());
EXPECT_NE(base::Time(), outputs[0]->use_date());
+ // We don't track modification date for server cards. It should always be
+ // base::Time().
+ EXPECT_EQ(base::Time(), outputs[0]->modification_date());
outputs.clear();
// Update the usage stats; make sure they're reflected in GetServerProfiles.
@@ -1752,6 +1755,7 @@ TEST_F(AutofillTableTest, SetServerCardUpdateUsageStats) {
EXPECT_EQ(masked_card.server_id(), outputs[0]->server_id());
EXPECT_EQ(4U, outputs[0]->use_count());
EXPECT_EQ(base::Time(), outputs[0]->use_date());
+ EXPECT_EQ(base::Time(), outputs[0]->modification_date());
outputs.clear();
// Setting the cards again shouldn't delete the usage stats.
@@ -1761,6 +1765,7 @@ TEST_F(AutofillTableTest, SetServerCardUpdateUsageStats) {
EXPECT_EQ(masked_card.server_id(), outputs[0]->server_id());
EXPECT_EQ(4U, outputs[0]->use_count());
EXPECT_EQ(base::Time(), outputs[0]->use_date());
+ EXPECT_EQ(base::Time(), outputs[0]->modification_date());
outputs.clear();
// Set a card list where the card is missing --- this should clear metadata.
@@ -1776,6 +1781,7 @@ TEST_F(AutofillTableTest, SetServerCardUpdateUsageStats) {
EXPECT_EQ(masked_card.server_id(), outputs[0]->server_id());
EXPECT_EQ(1U, outputs[0]->use_count());
EXPECT_NE(base::Time(), outputs[0]->use_date());
+ EXPECT_EQ(base::Time(), outputs[0]->modification_date());
outputs.clear();
}
@@ -1819,6 +1825,9 @@ TEST_F(AutofillTableTest, SetServerProfileUpdateUsageStats) {
EXPECT_EQ(one.server_id(), outputs[0]->server_id());
EXPECT_EQ(0U, outputs[0]->use_count());
EXPECT_EQ(base::Time(), outputs[0]->use_date());
+ // We don't track modification date for server profiles. It should always be
+ // base::Time().
+ EXPECT_EQ(base::Time(), outputs[0]->modification_date());
outputs.clear();
// Update the usage stats; make sure they're reflected in GetServerProfiles.
@@ -1830,6 +1839,7 @@ TEST_F(AutofillTableTest, SetServerProfileUpdateUsageStats) {
EXPECT_EQ(one.server_id(), outputs[0]->server_id());
EXPECT_EQ(4U, outputs[0]->use_count());
EXPECT_NE(base::Time(), outputs[0]->use_date());
+ EXPECT_EQ(base::Time(), outputs[0]->modification_date());
outputs.clear();
// Setting the profiles again shouldn't delete the usage stats.
@@ -1839,6 +1849,7 @@ TEST_F(AutofillTableTest, SetServerProfileUpdateUsageStats) {
EXPECT_EQ(one.server_id(), outputs[0]->server_id());
EXPECT_EQ(4U, outputs[0]->use_count());
EXPECT_NE(base::Time(), outputs[0]->use_date());
+ EXPECT_EQ(base::Time(), outputs[0]->modification_date());
outputs.clear();
// Set a null profile list --- this should clear metadata.
@@ -1850,6 +1861,7 @@ TEST_F(AutofillTableTest, SetServerProfileUpdateUsageStats) {
EXPECT_EQ(one.server_id(), outputs[0]->server_id());
EXPECT_EQ(0U, outputs[0]->use_count());
EXPECT_EQ(base::Time(), outputs[0]->use_date());
+ EXPECT_EQ(base::Time(), outputs[0]->modification_date());
outputs.clear();
}
« no previous file with comments | « components/autofill/core/browser/webdata/autofill_table.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698