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 2084 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2095 autofill_manager_->AddSeenForm(form, field_types, field_types); | 2095 autofill_manager_->AddSeenForm(form, field_types, field_types); |
2096 | 2096 |
2097 // Simulate an Autofill query on a credit card field. | 2097 // Simulate an Autofill query on a credit card field. |
2098 { | 2098 { |
2099 base::UserActionTester user_action_tester; | 2099 base::UserActionTester user_action_tester; |
2100 autofill_manager_->OnQueryFormFieldAutofill(0, form, field, gfx::RectF()); | 2100 autofill_manager_->OnQueryFormFieldAutofill(0, form, field, gfx::RectF()); |
2101 EXPECT_EQ(1, user_action_tester.GetActionCount( | 2101 EXPECT_EQ(1, user_action_tester.GetActionCount( |
2102 "Autofill_PolledCreditCardSuggestions")); | 2102 "Autofill_PolledCreditCardSuggestions")); |
2103 } | 2103 } |
2104 | 2104 |
2105 // Simulate showing a credit card suggestion. | 2105 // Simulate showing a credit card suggestion polled from "Name on card" field. |
2106 { | 2106 { |
2107 base::UserActionTester user_action_tester; | 2107 base::UserActionTester user_action_tester; |
2108 autofill_manager_->DidShowSuggestions(true /* is_new_popup */, form, field); | 2108 autofill_manager_->DidShowSuggestions(true /* is_new_popup */, form, |
| 2109 form.fields[0]); |
2109 EXPECT_EQ(1, user_action_tester.GetActionCount( | 2110 EXPECT_EQ(1, user_action_tester.GetActionCount( |
2110 "Autofill_ShowedCreditCardSuggestions")); | 2111 "Autofill_ShowedCreditCardSuggestions")); |
2111 } | 2112 } |
| 2113 |
| 2114 // Simulate showing a credit card suggestion polled from "Credit card number" |
| 2115 // field. |
| 2116 { |
| 2117 base::UserActionTester user_action_tester; |
| 2118 autofill_manager_->DidShowSuggestions(true /* is_new_popup */, form, |
| 2119 form.fields[1]); |
| 2120 EXPECT_EQ(1, user_action_tester.GetActionCount( |
| 2121 "Autofill_ShowedCreditCardSuggestions")); |
| 2122 } |
2112 | 2123 |
2113 // Simulate selecting a credit card suggestions. | 2124 // Simulate selecting a credit card suggestions. |
2114 { | 2125 { |
2115 base::UserActionTester user_action_tester; | 2126 base::UserActionTester user_action_tester; |
2116 std::string guid("10000000-0000-0000-0000-000000000001"); // local card | 2127 std::string guid("10000000-0000-0000-0000-000000000001"); // local card |
2117 external_delegate_->DidAcceptSuggestion( | 2128 external_delegate_->DidAcceptSuggestion( |
2118 ASCIIToUTF16("Test"), | 2129 ASCIIToUTF16("Test"), |
2119 autofill_manager_->MakeFrontendID(guid, std::string()), 0); | 2130 autofill_manager_->MakeFrontendID(guid, std::string()), 0); |
2120 EXPECT_EQ(1, | 2131 EXPECT_EQ(1, |
2121 user_action_tester.GetActionCount("Autofill_SelectedSuggestion")); | 2132 user_action_tester.GetActionCount("Autofill_SelectedSuggestion")); |
(...skipping 16 matching lines...) Expand all Loading... |
2138 autofill_manager_->OnQueryFormFieldAutofill(0, form, field, gfx::RectF()); | 2149 autofill_manager_->OnQueryFormFieldAutofill(0, form, field, gfx::RectF()); |
2139 autofill_manager_->SubmitForm(form, TimeTicks::Now()); | 2150 autofill_manager_->SubmitForm(form, TimeTicks::Now()); |
2140 EXPECT_EQ(1, | 2151 EXPECT_EQ(1, |
2141 user_action_tester.GetActionCount("Autofill_OnWillSubmitForm")); | 2152 user_action_tester.GetActionCount("Autofill_OnWillSubmitForm")); |
2142 EXPECT_EQ(1, user_action_tester.GetActionCount( | 2153 EXPECT_EQ(1, user_action_tester.GetActionCount( |
2143 "Autofill_FormSubmitted_NonFillable")); | 2154 "Autofill_FormSubmitted_NonFillable")); |
2144 } | 2155 } |
2145 | 2156 |
2146 VerifyFormInteractionUkm( | 2157 VerifyFormInteractionUkm( |
2147 form, &test_ukm_recorder_, internal::kUKMSuggestionsShownEntryName, | 2158 form, &test_ukm_recorder_, internal::kUKMSuggestionsShownEntryName, |
2148 {{{internal::kUKMMillisecondsSinceFormParsedMetricName, 0}}}); | 2159 {{{internal::kUKMMillisecondsSinceFormParsedMetricName, 0}, |
| 2160 {internal::kUKMHeuristicTypeMetricName, CREDIT_CARD_NAME_FULL}, |
| 2161 {internal::kUKMHtmlFieldTypeMetricName, HTML_TYPE_UNSPECIFIED}, |
| 2162 {internal::kUKMServerTypeMetricName, CREDIT_CARD_NAME_FULL}}, |
| 2163 {{internal::kUKMMillisecondsSinceFormParsedMetricName, 0}, |
| 2164 {internal::kUKMHeuristicTypeMetricName, CREDIT_CARD_NUMBER}, |
| 2165 {internal::kUKMHtmlFieldTypeMetricName, HTML_TYPE_UNSPECIFIED}, |
| 2166 {internal::kUKMServerTypeMetricName, CREDIT_CARD_NUMBER}}}); |
2149 // Expect 2 |FORM_EVENT_LOCAL_SUGGESTION_FILLED| events. First, from | 2167 // Expect 2 |FORM_EVENT_LOCAL_SUGGESTION_FILLED| events. First, from |
2150 // call to |external_delegate_->DidAcceptSuggestion|. Second, from call to | 2168 // call to |external_delegate_->DidAcceptSuggestion|. Second, from call to |
2151 // |autofill_manager_->FillOrPreviewForm|. | 2169 // |autofill_manager_->FillOrPreviewForm|. |
2152 VerifyFormInteractionUkm( | 2170 VerifyFormInteractionUkm( |
2153 form, &test_ukm_recorder_, internal::kUKMSuggestionFilledEntryName, | 2171 form, &test_ukm_recorder_, internal::kUKMSuggestionFilledEntryName, |
2154 {{{internal::kUKMRecordTypeMetricName, CreditCard::LOCAL_CARD}, | 2172 {{{internal::kUKMRecordTypeMetricName, CreditCard::LOCAL_CARD}, |
2155 {internal::kUKMMillisecondsSinceFormParsedMetricName, 0}}, | 2173 {internal::kUKMMillisecondsSinceFormParsedMetricName, 0}}, |
2156 {{internal::kUKMRecordTypeMetricName, CreditCard::LOCAL_CARD}, | 2174 {{internal::kUKMRecordTypeMetricName, CreditCard::LOCAL_CARD}, |
2157 {internal::kUKMMillisecondsSinceFormParsedMetricName, 0}}}); | 2175 {internal::kUKMMillisecondsSinceFormParsedMetricName, 0}}}); |
2158 // Expect |NON_FILLABLE_FORM_OR_NEW_DATA| in |AutofillFormSubmittedState| | 2176 // Expect |NON_FILLABLE_FORM_OR_NEW_DATA| in |AutofillFormSubmittedState| |
(...skipping 30 matching lines...) Expand all Loading... |
2189 autofill_manager_->AddSeenForm(form, field_types, field_types); | 2207 autofill_manager_->AddSeenForm(form, field_types, field_types); |
2190 | 2208 |
2191 // Simulate an Autofill query on a profile field. | 2209 // Simulate an Autofill query on a profile field. |
2192 { | 2210 { |
2193 base::UserActionTester user_action_tester; | 2211 base::UserActionTester user_action_tester; |
2194 autofill_manager_->OnQueryFormFieldAutofill(0, form, field, gfx::RectF()); | 2212 autofill_manager_->OnQueryFormFieldAutofill(0, form, field, gfx::RectF()); |
2195 EXPECT_EQ(1, user_action_tester.GetActionCount( | 2213 EXPECT_EQ(1, user_action_tester.GetActionCount( |
2196 "Autofill_PolledProfileSuggestions")); | 2214 "Autofill_PolledProfileSuggestions")); |
2197 } | 2215 } |
2198 | 2216 |
2199 // Simulate showing a profile suggestion. | 2217 // Simulate showing a profile suggestion polled from "State" field. |
2200 { | 2218 { |
2201 base::UserActionTester user_action_tester; | 2219 base::UserActionTester user_action_tester; |
2202 autofill_manager_->DidShowSuggestions(true /* is_new_popup */, form, field); | 2220 autofill_manager_->DidShowSuggestions(true /* is_new_popup */, form, |
| 2221 form.fields[0]); |
2203 EXPECT_EQ(1, user_action_tester.GetActionCount( | 2222 EXPECT_EQ(1, user_action_tester.GetActionCount( |
2204 "Autofill_ShowedProfileSuggestions")); | 2223 "Autofill_ShowedProfileSuggestions")); |
2205 } | 2224 } |
| 2225 |
| 2226 // Simulate showing a profile suggestion polled from "City" field. |
| 2227 { |
| 2228 base::UserActionTester user_action_tester; |
| 2229 autofill_manager_->DidShowSuggestions(true /* is_new_popup */, form, |
| 2230 form.fields[1]); |
| 2231 EXPECT_EQ(1, user_action_tester.GetActionCount( |
| 2232 "Autofill_ShowedProfileSuggestions")); |
| 2233 } |
2206 | 2234 |
2207 // Simulate selecting a profile suggestions. | 2235 // Simulate selecting a profile suggestions. |
2208 { | 2236 { |
2209 base::UserActionTester user_action_tester; | 2237 base::UserActionTester user_action_tester; |
2210 std::string guid("00000000-0000-0000-0000-000000000001"); // local profile. | 2238 std::string guid("00000000-0000-0000-0000-000000000001"); // local profile. |
2211 external_delegate_->DidAcceptSuggestion( | 2239 external_delegate_->DidAcceptSuggestion( |
2212 ASCIIToUTF16("Test"), | 2240 ASCIIToUTF16("Test"), |
2213 autofill_manager_->MakeFrontendID(std::string(), guid), 0); | 2241 autofill_manager_->MakeFrontendID(std::string(), guid), 0); |
2214 EXPECT_EQ(1, | 2242 EXPECT_EQ(1, |
2215 user_action_tester.GetActionCount("Autofill_SelectedSuggestion")); | 2243 user_action_tester.GetActionCount("Autofill_SelectedSuggestion")); |
(...skipping 16 matching lines...) Expand all Loading... |
2232 autofill_manager_->OnQueryFormFieldAutofill(0, form, field, gfx::RectF()); | 2260 autofill_manager_->OnQueryFormFieldAutofill(0, form, field, gfx::RectF()); |
2233 autofill_manager_->SubmitForm(form, TimeTicks::Now()); | 2261 autofill_manager_->SubmitForm(form, TimeTicks::Now()); |
2234 EXPECT_EQ(1, | 2262 EXPECT_EQ(1, |
2235 user_action_tester.GetActionCount("Autofill_OnWillSubmitForm")); | 2263 user_action_tester.GetActionCount("Autofill_OnWillSubmitForm")); |
2236 EXPECT_EQ(1, user_action_tester.GetActionCount( | 2264 EXPECT_EQ(1, user_action_tester.GetActionCount( |
2237 "Autofill_FormSubmitted_NonFillable")); | 2265 "Autofill_FormSubmitted_NonFillable")); |
2238 } | 2266 } |
2239 | 2267 |
2240 VerifyFormInteractionUkm( | 2268 VerifyFormInteractionUkm( |
2241 form, &test_ukm_recorder_, internal::kUKMSuggestionsShownEntryName, | 2269 form, &test_ukm_recorder_, internal::kUKMSuggestionsShownEntryName, |
2242 {{{internal::kUKMMillisecondsSinceFormParsedMetricName, 0}}}); | 2270 {{{internal::kUKMMillisecondsSinceFormParsedMetricName, 0}, |
| 2271 {internal::kUKMHeuristicTypeMetricName, ADDRESS_HOME_STATE}, |
| 2272 {internal::kUKMHtmlFieldTypeMetricName, HTML_TYPE_UNSPECIFIED}, |
| 2273 {internal::kUKMServerTypeMetricName, ADDRESS_HOME_STATE}}, |
| 2274 {{internal::kUKMMillisecondsSinceFormParsedMetricName, 0}, |
| 2275 {internal::kUKMHeuristicTypeMetricName, ADDRESS_HOME_CITY}, |
| 2276 {internal::kUKMHtmlFieldTypeMetricName, HTML_TYPE_UNSPECIFIED}, |
| 2277 {internal::kUKMServerTypeMetricName, ADDRESS_HOME_CITY}}}); |
2243 // Expect 2 |FORM_EVENT_LOCAL_SUGGESTION_FILLED| events. First, from | 2278 // Expect 2 |FORM_EVENT_LOCAL_SUGGESTION_FILLED| events. First, from |
2244 // call to |external_delegate_->DidAcceptSuggestion|. Second, from call to | 2279 // call to |external_delegate_->DidAcceptSuggestion|. Second, from call to |
2245 // |autofill_manager_->FillOrPreviewForm|. | 2280 // |autofill_manager_->FillOrPreviewForm|. |
2246 VerifyFormInteractionUkm( | 2281 VerifyFormInteractionUkm( |
2247 form, &test_ukm_recorder_, internal::kUKMSuggestionFilledEntryName, | 2282 form, &test_ukm_recorder_, internal::kUKMSuggestionFilledEntryName, |
2248 {{{internal::kUKMRecordTypeMetricName, AutofillProfile::LOCAL_PROFILE}, | 2283 {{{internal::kUKMRecordTypeMetricName, AutofillProfile::LOCAL_PROFILE}, |
2249 {internal::kUKMMillisecondsSinceFormParsedMetricName, 0}}, | 2284 {internal::kUKMMillisecondsSinceFormParsedMetricName, 0}}, |
2250 {{internal::kUKMRecordTypeMetricName, AutofillProfile::LOCAL_PROFILE}, | 2285 {{internal::kUKMRecordTypeMetricName, AutofillProfile::LOCAL_PROFILE}, |
2251 {internal::kUKMMillisecondsSinceFormParsedMetricName, 0}}}); | 2286 {internal::kUKMMillisecondsSinceFormParsedMetricName, 0}}}); |
2252 // Expect |NON_FILLABLE_FORM_OR_NEW_DATA| in |AutofillFormSubmittedState| | 2287 // Expect |NON_FILLABLE_FORM_OR_NEW_DATA| in |AutofillFormSubmittedState| |
(...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2866 autofill_manager_->SubmitForm(form, TimeTicks::Now()); | 2901 autofill_manager_->SubmitForm(form, TimeTicks::Now()); |
2867 histogram_tester.ExpectBucketCount( | 2902 histogram_tester.ExpectBucketCount( |
2868 "Autofill.FormEvents.CreditCard", | 2903 "Autofill.FormEvents.CreditCard", |
2869 AutofillMetrics::FORM_EVENT_SUGGESTION_SHOWN_SUBMITTED_ONCE, 1); | 2904 AutofillMetrics::FORM_EVENT_SUGGESTION_SHOWN_SUBMITTED_ONCE, 1); |
2870 histogram_tester.ExpectBucketCount( | 2905 histogram_tester.ExpectBucketCount( |
2871 "Autofill.FormEvents.CreditCard", | 2906 "Autofill.FormEvents.CreditCard", |
2872 AutofillMetrics::FORM_EVENT_SUGGESTION_SHOWN_WILL_SUBMIT_ONCE, 1); | 2907 AutofillMetrics::FORM_EVENT_SUGGESTION_SHOWN_WILL_SUBMIT_ONCE, 1); |
2873 | 2908 |
2874 VerifyFormInteractionUkm( | 2909 VerifyFormInteractionUkm( |
2875 form, &test_ukm_recorder_, internal::kUKMSuggestionsShownEntryName, | 2910 form, &test_ukm_recorder_, internal::kUKMSuggestionsShownEntryName, |
2876 {{{internal::kUKMMillisecondsSinceFormParsedMetricName, 0}}}); | 2911 {{{internal::kUKMMillisecondsSinceFormParsedMetricName, 0}, |
| 2912 {internal::kUKMHeuristicTypeMetricName, CREDIT_CARD_NUMBER}, |
| 2913 {internal::kUKMHtmlFieldTypeMetricName, HTML_TYPE_UNSPECIFIED}, |
| 2914 {internal::kUKMServerTypeMetricName, CREDIT_CARD_NUMBER}}}); |
2877 VerifySubmitFormUkm(form, &test_ukm_recorder_, | 2915 VerifySubmitFormUkm(form, &test_ukm_recorder_, |
2878 AutofillMetrics::NON_FILLABLE_FORM_OR_NEW_DATA); | 2916 AutofillMetrics::NON_FILLABLE_FORM_OR_NEW_DATA); |
2879 } | 2917 } |
2880 | 2918 |
2881 // Reset the autofill manager state and purge UKM logs. | 2919 // Reset the autofill manager state and purge UKM logs. |
2882 autofill_manager_->Reset(); | 2920 autofill_manager_->Reset(); |
2883 test_ukm_recorder_.Purge(); | 2921 test_ukm_recorder_.Purge(); |
2884 | 2922 |
2885 autofill_manager_->AddSeenForm(form, field_types, field_types); | 2923 autofill_manager_->AddSeenForm(form, field_types, field_types); |
2886 | 2924 |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3092 "Autofill.FormEvents.CreditCard", | 3130 "Autofill.FormEvents.CreditCard", |
3093 AutofillMetrics::FORM_EVENT_SERVER_SUGGESTION_WILL_SUBMIT_ONCE, 0); | 3131 AutofillMetrics::FORM_EVENT_SERVER_SUGGESTION_WILL_SUBMIT_ONCE, 0); |
3094 histogram_tester.ExpectBucketCount( | 3132 histogram_tester.ExpectBucketCount( |
3095 "Autofill.FormEvents.CreditCard", | 3133 "Autofill.FormEvents.CreditCard", |
3096 AutofillMetrics:: | 3134 AutofillMetrics:: |
3097 FORM_EVENT_MASKED_SERVER_CARD_SUGGESTION_WILL_SUBMIT_ONCE, | 3135 FORM_EVENT_MASKED_SERVER_CARD_SUGGESTION_WILL_SUBMIT_ONCE, |
3098 0); | 3136 0); |
3099 | 3137 |
3100 VerifyFormInteractionUkm( | 3138 VerifyFormInteractionUkm( |
3101 form, &test_ukm_recorder_, internal::kUKMSuggestionsShownEntryName, | 3139 form, &test_ukm_recorder_, internal::kUKMSuggestionsShownEntryName, |
3102 {{{internal::kUKMMillisecondsSinceFormParsedMetricName, 0}}}); | 3140 {{{internal::kUKMMillisecondsSinceFormParsedMetricName, 0}, |
| 3141 {internal::kUKMHeuristicTypeMetricName, CREDIT_CARD_NUMBER}, |
| 3142 {internal::kUKMHtmlFieldTypeMetricName, HTML_TYPE_UNSPECIFIED}, |
| 3143 {internal::kUKMServerTypeMetricName, CREDIT_CARD_NUMBER}}}); |
3103 VerifySubmitFormUkm(form, &test_ukm_recorder_, | 3144 VerifySubmitFormUkm(form, &test_ukm_recorder_, |
3104 AutofillMetrics::NON_FILLABLE_FORM_OR_NEW_DATA); | 3145 AutofillMetrics::NON_FILLABLE_FORM_OR_NEW_DATA); |
3105 } | 3146 } |
3106 } | 3147 } |
3107 | 3148 |
3108 // Test that we log "will submit" (but not submitted) form events for credit | 3149 // Test that we log "will submit" (but not submitted) form events for credit |
3109 // cards. Mirrors CreditCardSubmittedFormEvents test but does not expect any | 3150 // cards. Mirrors CreditCardSubmittedFormEvents test but does not expect any |
3110 // "submitted" metrics. | 3151 // "submitted" metrics. |
3111 TEST_F(AutofillMetricsTest, CreditCardWillSubmitFormEvents) { | 3152 TEST_F(AutofillMetricsTest, CreditCardWillSubmitFormEvents) { |
3112 EnableWalletSync(); | 3153 EnableWalletSync(); |
(...skipping 1058 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4171 base::UserActionTester user_action_tester; | 4212 base::UserActionTester user_action_tester; |
4172 autofill_manager_->SubmitForm(form, TimeTicks::Now()); | 4213 autofill_manager_->SubmitForm(form, TimeTicks::Now()); |
4173 histogram_tester.ExpectUniqueSample( | 4214 histogram_tester.ExpectUniqueSample( |
4174 "Autofill.FormSubmittedState", | 4215 "Autofill.FormSubmittedState", |
4175 AutofillMetrics::FILLABLE_FORM_AUTOFILLED_NONE_DID_SHOW_SUGGESTIONS, 1); | 4216 AutofillMetrics::FILLABLE_FORM_AUTOFILLED_NONE_DID_SHOW_SUGGESTIONS, 1); |
4176 EXPECT_EQ(1, user_action_tester.GetActionCount( | 4217 EXPECT_EQ(1, user_action_tester.GetActionCount( |
4177 "Autofill_FormSubmitted_FilledNone_SuggestionsShown")); | 4218 "Autofill_FormSubmitted_FilledNone_SuggestionsShown")); |
4178 | 4219 |
4179 VerifyFormInteractionUkm( | 4220 VerifyFormInteractionUkm( |
4180 form, &test_ukm_recorder_, internal::kUKMSuggestionsShownEntryName, | 4221 form, &test_ukm_recorder_, internal::kUKMSuggestionsShownEntryName, |
4181 {{{internal::kUKMMillisecondsSinceFormParsedMetricName, 0}}}); | 4222 {{{internal::kUKMMillisecondsSinceFormParsedMetricName, 0}, |
| 4223 {internal::kUKMHeuristicTypeMetricName, PHONE_HOME_WHOLE_NUMBER}, |
| 4224 {internal::kUKMHtmlFieldTypeMetricName, HTML_TYPE_UNSPECIFIED}, |
| 4225 {internal::kUKMServerTypeMetricName, NO_SERVER_DATA}}}); |
4182 expected_form_submission_ukm_metrics.push_back( | 4226 expected_form_submission_ukm_metrics.push_back( |
4183 {{internal::kUKMAutofillFormSubmittedStateMetricName, | 4227 {{internal::kUKMAutofillFormSubmittedStateMetricName, |
4184 AutofillMetrics::FILLABLE_FORM_AUTOFILLED_NONE_DID_SHOW_SUGGESTIONS}, | 4228 AutofillMetrics::FILLABLE_FORM_AUTOFILLED_NONE_DID_SHOW_SUGGESTIONS}, |
4185 {internal::kUKMMillisecondsSinceFormParsedMetricName, 0}}); | 4229 {internal::kUKMMillisecondsSinceFormParsedMetricName, 0}}); |
4186 VerifyFormInteractionUkm(form, &test_ukm_recorder_, | 4230 VerifyFormInteractionUkm(form, &test_ukm_recorder_, |
4187 internal::kUKMFormSubmittedEntryName, | 4231 internal::kUKMFormSubmittedEntryName, |
4188 expected_form_submission_ukm_metrics); | 4232 expected_form_submission_ukm_metrics); |
4189 } | 4233 } |
4190 | 4234 |
4191 // Mark one of the fields as autofilled. | 4235 // Mark one of the fields as autofilled. |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4367 | 4411 |
4368 autofill_manager_->Reset(); | 4412 autofill_manager_->Reset(); |
4369 | 4413 |
4370 VerifyFormInteractionUkm( | 4414 VerifyFormInteractionUkm( |
4371 form, &test_ukm_recorder_, internal::kUKMInteractedWithFormEntryName, | 4415 form, &test_ukm_recorder_, internal::kUKMInteractedWithFormEntryName, |
4372 {{{internal::kUKMIsForCreditCardMetricName, false}, | 4416 {{{internal::kUKMIsForCreditCardMetricName, false}, |
4373 {internal::kUKMLocalRecordTypeCountMetricName, 0}, | 4417 {internal::kUKMLocalRecordTypeCountMetricName, 0}, |
4374 {internal::kUKMServerRecordTypeCountMetricName, 0}}}); | 4418 {internal::kUKMServerRecordTypeCountMetricName, 0}}}); |
4375 VerifyFormInteractionUkm( | 4419 VerifyFormInteractionUkm( |
4376 form, &test_ukm_recorder_, internal::kUKMSuggestionsShownEntryName, | 4420 form, &test_ukm_recorder_, internal::kUKMSuggestionsShownEntryName, |
4377 {{{internal::kUKMMillisecondsSinceFormParsedMetricName, 0}}, | 4421 {{{internal::kUKMMillisecondsSinceFormParsedMetricName, 0}, |
4378 {{internal::kUKMMillisecondsSinceFormParsedMetricName, 0}}}); | 4422 {internal::kUKMHeuristicTypeMetricName, PHONE_HOME_WHOLE_NUMBER}, |
| 4423 {internal::kUKMHtmlFieldTypeMetricName, HTML_TYPE_UNSPECIFIED}, |
| 4424 {internal::kUKMServerTypeMetricName, NO_SERVER_DATA}}, |
| 4425 {{internal::kUKMMillisecondsSinceFormParsedMetricName, 0}, |
| 4426 {internal::kUKMHeuristicTypeMetricName, EMAIL_ADDRESS}, |
| 4427 {internal::kUKMHtmlFieldTypeMetricName, HTML_TYPE_UNSPECIFIED}, |
| 4428 {internal::kUKMServerTypeMetricName, NO_SERVER_DATA}}}); |
4379 VerifyFormInteractionUkm( | 4429 VerifyFormInteractionUkm( |
4380 form, &test_ukm_recorder_, internal::kUKMSuggestionFilledEntryName, | 4430 form, &test_ukm_recorder_, internal::kUKMSuggestionFilledEntryName, |
4381 {{{internal::kUKMRecordTypeMetricName, AutofillProfile::LOCAL_PROFILE}, | 4431 {{{internal::kUKMRecordTypeMetricName, AutofillProfile::LOCAL_PROFILE}, |
4382 {internal::kUKMMillisecondsSinceFormParsedMetricName, 0}}, | 4432 {internal::kUKMMillisecondsSinceFormParsedMetricName, 0}}, |
4383 {{internal::kUKMRecordTypeMetricName, AutofillProfile::LOCAL_PROFILE}, | 4433 {{internal::kUKMRecordTypeMetricName, AutofillProfile::LOCAL_PROFILE}, |
4384 {internal::kUKMMillisecondsSinceFormParsedMetricName, 0}}}); | 4434 {internal::kUKMMillisecondsSinceFormParsedMetricName, 0}}}); |
4385 VerifyFormInteractionUkm( | 4435 VerifyFormInteractionUkm( |
4386 form, &test_ukm_recorder_, internal::kUKMTextFieldDidChangeEntryName, | 4436 form, &test_ukm_recorder_, internal::kUKMTextFieldDidChangeEntryName, |
4387 {{{internal::kUKMFieldTypeGroupMetricName, NAME}, | 4437 {{{internal::kUKMFieldTypeGroupMetricName, NAME}, |
4388 {internal::kUKMHeuristicTypeMetricName, NAME_FULL}, | 4438 {internal::kUKMHeuristicTypeMetricName, NAME_FULL}, |
(...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5066 // Tests that no UKM is logged when the ukm service is null. | 5116 // Tests that no UKM is logged when the ukm service is null. |
5067 TEST_F(AutofillMetricsTest, RecordCardUploadDecisionMetric_NoUkmService) { | 5117 TEST_F(AutofillMetricsTest, RecordCardUploadDecisionMetric_NoUkmService) { |
5068 GURL url("https://www.google.com"); | 5118 GURL url("https://www.google.com"); |
5069 std::vector<std::pair<const char*, int>> metrics = {{"metric", 1}}; | 5119 std::vector<std::pair<const char*, int>> metrics = {{"metric", 1}}; |
5070 | 5120 |
5071 EXPECT_FALSE(AutofillMetrics::LogUkm(nullptr, url, "test_ukm", metrics)); | 5121 EXPECT_FALSE(AutofillMetrics::LogUkm(nullptr, url, "test_ukm", metrics)); |
5072 ASSERT_EQ(0U, test_ukm_recorder_.sources_count()); | 5122 ASSERT_EQ(0U, test_ukm_recorder_.sources_count()); |
5073 } | 5123 } |
5074 | 5124 |
5075 } // namespace autofill | 5125 } // namespace autofill |
OLD | NEW |