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

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

Issue 1891903002: [Autofill] Set basic information when adding a new profiles and credit cards. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed test that was added in rebase and removed unnecessary test. Created 4 years, 8 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/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 0152b15471ee97363b0b4f76b5c19c0aa30a316c..78a1a11c307c14640b2a7d597c76d4f16cd668b9 100644
--- a/components/autofill/core/browser/webdata/autofill_table_unittest.cc
+++ b/components/autofill/core/browser/webdata/autofill_table_unittest.cc
@@ -1738,19 +1738,19 @@ TEST_F(AutofillTableTest, SetServerCardUpdateUsageStats) {
table_->GetServerCreditCards(&outputs.get());
ASSERT_EQ(1u, outputs.size());
EXPECT_EQ(masked_card.server_id(), outputs[0]->server_id());
- EXPECT_EQ(0U, outputs[0]->use_count());
- EXPECT_EQ(base::Time(), outputs[0]->use_date());
+ EXPECT_EQ(1U, outputs[0]->use_count());
+ EXPECT_NE(base::Time(), outputs[0]->use_date());
outputs.clear();
// Update the usage stats; make sure they're reflected in GetServerProfiles.
inputs.back().set_use_count(4U);
- inputs.back().set_use_date(base::Time::Now());
+ inputs.back().set_use_date(base::Time());
table_->UpdateServerCardUsageStats(inputs.back());
table_->GetServerCreditCards(&outputs.get());
ASSERT_EQ(1u, outputs.size());
EXPECT_EQ(masked_card.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]->use_date());
outputs.clear();
// Setting the cards again shouldn't delete the usage stats.
@@ -1759,7 +1759,7 @@ TEST_F(AutofillTableTest, SetServerCardUpdateUsageStats) {
ASSERT_EQ(1u, outputs.size());
EXPECT_EQ(masked_card.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]->use_date());
outputs.clear();
// Set a card list where the card is missing --- this should clear metadata.
@@ -1773,8 +1773,8 @@ TEST_F(AutofillTableTest, SetServerCardUpdateUsageStats) {
table_->GetServerCreditCards(&outputs.get());
ASSERT_EQ(1u, outputs.size());
EXPECT_EQ(masked_card.server_id(), outputs[0]->server_id());
- EXPECT_EQ(0U, outputs[0]->use_count());
- EXPECT_EQ(base::Time(), outputs[0]->use_date());
+ EXPECT_EQ(1U, outputs[0]->use_count());
+ EXPECT_NE(base::Time(), outputs[0]->use_date());
outputs.clear();
}

Powered by Google App Engine
This is Rietveld 408576698