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

Unified Diff: components/autofill/core/browser/autofill_metrics_unittest.cc

Issue 1839583003: [Autofill] Log the number of stored local credit cards (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed comments Created 4 years, 9 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/autofill_metrics_unittest.cc
diff --git a/components/autofill/core/browser/autofill_metrics_unittest.cc b/components/autofill/core/browser/autofill_metrics_unittest.cc
index 15ac6e8fd7e42ecb21ed1cd465e1d010594830ca..8c21c2e2470a6073f16069bfbf9e23cc7268f91c 100644
--- a/components/autofill/core/browser/autofill_metrics_unittest.cc
+++ b/components/autofill/core/browser/autofill_metrics_unittest.cc
@@ -1374,6 +1374,30 @@ TEST_F(AutofillMetricsTest, StoredProfileCount) {
}
}
+// Test that the local credit card count is logged correctly.
+TEST_F(AutofillMetricsTest, StoredLocalCreditCardCount) {
+ // The metric should be logged when the credit cards are first loaded.
+ {
+ base::HistogramTester histogram_tester;
+ personal_data_->RecreateCreditCards(
+ true /* include_local_credit_card */,
+ false /* include_masked_server_credit_card */,
+ false /* include_full_server_credit_card */);
+ histogram_tester.ExpectUniqueSample("Autofill.StoredLocalCreditCardCount",
+ 1, 1);
+ }
+
+ // The metric should only be logged once.
+ {
+ base::HistogramTester histogram_tester;
+ personal_data_->RecreateCreditCards(
+ true /* include_local_credit_card */,
+ false /* include_masked_server_credit_card */,
+ false /* include_full_server_credit_card */);
+ histogram_tester.ExpectTotalCount("Autofill.StoredLocalCreditCardCount", 0);
+ }
+}
+
// Test that we correctly log when Autofill is enabled.
TEST_F(AutofillMetricsTest, AutofillIsEnabledAtStartup) {
base::HistogramTester histogram_tester;
« no previous file with comments | « components/autofill/core/browser/autofill_metrics.cc ('k') | components/autofill/core/browser/personal_data_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698