| 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;
|
|
|