OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "components/autofill/core/browser/autofill_metrics.h" | 5 #include "components/autofill/core/browser/autofill_metrics.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
(...skipping 1168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1179 | 1179 |
1180 { | 1180 { |
1181 // Simulating filling a masked card server suggestion. | 1181 // Simulating filling a masked card server suggestion. |
1182 base::HistogramTester histogram_tester; | 1182 base::HistogramTester histogram_tester; |
1183 SuggestionBackendID guid( | 1183 SuggestionBackendID guid( |
1184 "10000000-0000-0000-0000-000000000002", 0); // masked server card | 1184 "10000000-0000-0000-0000-000000000002", 0); // masked server card |
1185 autofill_manager_->FillOrPreviewForm( | 1185 autofill_manager_->FillOrPreviewForm( |
1186 AutofillDriver::FORM_DATA_ACTION_FILL, | 1186 AutofillDriver::FORM_DATA_ACTION_FILL, |
1187 0, form, form.fields.front(), | 1187 0, form, form.fields.front(), |
1188 autofill_manager_->MakeFrontendID(guid, SuggestionBackendID())); | 1188 autofill_manager_->MakeFrontendID(guid, SuggestionBackendID())); |
1189 autofill_manager_->OnDidGetRealPan("6011000990139424"); | 1189 autofill_manager_->OnDidGetRealPan(AutofillClient::SUCCESS, |
| 1190 "6011000990139424"); |
1190 histogram_tester.ExpectBucketCount( | 1191 histogram_tester.ExpectBucketCount( |
1191 "Autofill.FormEvents.CreditCard", | 1192 "Autofill.FormEvents.CreditCard", |
1192 AutofillMetrics::FORM_EVENT_MASKED_SERVER_CARD_SUGGESTION_FILLED, 1); | 1193 AutofillMetrics::FORM_EVENT_MASKED_SERVER_CARD_SUGGESTION_FILLED, 1); |
1193 histogram_tester.ExpectBucketCount( | 1194 histogram_tester.ExpectBucketCount( |
1194 "Autofill.FormEvents.CreditCard", | 1195 "Autofill.FormEvents.CreditCard", |
1195 AutofillMetrics::FORM_EVENT_MASKED_SERVER_CARD_SUGGESTION_FILLED_ONCE, | 1196 AutofillMetrics::FORM_EVENT_MASKED_SERVER_CARD_SUGGESTION_FILLED_ONCE, |
1196 1); | 1197 1); |
1197 } | 1198 } |
1198 | 1199 |
1199 // Recreating cards as the previous test should have upgraded the masked | 1200 // Recreating cards as the previous test should have upgraded the masked |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1341 | 1342 |
1342 { | 1343 { |
1343 // Simulating submission with a masked card server suggestion. | 1344 // Simulating submission with a masked card server suggestion. |
1344 base::HistogramTester histogram_tester; | 1345 base::HistogramTester histogram_tester; |
1345 SuggestionBackendID guid( | 1346 SuggestionBackendID guid( |
1346 "10000000-0000-0000-0000-000000000002", 0); // masked server card | 1347 "10000000-0000-0000-0000-000000000002", 0); // masked server card |
1347 autofill_manager_->FillOrPreviewForm( | 1348 autofill_manager_->FillOrPreviewForm( |
1348 AutofillDriver::FORM_DATA_ACTION_FILL, | 1349 AutofillDriver::FORM_DATA_ACTION_FILL, |
1349 0, form, form.fields.front(), | 1350 0, form, form.fields.front(), |
1350 autofill_manager_->MakeFrontendID(guid, SuggestionBackendID())); | 1351 autofill_manager_->MakeFrontendID(guid, SuggestionBackendID())); |
1351 autofill_manager_->OnDidGetRealPan("6011000990139424"); | 1352 autofill_manager_->OnDidGetRealPan(AutofillClient::SUCCESS, |
| 1353 "6011000990139424"); |
1352 histogram_tester.ExpectBucketCount( | 1354 histogram_tester.ExpectBucketCount( |
1353 "Autofill.FormEvents.CreditCard", | 1355 "Autofill.FormEvents.CreditCard", |
1354 AutofillMetrics::FORM_EVENT_MASKED_SERVER_CARD_SUGGESTION_FILLED, 1); | 1356 AutofillMetrics::FORM_EVENT_MASKED_SERVER_CARD_SUGGESTION_FILLED, 1); |
1355 histogram_tester.ExpectBucketCount( | 1357 histogram_tester.ExpectBucketCount( |
1356 "Autofill.FormEvents.CreditCard", | 1358 "Autofill.FormEvents.CreditCard", |
1357 AutofillMetrics::FORM_EVENT_MASKED_SERVER_CARD_SUGGESTION_FILLED_ONCE, | 1359 AutofillMetrics::FORM_EVENT_MASKED_SERVER_CARD_SUGGESTION_FILLED_ONCE, |
1358 1); | 1360 1); |
1359 } | 1361 } |
1360 | 1362 |
1361 // Recreating cards as the previous test should have upgraded the masked | 1363 // Recreating cards as the previous test should have upgraded the masked |
(...skipping 1013 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2375 histogram_tester.ExpectTotalCount( | 2377 histogram_tester.ExpectTotalCount( |
2376 "Autofill.FillDuration.FromInteraction.WithAutofill", 0); | 2378 "Autofill.FillDuration.FromInteraction.WithAutofill", 0); |
2377 histogram_tester.ExpectTotalCount( | 2379 histogram_tester.ExpectTotalCount( |
2378 "Autofill.FillDuration.FromInteraction.WithoutAutofill", 0); | 2380 "Autofill.FillDuration.FromInteraction.WithoutAutofill", 0); |
2379 | 2381 |
2380 autofill_manager_->Reset(); | 2382 autofill_manager_->Reset(); |
2381 } | 2383 } |
2382 } | 2384 } |
2383 | 2385 |
2384 } // namespace autofill | 2386 } // namespace autofill |
OLD | NEW |