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

Side by Side Diff: components/autofill/core/browser/autofill_metrics_unittest.cc

Issue 772253003: Create an autofill Suggestion class (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge Created 6 years 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 unified diff | Download patch
OLDNEW
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 875 matching lines...) Expand 10 before | Expand all | Expand 10 after
886 autofill_manager_->OnDidFillAutofillFormData(TimeTicks()); 886 autofill_manager_->OnDidFillAutofillFormData(TimeTicks());
887 histogram_tester.ExpectBucketCount("Autofill.UserHappiness", 887 histogram_tester.ExpectBucketCount("Autofill.UserHappiness",
888 AutofillMetrics::USER_DID_AUTOFILL, 1); 888 AutofillMetrics::USER_DID_AUTOFILL, 1);
889 histogram_tester.ExpectBucketCount( 889 histogram_tester.ExpectBucketCount(
890 "Autofill.UserHappiness", AutofillMetrics::USER_DID_AUTOFILL_ONCE, 1); 890 "Autofill.UserHappiness", AutofillMetrics::USER_DID_AUTOFILL_ONCE, 1);
891 } 891 }
892 892
893 // Simulate editing an autofilled field. 893 // Simulate editing an autofilled field.
894 { 894 {
895 base::HistogramTester histogram_tester; 895 base::HistogramTester histogram_tester;
896 PersonalDataManager::GUIDPair guid( 896 SuggestionBackendID guid(
897 "00000000-0000-0000-0000-000000000001", 0); 897 "00000000-0000-0000-0000-000000000001", 0);
898 PersonalDataManager::GUIDPair empty(std::string(), 0);
899 autofill_manager_->FillOrPreviewForm( 898 autofill_manager_->FillOrPreviewForm(
900 AutofillDriver::FORM_DATA_ACTION_FILL, 899 AutofillDriver::FORM_DATA_ACTION_FILL,
901 0, form, form.fields.front(), 900 0, form, form.fields.front(),
902 autofill_manager_->PackGUIDs(empty, guid)); 901 autofill_manager_->MakeFrontendID(SuggestionBackendID(), guid));
903 autofill_manager_->OnTextFieldDidChange(form, form.fields.front(), 902 autofill_manager_->OnTextFieldDidChange(form, form.fields.front(),
904 TimeTicks()); 903 TimeTicks());
905 // Simulate a second keystroke; make sure we don't log the metric twice. 904 // Simulate a second keystroke; make sure we don't log the metric twice.
906 autofill_manager_->OnTextFieldDidChange(form, form.fields.front(), 905 autofill_manager_->OnTextFieldDidChange(form, form.fields.front(),
907 TimeTicks()); 906 TimeTicks());
908 histogram_tester.ExpectBucketCount( 907 histogram_tester.ExpectBucketCount(
909 "Autofill.UserHappiness", 908 "Autofill.UserHappiness",
910 AutofillMetrics::USER_DID_EDIT_AUTOFILLED_FIELD, 1); 909 AutofillMetrics::USER_DID_EDIT_AUTOFILLED_FIELD, 1);
911 histogram_tester.ExpectBucketCount( 910 histogram_tester.ExpectBucketCount(
912 "Autofill.UserHappiness", 911 "Autofill.UserHappiness",
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
1095 histogram_tester.ExpectTotalCount( 1094 histogram_tester.ExpectTotalCount(
1096 "Autofill.FillDuration.FromInteraction.WithAutofill", 0); 1095 "Autofill.FillDuration.FromInteraction.WithAutofill", 0);
1097 histogram_tester.ExpectTotalCount( 1096 histogram_tester.ExpectTotalCount(
1098 "Autofill.FillDuration.FromInteraction.WithoutAutofill", 0); 1097 "Autofill.FillDuration.FromInteraction.WithoutAutofill", 0);
1099 1098
1100 autofill_manager_->Reset(); 1099 autofill_manager_->Reset();
1101 } 1100 }
1102 } 1101 }
1103 1102
1104 } // namespace autofill 1103 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698