| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 2091 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2102 autofill_manager_->AddSeenForm(form, field_types, field_types); | 2102 autofill_manager_->AddSeenForm(form, field_types, field_types); |
| 2103 | 2103 |
| 2104 // Simulate an Autofill query on a credit card field. | 2104 // Simulate an Autofill query on a credit card field. |
| 2105 { | 2105 { |
| 2106 base::UserActionTester user_action_tester; | 2106 base::UserActionTester user_action_tester; |
| 2107 autofill_manager_->OnQueryFormFieldAutofill(0, form, field, gfx::RectF()); | 2107 autofill_manager_->OnQueryFormFieldAutofill(0, form, field, gfx::RectF()); |
| 2108 EXPECT_EQ(1, user_action_tester.GetActionCount( | 2108 EXPECT_EQ(1, user_action_tester.GetActionCount( |
| 2109 "Autofill_PolledCreditCardSuggestions")); | 2109 "Autofill_PolledCreditCardSuggestions")); |
| 2110 } | 2110 } |
| 2111 | 2111 |
| 2112 // Simulate showing a credit card suggestion. | 2112 // Simulate showing a credit card suggestion polled from "Name on card" field. |
| 2113 { | 2113 { |
| 2114 base::UserActionTester user_action_tester; | 2114 base::UserActionTester user_action_tester; |
| 2115 autofill_manager_->DidShowSuggestions(true /* is_new_popup */, form, field); | 2115 autofill_manager_->DidShowSuggestions(true /* is_new_popup */, form, |
| 2116 form.fields[0]); |
| 2116 EXPECT_EQ(1, user_action_tester.GetActionCount( | 2117 EXPECT_EQ(1, user_action_tester.GetActionCount( |
| 2117 "Autofill_ShowedCreditCardSuggestions")); | 2118 "Autofill_ShowedCreditCardSuggestions")); |
| 2118 } | 2119 } |
| 2120 |
| 2121 // Simulate showing a credit card suggestion polled from "Credit card number" |
| 2122 // field. |
| 2123 { |
| 2124 base::UserActionTester user_action_tester; |
| 2125 autofill_manager_->DidShowSuggestions(true /* is_new_popup */, form, |
| 2126 form.fields[1]); |
| 2127 EXPECT_EQ(1, user_action_tester.GetActionCount( |
| 2128 "Autofill_ShowedCreditCardSuggestions")); |
| 2129 } |
| 2119 | 2130 |
| 2120 // Simulate selecting a credit card suggestions. | 2131 // Simulate selecting a credit card suggestions. |
| 2121 { | 2132 { |
| 2122 base::UserActionTester user_action_tester; | 2133 base::UserActionTester user_action_tester; |
| 2123 std::string guid("10000000-0000-0000-0000-000000000001"); // local card | 2134 std::string guid("10000000-0000-0000-0000-000000000001"); // local card |
| 2124 external_delegate_->DidAcceptSuggestion( | 2135 external_delegate_->DidAcceptSuggestion( |
| 2125 ASCIIToUTF16("Test"), | 2136 ASCIIToUTF16("Test"), |
| 2126 autofill_manager_->MakeFrontendID(guid, std::string()), 0); | 2137 autofill_manager_->MakeFrontendID(guid, std::string()), 0); |
| 2127 EXPECT_EQ(1, | 2138 EXPECT_EQ(1, |
| 2128 user_action_tester.GetActionCount("Autofill_SelectedSuggestion")); | 2139 user_action_tester.GetActionCount("Autofill_SelectedSuggestion")); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 2145 autofill_manager_->OnQueryFormFieldAutofill(0, form, field, gfx::RectF()); | 2156 autofill_manager_->OnQueryFormFieldAutofill(0, form, field, gfx::RectF()); |
| 2146 autofill_manager_->SubmitForm(form, TimeTicks::Now()); | 2157 autofill_manager_->SubmitForm(form, TimeTicks::Now()); |
| 2147 EXPECT_EQ(1, | 2158 EXPECT_EQ(1, |
| 2148 user_action_tester.GetActionCount("Autofill_OnWillSubmitForm")); | 2159 user_action_tester.GetActionCount("Autofill_OnWillSubmitForm")); |
| 2149 EXPECT_EQ(1, user_action_tester.GetActionCount( | 2160 EXPECT_EQ(1, user_action_tester.GetActionCount( |
| 2150 "Autofill_FormSubmitted_NonFillable")); | 2161 "Autofill_FormSubmitted_NonFillable")); |
| 2151 } | 2162 } |
| 2152 | 2163 |
| 2153 VerifyFormInteractionUkm( | 2164 VerifyFormInteractionUkm( |
| 2154 form, ukm_recorder, internal::kUKMSuggestionsShownEntryName, | 2165 form, ukm_recorder, internal::kUKMSuggestionsShownEntryName, |
| 2155 {{{internal::kUKMMillisecondsSinceFormParsedMetricName, 0}}}); | 2166 {{{internal::kUKMMillisecondsSinceFormParsedMetricName, 0}, |
| 2167 {internal::kUKMHeuristicTypeMetricName, CREDIT_CARD_NAME_FULL}, |
| 2168 {internal::kUKMHtmlFieldTypeMetricName, HTML_TYPE_UNSPECIFIED}, |
| 2169 {internal::kUKMServerTypeMetricName, CREDIT_CARD_NAME_FULL}}, |
| 2170 {{internal::kUKMMillisecondsSinceFormParsedMetricName, 0}, |
| 2171 {internal::kUKMHeuristicTypeMetricName, CREDIT_CARD_NUMBER}, |
| 2172 {internal::kUKMHtmlFieldTypeMetricName, HTML_TYPE_UNSPECIFIED}, |
| 2173 {internal::kUKMServerTypeMetricName, CREDIT_CARD_NUMBER}}}); |
| 2156 // Expect 2 |FORM_EVENT_LOCAL_SUGGESTION_FILLED| events. First, from | 2174 // Expect 2 |FORM_EVENT_LOCAL_SUGGESTION_FILLED| events. First, from |
| 2157 // call to |external_delegate_->DidAcceptSuggestion|. Second, from call to | 2175 // call to |external_delegate_->DidAcceptSuggestion|. Second, from call to |
| 2158 // |autofill_manager_->FillOrPreviewForm|. | 2176 // |autofill_manager_->FillOrPreviewForm|. |
| 2159 VerifyFormInteractionUkm( | 2177 VerifyFormInteractionUkm( |
| 2160 form, ukm_recorder, internal::kUKMSuggestionFilledEntryName, | 2178 form, ukm_recorder, internal::kUKMSuggestionFilledEntryName, |
| 2161 {{{internal::kUKMRecordTypeMetricName, CreditCard::LOCAL_CARD}, | 2179 {{{internal::kUKMRecordTypeMetricName, CreditCard::LOCAL_CARD}, |
| 2162 {internal::kUKMMillisecondsSinceFormParsedMetricName, 0}}, | 2180 {internal::kUKMMillisecondsSinceFormParsedMetricName, 0}}, |
| 2163 {{internal::kUKMRecordTypeMetricName, CreditCard::LOCAL_CARD}, | 2181 {{internal::kUKMRecordTypeMetricName, CreditCard::LOCAL_CARD}, |
| 2164 {internal::kUKMMillisecondsSinceFormParsedMetricName, 0}}}); | 2182 {internal::kUKMMillisecondsSinceFormParsedMetricName, 0}}}); |
| 2165 // Expect |NON_FILLABLE_FORM_OR_NEW_DATA| in |AutofillFormSubmittedState| | 2183 // Expect |NON_FILLABLE_FORM_OR_NEW_DATA| in |AutofillFormSubmittedState| |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2198 autofill_manager_->AddSeenForm(form, field_types, field_types); | 2216 autofill_manager_->AddSeenForm(form, field_types, field_types); |
| 2199 | 2217 |
| 2200 // Simulate an Autofill query on a profile field. | 2218 // Simulate an Autofill query on a profile field. |
| 2201 { | 2219 { |
| 2202 base::UserActionTester user_action_tester; | 2220 base::UserActionTester user_action_tester; |
| 2203 autofill_manager_->OnQueryFormFieldAutofill(0, form, field, gfx::RectF()); | 2221 autofill_manager_->OnQueryFormFieldAutofill(0, form, field, gfx::RectF()); |
| 2204 EXPECT_EQ(1, user_action_tester.GetActionCount( | 2222 EXPECT_EQ(1, user_action_tester.GetActionCount( |
| 2205 "Autofill_PolledProfileSuggestions")); | 2223 "Autofill_PolledProfileSuggestions")); |
| 2206 } | 2224 } |
| 2207 | 2225 |
| 2208 // Simulate showing a profile suggestion. | 2226 // Simulate showing a profile suggestion polled from "State" field. |
| 2209 { | 2227 { |
| 2210 base::UserActionTester user_action_tester; | 2228 base::UserActionTester user_action_tester; |
| 2211 autofill_manager_->DidShowSuggestions(true /* is_new_popup */, form, field); | 2229 autofill_manager_->DidShowSuggestions(true /* is_new_popup */, form, |
| 2230 form.fields[0]); |
| 2212 EXPECT_EQ(1, user_action_tester.GetActionCount( | 2231 EXPECT_EQ(1, user_action_tester.GetActionCount( |
| 2213 "Autofill_ShowedProfileSuggestions")); | 2232 "Autofill_ShowedProfileSuggestions")); |
| 2214 } | 2233 } |
| 2234 |
| 2235 // Simulate showing a profile suggestion polled from "City" field. |
| 2236 { |
| 2237 base::UserActionTester user_action_tester; |
| 2238 autofill_manager_->DidShowSuggestions(true /* is_new_popup */, form, |
| 2239 form.fields[1]); |
| 2240 EXPECT_EQ(1, user_action_tester.GetActionCount( |
| 2241 "Autofill_ShowedProfileSuggestions")); |
| 2242 } |
| 2215 | 2243 |
| 2216 // Simulate selecting a profile suggestions. | 2244 // Simulate selecting a profile suggestions. |
| 2217 { | 2245 { |
| 2218 base::UserActionTester user_action_tester; | 2246 base::UserActionTester user_action_tester; |
| 2219 std::string guid("00000000-0000-0000-0000-000000000001"); // local profile. | 2247 std::string guid("00000000-0000-0000-0000-000000000001"); // local profile. |
| 2220 external_delegate_->DidAcceptSuggestion( | 2248 external_delegate_->DidAcceptSuggestion( |
| 2221 ASCIIToUTF16("Test"), | 2249 ASCIIToUTF16("Test"), |
| 2222 autofill_manager_->MakeFrontendID(std::string(), guid), 0); | 2250 autofill_manager_->MakeFrontendID(std::string(), guid), 0); |
| 2223 EXPECT_EQ(1, | 2251 EXPECT_EQ(1, |
| 2224 user_action_tester.GetActionCount("Autofill_SelectedSuggestion")); | 2252 user_action_tester.GetActionCount("Autofill_SelectedSuggestion")); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 2241 autofill_manager_->OnQueryFormFieldAutofill(0, form, field, gfx::RectF()); | 2269 autofill_manager_->OnQueryFormFieldAutofill(0, form, field, gfx::RectF()); |
| 2242 autofill_manager_->SubmitForm(form, TimeTicks::Now()); | 2270 autofill_manager_->SubmitForm(form, TimeTicks::Now()); |
| 2243 EXPECT_EQ(1, | 2271 EXPECT_EQ(1, |
| 2244 user_action_tester.GetActionCount("Autofill_OnWillSubmitForm")); | 2272 user_action_tester.GetActionCount("Autofill_OnWillSubmitForm")); |
| 2245 EXPECT_EQ(1, user_action_tester.GetActionCount( | 2273 EXPECT_EQ(1, user_action_tester.GetActionCount( |
| 2246 "Autofill_FormSubmitted_NonFillable")); | 2274 "Autofill_FormSubmitted_NonFillable")); |
| 2247 } | 2275 } |
| 2248 | 2276 |
| 2249 VerifyFormInteractionUkm( | 2277 VerifyFormInteractionUkm( |
| 2250 form, ukm_recorder, internal::kUKMSuggestionsShownEntryName, | 2278 form, ukm_recorder, internal::kUKMSuggestionsShownEntryName, |
| 2251 {{{internal::kUKMMillisecondsSinceFormParsedMetricName, 0}}}); | 2279 {{{internal::kUKMMillisecondsSinceFormParsedMetricName, 0}, |
| 2280 {internal::kUKMHeuristicTypeMetricName, ADDRESS_HOME_STATE}, |
| 2281 {internal::kUKMHtmlFieldTypeMetricName, HTML_TYPE_UNSPECIFIED}, |
| 2282 {internal::kUKMServerTypeMetricName, ADDRESS_HOME_STATE}}, |
| 2283 {{internal::kUKMMillisecondsSinceFormParsedMetricName, 0}, |
| 2284 {internal::kUKMHeuristicTypeMetricName, ADDRESS_HOME_CITY}, |
| 2285 {internal::kUKMHtmlFieldTypeMetricName, HTML_TYPE_UNSPECIFIED}, |
| 2286 {internal::kUKMServerTypeMetricName, ADDRESS_HOME_CITY}}}); |
| 2252 // Expect 2 |FORM_EVENT_LOCAL_SUGGESTION_FILLED| events. First, from | 2287 // Expect 2 |FORM_EVENT_LOCAL_SUGGESTION_FILLED| events. First, from |
| 2253 // call to |external_delegate_->DidAcceptSuggestion|. Second, from call to | 2288 // call to |external_delegate_->DidAcceptSuggestion|. Second, from call to |
| 2254 // |autofill_manager_->FillOrPreviewForm|. | 2289 // |autofill_manager_->FillOrPreviewForm|. |
| 2255 VerifyFormInteractionUkm( | 2290 VerifyFormInteractionUkm( |
| 2256 form, ukm_recorder, internal::kUKMSuggestionFilledEntryName, | 2291 form, ukm_recorder, internal::kUKMSuggestionFilledEntryName, |
| 2257 {{{internal::kUKMRecordTypeMetricName, AutofillProfile::LOCAL_PROFILE}, | 2292 {{{internal::kUKMRecordTypeMetricName, AutofillProfile::LOCAL_PROFILE}, |
| 2258 {internal::kUKMMillisecondsSinceFormParsedMetricName, 0}}, | 2293 {internal::kUKMMillisecondsSinceFormParsedMetricName, 0}}, |
| 2259 {{internal::kUKMRecordTypeMetricName, AutofillProfile::LOCAL_PROFILE}, | 2294 {{internal::kUKMRecordTypeMetricName, AutofillProfile::LOCAL_PROFILE}, |
| 2260 {internal::kUKMMillisecondsSinceFormParsedMetricName, 0}}}); | 2295 {internal::kUKMMillisecondsSinceFormParsedMetricName, 0}}}); |
| 2261 // Expect |NON_FILLABLE_FORM_OR_NEW_DATA| in |AutofillFormSubmittedState| | 2296 // Expect |NON_FILLABLE_FORM_OR_NEW_DATA| in |AutofillFormSubmittedState| |
| (...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2877 autofill_manager_->SubmitForm(form, TimeTicks::Now()); | 2912 autofill_manager_->SubmitForm(form, TimeTicks::Now()); |
| 2878 histogram_tester.ExpectBucketCount( | 2913 histogram_tester.ExpectBucketCount( |
| 2879 "Autofill.FormEvents.CreditCard", | 2914 "Autofill.FormEvents.CreditCard", |
| 2880 AutofillMetrics::FORM_EVENT_SUGGESTION_SHOWN_SUBMITTED_ONCE, 1); | 2915 AutofillMetrics::FORM_EVENT_SUGGESTION_SHOWN_SUBMITTED_ONCE, 1); |
| 2881 histogram_tester.ExpectBucketCount( | 2916 histogram_tester.ExpectBucketCount( |
| 2882 "Autofill.FormEvents.CreditCard", | 2917 "Autofill.FormEvents.CreditCard", |
| 2883 AutofillMetrics::FORM_EVENT_SUGGESTION_SHOWN_WILL_SUBMIT_ONCE, 1); | 2918 AutofillMetrics::FORM_EVENT_SUGGESTION_SHOWN_WILL_SUBMIT_ONCE, 1); |
| 2884 | 2919 |
| 2885 VerifyFormInteractionUkm( | 2920 VerifyFormInteractionUkm( |
| 2886 form, ukm_recorder, internal::kUKMSuggestionsShownEntryName, | 2921 form, ukm_recorder, internal::kUKMSuggestionsShownEntryName, |
| 2887 {{{internal::kUKMMillisecondsSinceFormParsedMetricName, 0}}}); | 2922 {{{internal::kUKMMillisecondsSinceFormParsedMetricName, 0}, |
| 2888 VerifySubmitFormUkm(form, ukm_recorder, | 2923 {internal::kUKMHeuristicTypeMetricName, CREDIT_CARD_NUMBER}, |
| 2889 AutofillMetrics::NON_FILLABLE_FORM_OR_NEW_DATA); | 2924 {internal::kUKMHtmlFieldTypeMetricName, HTML_TYPE_UNSPECIFIED}, |
| 2925 {internal::kUKMServerTypeMetricName, CREDIT_CARD_NUMBER}}}); |
| 2890 } | 2926 } |
| 2891 | 2927 |
| 2892 // Reset the autofill manager state and purge UKM logs. | 2928 // Reset the autofill manager state and purge UKM logs. |
| 2893 autofill_manager_->Reset(); | 2929 autofill_manager_->Reset(); |
| 2894 ukm_recorder->Purge(); | 2930 ukm_recorder->Purge(); |
| 2895 | 2931 |
| 2896 autofill_manager_->AddSeenForm(form, field_types, field_types); | 2932 autofill_manager_->AddSeenForm(form, field_types, field_types); |
| 2897 | 2933 |
| 2898 { | 2934 { |
| 2899 // Simulating submission with filled local data. | 2935 // Simulating submission with filled local data. |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3102 "Autofill.FormEvents.CreditCard", | 3138 "Autofill.FormEvents.CreditCard", |
| 3103 AutofillMetrics::FORM_EVENT_SERVER_SUGGESTION_WILL_SUBMIT_ONCE, 0); | 3139 AutofillMetrics::FORM_EVENT_SERVER_SUGGESTION_WILL_SUBMIT_ONCE, 0); |
| 3104 histogram_tester.ExpectBucketCount( | 3140 histogram_tester.ExpectBucketCount( |
| 3105 "Autofill.FormEvents.CreditCard", | 3141 "Autofill.FormEvents.CreditCard", |
| 3106 AutofillMetrics:: | 3142 AutofillMetrics:: |
| 3107 FORM_EVENT_MASKED_SERVER_CARD_SUGGESTION_WILL_SUBMIT_ONCE, | 3143 FORM_EVENT_MASKED_SERVER_CARD_SUGGESTION_WILL_SUBMIT_ONCE, |
| 3108 0); | 3144 0); |
| 3109 | 3145 |
| 3110 VerifyFormInteractionUkm( | 3146 VerifyFormInteractionUkm( |
| 3111 form, ukm_recorder, internal::kUKMSuggestionsShownEntryName, | 3147 form, ukm_recorder, internal::kUKMSuggestionsShownEntryName, |
| 3112 {{{internal::kUKMMillisecondsSinceFormParsedMetricName, 0}}}); | 3148 {{{internal::kUKMMillisecondsSinceFormParsedMetricName, 0}, |
| 3113 VerifySubmitFormUkm(form, ukm_recorder, | 3149 {internal::kUKMHeuristicTypeMetricName, CREDIT_CARD_NUMBER}, |
| 3114 AutofillMetrics::NON_FILLABLE_FORM_OR_NEW_DATA); | 3150 {internal::kUKMHtmlFieldTypeMetricName, HTML_TYPE_UNSPECIFIED}, |
| 3151 {internal::kUKMServerTypeMetricName, CREDIT_CARD_NUMBER}}}); |
| 3115 } | 3152 } |
| 3116 } | 3153 } |
| 3117 | 3154 |
| 3118 // Test that we log "will submit" (but not submitted) form events for credit | 3155 // Test that we log "will submit" (but not submitted) form events for credit |
| 3119 // cards. Mirrors CreditCardSubmittedFormEvents test but does not expect any | 3156 // cards. Mirrors CreditCardSubmittedFormEvents test but does not expect any |
| 3120 // "submitted" metrics. | 3157 // "submitted" metrics. |
| 3121 TEST_F(AutofillMetricsTest, CreditCardWillSubmitFormEvents) { | 3158 TEST_F(AutofillMetricsTest, CreditCardWillSubmitFormEvents) { |
| 3122 EnableWalletSync(); | 3159 EnableWalletSync(); |
| 3123 // Creating all kinds of cards. | 3160 // Creating all kinds of cards. |
| 3124 personal_data_->RecreateCreditCards( | 3161 personal_data_->RecreateCreditCards( |
| (...skipping 1060 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4185 base::UserActionTester user_action_tester; | 4222 base::UserActionTester user_action_tester; |
| 4186 autofill_manager_->SubmitForm(form, TimeTicks::Now()); | 4223 autofill_manager_->SubmitForm(form, TimeTicks::Now()); |
| 4187 histogram_tester.ExpectUniqueSample( | 4224 histogram_tester.ExpectUniqueSample( |
| 4188 "Autofill.FormSubmittedState", | 4225 "Autofill.FormSubmittedState", |
| 4189 AutofillMetrics::FILLABLE_FORM_AUTOFILLED_NONE_DID_SHOW_SUGGESTIONS, 1); | 4226 AutofillMetrics::FILLABLE_FORM_AUTOFILLED_NONE_DID_SHOW_SUGGESTIONS, 1); |
| 4190 EXPECT_EQ(1, user_action_tester.GetActionCount( | 4227 EXPECT_EQ(1, user_action_tester.GetActionCount( |
| 4191 "Autofill_FormSubmitted_FilledNone_SuggestionsShown")); | 4228 "Autofill_FormSubmitted_FilledNone_SuggestionsShown")); |
| 4192 | 4229 |
| 4193 VerifyFormInteractionUkm( | 4230 VerifyFormInteractionUkm( |
| 4194 form, ukm_recorder, internal::kUKMSuggestionsShownEntryName, | 4231 form, ukm_recorder, internal::kUKMSuggestionsShownEntryName, |
| 4195 {{{internal::kUKMMillisecondsSinceFormParsedMetricName, 0}}}); | 4232 {{{internal::kUKMMillisecondsSinceFormParsedMetricName, 0}, |
| 4233 {internal::kUKMHeuristicTypeMetricName, PHONE_HOME_WHOLE_NUMBER}, |
| 4234 {internal::kUKMHtmlFieldTypeMetricName, HTML_TYPE_UNSPECIFIED}, |
| 4235 {internal::kUKMServerTypeMetricName, NO_SERVER_DATA}}}); |
| 4196 expected_form_submission_ukm_metrics.push_back( | 4236 expected_form_submission_ukm_metrics.push_back( |
| 4197 {{internal::kUKMAutofillFormSubmittedStateMetricName, | 4237 {{internal::kUKMAutofillFormSubmittedStateMetricName, |
| 4198 AutofillMetrics::FILLABLE_FORM_AUTOFILLED_NONE_DID_SHOW_SUGGESTIONS}, | 4238 AutofillMetrics::FILLABLE_FORM_AUTOFILLED_NONE_DID_SHOW_SUGGESTIONS}, |
| 4199 {internal::kUKMMillisecondsSinceFormParsedMetricName, 0}}); | 4239 {internal::kUKMMillisecondsSinceFormParsedMetricName, 0}}); |
| 4200 VerifyFormInteractionUkm(form, ukm_recorder, | 4240 VerifyFormInteractionUkm(form, ukm_recorder, |
| 4201 internal::kUKMFormSubmittedEntryName, | 4241 internal::kUKMFormSubmittedEntryName, |
| 4202 expected_form_submission_ukm_metrics); | 4242 expected_form_submission_ukm_metrics); |
| 4203 } | 4243 } |
| 4204 | 4244 |
| 4205 // Mark one of the fields as autofilled. | 4245 // Mark one of the fields as autofilled. |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4383 | 4423 |
| 4384 autofill_manager_->Reset(); | 4424 autofill_manager_->Reset(); |
| 4385 | 4425 |
| 4386 VerifyFormInteractionUkm( | 4426 VerifyFormInteractionUkm( |
| 4387 form, ukm_recorder, internal::kUKMInteractedWithFormEntryName, | 4427 form, ukm_recorder, internal::kUKMInteractedWithFormEntryName, |
| 4388 {{{internal::kUKMIsForCreditCardMetricName, false}, | 4428 {{{internal::kUKMIsForCreditCardMetricName, false}, |
| 4389 {internal::kUKMLocalRecordTypeCountMetricName, 0}, | 4429 {internal::kUKMLocalRecordTypeCountMetricName, 0}, |
| 4390 {internal::kUKMServerRecordTypeCountMetricName, 0}}}); | 4430 {internal::kUKMServerRecordTypeCountMetricName, 0}}}); |
| 4391 VerifyFormInteractionUkm( | 4431 VerifyFormInteractionUkm( |
| 4392 form, ukm_recorder, internal::kUKMSuggestionsShownEntryName, | 4432 form, ukm_recorder, internal::kUKMSuggestionsShownEntryName, |
| 4393 {{{internal::kUKMMillisecondsSinceFormParsedMetricName, 0}}, | 4433 {{{internal::kUKMMillisecondsSinceFormParsedMetricName, 0}, |
| 4394 {{internal::kUKMMillisecondsSinceFormParsedMetricName, 0}}}); | 4434 {internal::kUKMHeuristicTypeMetricName, PHONE_HOME_WHOLE_NUMBER}, |
| 4435 {internal::kUKMHtmlFieldTypeMetricName, HTML_TYPE_UNSPECIFIED}, |
| 4436 {internal::kUKMServerTypeMetricName, NO_SERVER_DATA}}, |
| 4437 {{internal::kUKMMillisecondsSinceFormParsedMetricName, 0}, |
| 4438 {internal::kUKMHeuristicTypeMetricName, EMAIL_ADDRESS}, |
| 4439 {internal::kUKMHtmlFieldTypeMetricName, HTML_TYPE_UNSPECIFIED}, |
| 4440 {internal::kUKMServerTypeMetricName, NO_SERVER_DATA}}}); |
| 4395 VerifyFormInteractionUkm( | 4441 VerifyFormInteractionUkm( |
| 4396 form, ukm_recorder, internal::kUKMSuggestionFilledEntryName, | 4442 form, ukm_recorder, internal::kUKMSuggestionFilledEntryName, |
| 4397 {{{internal::kUKMRecordTypeMetricName, AutofillProfile::LOCAL_PROFILE}, | 4443 {{{internal::kUKMRecordTypeMetricName, AutofillProfile::LOCAL_PROFILE}, |
| 4398 {internal::kUKMMillisecondsSinceFormParsedMetricName, 0}}, | 4444 {internal::kUKMMillisecondsSinceFormParsedMetricName, 0}}, |
| 4399 {{internal::kUKMRecordTypeMetricName, AutofillProfile::LOCAL_PROFILE}, | 4445 {{internal::kUKMRecordTypeMetricName, AutofillProfile::LOCAL_PROFILE}, |
| 4400 {internal::kUKMMillisecondsSinceFormParsedMetricName, 0}}}); | 4446 {internal::kUKMMillisecondsSinceFormParsedMetricName, 0}}}); |
| 4401 VerifyFormInteractionUkm( | 4447 VerifyFormInteractionUkm( |
| 4402 form, ukm_recorder, internal::kUKMTextFieldDidChangeEntryName, | 4448 form, ukm_recorder, internal::kUKMTextFieldDidChangeEntryName, |
| 4403 {{{internal::kUKMFieldTypeGroupMetricName, NAME}, | 4449 {{{internal::kUKMFieldTypeGroupMetricName, NAME}, |
| 4404 {internal::kUKMHeuristicTypeMetricName, NAME_FULL}, | 4450 {internal::kUKMHeuristicTypeMetricName, NAME_FULL}, |
| (...skipping 688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5093 TEST_F(AutofillMetricsTest, RecordCardUploadDecisionMetric_NoUkmService) { | 5139 TEST_F(AutofillMetricsTest, RecordCardUploadDecisionMetric_NoUkmService) { |
| 5094 ukm::TestUkmRecorder test_ukm_recorder; | 5140 ukm::TestUkmRecorder test_ukm_recorder; |
| 5095 GURL url("https://www.google.com"); | 5141 GURL url("https://www.google.com"); |
| 5096 std::vector<std::pair<const char*, int>> metrics = {{"metric", 1}}; | 5142 std::vector<std::pair<const char*, int>> metrics = {{"metric", 1}}; |
| 5097 | 5143 |
| 5098 EXPECT_FALSE(AutofillMetrics::LogUkm(nullptr, url, "test_ukm", metrics)); | 5144 EXPECT_FALSE(AutofillMetrics::LogUkm(nullptr, url, "test_ukm", metrics)); |
| 5099 ASSERT_EQ(0U, test_ukm_recorder.sources_count()); | 5145 ASSERT_EQ(0U, test_ukm_recorder.sources_count()); |
| 5100 } | 5146 } |
| 5101 | 5147 |
| 5102 } // namespace autofill | 5148 } // namespace autofill |
| OLD | NEW |