Commit 77eb3e88 authored by siashah's avatar siashah Committed by Commit Bot

Enable name fix flow by default on android

Bug: 965651
Change-Id: Iae94513290b3821935ba7f13df387d951bbb5fb9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1623285Reviewed-by: default avatarJared Saul <jsaul@google.com>
Commit-Queue: Siddharth Shah <siashah@chromium.org>
Cr-Commit-Position: refs/heads/master@{#662892}
parent 953a5b28
...@@ -1719,8 +1719,15 @@ TEST_F(CreditCardSaveManagerTest, UploadCreditCard_NoNameAvailable) { ...@@ -1719,8 +1719,15 @@ TEST_F(CreditCardSaveManagerTest, UploadCreditCard_NoNameAvailable) {
ExpectCardUploadDecision(histogram_tester, ExpectCardUploadDecision(histogram_tester,
AutofillMetrics::UPLOAD_NOT_OFFERED_NO_NAME); AutofillMetrics::UPLOAD_NOT_OFFERED_NO_NAME);
// Verify that the correct UKM was logged. // Verify that the correct UKM was logged.
ExpectCardUploadDecisionUkm(AutofillMetrics::UPLOAD_OFFERED | int upload_decision = AutofillMetrics::UPLOAD_OFFERED |
AutofillMetrics::UPLOAD_NOT_OFFERED_NO_NAME); AutofillMetrics::UPLOAD_NOT_OFFERED_NO_NAME;
#if defined(OS_ANDROID)
ExpectCardUploadDecision(
histogram_tester,
AutofillMetrics::USER_REQUESTED_TO_PROVIDE_CARDHOLDER_NAME);
upload_decision |= AutofillMetrics::USER_REQUESTED_TO_PROVIDE_CARDHOLDER_NAME;
#endif
ExpectCardUploadDecisionUkm(upload_decision);
} }
TEST_F(CreditCardSaveManagerTest, TEST_F(CreditCardSaveManagerTest,
...@@ -1753,10 +1760,16 @@ TEST_F(CreditCardSaveManagerTest, ...@@ -1753,10 +1760,16 @@ TEST_F(CreditCardSaveManagerTest,
ExpectCardUploadDecision(histogram_tester, ExpectCardUploadDecision(histogram_tester,
AutofillMetrics::UPLOAD_NOT_OFFERED_NO_NAME); AutofillMetrics::UPLOAD_NOT_OFFERED_NO_NAME);
// Verify that the correct UKM was logged. // Verify that the correct UKM was logged.
ExpectCardUploadDecisionUkm( int upload_decision = AutofillMetrics::UPLOAD_OFFERED |
AutofillMetrics::UPLOAD_OFFERED |
AutofillMetrics::UPLOAD_NOT_OFFERED_NO_ADDRESS_PROFILE | AutofillMetrics::UPLOAD_NOT_OFFERED_NO_ADDRESS_PROFILE |
AutofillMetrics::UPLOAD_NOT_OFFERED_NO_NAME); AutofillMetrics::UPLOAD_NOT_OFFERED_NO_NAME;
#if defined(OS_ANDROID)
ExpectCardUploadDecision(
histogram_tester,
AutofillMetrics::USER_REQUESTED_TO_PROVIDE_CARDHOLDER_NAME);
upload_decision |= AutofillMetrics::USER_REQUESTED_TO_PROVIDE_CARDHOLDER_NAME;
#endif
ExpectCardUploadDecisionUkm(upload_decision);
} }
TEST_F(CreditCardSaveManagerTest, UploadCreditCard_ZipCodesConflict) { TEST_F(CreditCardSaveManagerTest, UploadCreditCard_ZipCodesConflict) {
...@@ -2059,9 +2072,15 @@ TEST_F(CreditCardSaveManagerTest, ...@@ -2059,9 +2072,15 @@ TEST_F(CreditCardSaveManagerTest,
ExpectCardUploadDecision( ExpectCardUploadDecision(
histogram_tester, AutofillMetrics::UPLOAD_NOT_OFFERED_CONFLICTING_NAMES); histogram_tester, AutofillMetrics::UPLOAD_NOT_OFFERED_CONFLICTING_NAMES);
// Verify that the correct UKM was logged. // Verify that the correct UKM was logged.
ExpectCardUploadDecisionUkm( int upload_decision = AutofillMetrics::UPLOAD_OFFERED |
AutofillMetrics::UPLOAD_OFFERED | AutofillMetrics::UPLOAD_NOT_OFFERED_CONFLICTING_NAMES;
AutofillMetrics::UPLOAD_NOT_OFFERED_CONFLICTING_NAMES); #if defined(OS_ANDROID)
ExpectCardUploadDecision(
histogram_tester,
AutofillMetrics::USER_REQUESTED_TO_PROVIDE_CARDHOLDER_NAME);
upload_decision |= AutofillMetrics::USER_REQUESTED_TO_PROVIDE_CARDHOLDER_NAME;
#endif
ExpectCardUploadDecisionUkm(upload_decision);
} }
TEST_F(CreditCardSaveManagerTest, UploadCreditCard_CCFormHasAddressMiddleName) { TEST_F(CreditCardSaveManagerTest, UploadCreditCard_CCFormHasAddressMiddleName) {
...@@ -2097,9 +2116,15 @@ TEST_F(CreditCardSaveManagerTest, UploadCreditCard_CCFormHasAddressMiddleName) { ...@@ -2097,9 +2116,15 @@ TEST_F(CreditCardSaveManagerTest, UploadCreditCard_CCFormHasAddressMiddleName) {
ExpectCardUploadDecision( ExpectCardUploadDecision(
histogram_tester, AutofillMetrics::UPLOAD_NOT_OFFERED_CONFLICTING_NAMES); histogram_tester, AutofillMetrics::UPLOAD_NOT_OFFERED_CONFLICTING_NAMES);
// Verify that the correct UKM was logged. // Verify that the correct UKM was logged.
ExpectCardUploadDecisionUkm( int upload_decision = AutofillMetrics::UPLOAD_OFFERED |
AutofillMetrics::UPLOAD_OFFERED | AutofillMetrics::UPLOAD_NOT_OFFERED_CONFLICTING_NAMES;
AutofillMetrics::UPLOAD_NOT_OFFERED_CONFLICTING_NAMES); #if defined(OS_ANDROID)
ExpectCardUploadDecision(
histogram_tester,
AutofillMetrics::USER_REQUESTED_TO_PROVIDE_CARDHOLDER_NAME);
upload_decision |= AutofillMetrics::USER_REQUESTED_TO_PROVIDE_CARDHOLDER_NAME;
#endif
ExpectCardUploadDecisionUkm(upload_decision);
} }
TEST_F(CreditCardSaveManagerTest, UploadCreditCard_NamesCanMismatch) { TEST_F(CreditCardSaveManagerTest, UploadCreditCard_NamesCanMismatch) {
...@@ -2144,9 +2169,15 @@ TEST_F(CreditCardSaveManagerTest, UploadCreditCard_NamesCanMismatch) { ...@@ -2144,9 +2169,15 @@ TEST_F(CreditCardSaveManagerTest, UploadCreditCard_NamesCanMismatch) {
ExpectCardUploadDecision( ExpectCardUploadDecision(
histogram_tester, AutofillMetrics::UPLOAD_NOT_OFFERED_CONFLICTING_NAMES); histogram_tester, AutofillMetrics::UPLOAD_NOT_OFFERED_CONFLICTING_NAMES);
// Verify that the correct UKM was logged. // Verify that the correct UKM was logged.
ExpectCardUploadDecisionUkm( int upload_decision = AutofillMetrics::UPLOAD_OFFERED |
AutofillMetrics::UPLOAD_OFFERED | AutofillMetrics::UPLOAD_NOT_OFFERED_CONFLICTING_NAMES;
AutofillMetrics::UPLOAD_NOT_OFFERED_CONFLICTING_NAMES); #if defined(OS_ANDROID)
ExpectCardUploadDecision(
histogram_tester,
AutofillMetrics::USER_REQUESTED_TO_PROVIDE_CARDHOLDER_NAME);
upload_decision |= AutofillMetrics::USER_REQUESTED_TO_PROVIDE_CARDHOLDER_NAME;
#endif
ExpectCardUploadDecisionUkm(upload_decision);
} }
TEST_F(CreditCardSaveManagerTest, UploadCreditCard_IgnoreOldProfiles) { TEST_F(CreditCardSaveManagerTest, UploadCreditCard_IgnoreOldProfiles) {
...@@ -3126,7 +3157,19 @@ TEST_P(CreditCardSaveManagerFeatureParameterizedTest, NothingIfNothingFound) { ...@@ -3126,7 +3157,19 @@ TEST_P(CreditCardSaveManagerFeatureParameterizedTest, NothingIfNothingFound) {
// Submit the form and check what detected_values for an upload save would be. // Submit the form and check what detected_values for an upload save would be.
FormSubmitted(credit_card_form); FormSubmitted(credit_card_form);
EXPECT_EQ(payments_client_->detected_values_in_upload_details(), 0); int detected_values = payments_client_->detected_values_in_upload_details();
EXPECT_FALSE(detected_values & CreditCardSaveManager::DetectedValue::CVC);
EXPECT_FALSE(detected_values &
CreditCardSaveManager::DetectedValue::CARDHOLDER_NAME);
EXPECT_FALSE(detected_values &
CreditCardSaveManager::DetectedValue::ADDRESS_NAME);
EXPECT_FALSE(detected_values &
CreditCardSaveManager::DetectedValue::POSTAL_CODE);
EXPECT_FALSE(detected_values &
CreditCardSaveManager::DetectedValue::COUNTRY_CODE);
EXPECT_FALSE(
detected_values &
CreditCardSaveManager::DetectedValue::HAS_GOOGLE_PAYMENTS_ACCOUNT);
} }
TEST_P(CreditCardSaveManagerFeatureParameterizedTest, DetectCvc) { TEST_P(CreditCardSaveManagerFeatureParameterizedTest, DetectCvc) {
...@@ -3256,7 +3299,11 @@ TEST_P(CreditCardSaveManagerFeatureParameterizedTest, ...@@ -3256,7 +3299,11 @@ TEST_P(CreditCardSaveManagerFeatureParameterizedTest,
// Submit the form and check what detected_values for an upload save would be. // Submit the form and check what detected_values for an upload save would be.
FormSubmitted(credit_card_form); FormSubmitted(credit_card_form);
EXPECT_EQ(payments_client_->detected_values_in_upload_details(), 0); int detected_values = payments_client_->detected_values_in_upload_details();
EXPECT_FALSE(detected_values &
CreditCardSaveManager::DetectedValue::CARDHOLDER_NAME);
EXPECT_FALSE(detected_values &
CreditCardSaveManager::DetectedValue::ADDRESS_NAME);
} }
TEST_P(CreditCardSaveManagerFeatureParameterizedTest, DetectPostalCode) { TEST_P(CreditCardSaveManagerFeatureParameterizedTest, DetectPostalCode) {
...@@ -3314,7 +3361,8 @@ TEST_P(CreditCardSaveManagerFeatureParameterizedTest, ...@@ -3314,7 +3361,8 @@ TEST_P(CreditCardSaveManagerFeatureParameterizedTest,
// Submit the form and check what detected_values for an upload save would be. // Submit the form and check what detected_values for an upload save would be.
FormSubmitted(credit_card_form); FormSubmitted(credit_card_form);
EXPECT_EQ(payments_client_->detected_values_in_upload_details(), 0); EXPECT_FALSE(payments_client_->detected_values_in_upload_details() &
CreditCardSaveManager::DetectedValue::POSTAL_CODE);
} }
TEST_P(CreditCardSaveManagerFeatureParameterizedTest, DetectAddressLine) { TEST_P(CreditCardSaveManagerFeatureParameterizedTest, DetectAddressLine) {
...@@ -3628,13 +3676,20 @@ TEST_P(CreditCardSaveManagerFeatureParameterizedTest, ...@@ -3628,13 +3676,20 @@ TEST_P(CreditCardSaveManagerFeatureParameterizedTest,
AutofillMetrics::UPLOAD_NOT_OFFERED_NO_ZIP_CODE); AutofillMetrics::UPLOAD_NOT_OFFERED_NO_ZIP_CODE);
ExpectCardUploadDecision(histogram_tester, ExpectCardUploadDecision(histogram_tester,
AutofillMetrics::CVC_VALUE_NOT_FOUND); AutofillMetrics::CVC_VALUE_NOT_FOUND);
// Verify that the correct UKM was logged. int upload_decision =
ExpectMetric(UkmCardUploadDecisionType::kUploadDecisionName,
UkmCardUploadDecisionType::kEntryName,
AutofillMetrics::UPLOAD_NOT_OFFERED_GET_UPLOAD_DETAILS_FAILED | AutofillMetrics::UPLOAD_NOT_OFFERED_GET_UPLOAD_DETAILS_FAILED |
AutofillMetrics::UPLOAD_NOT_OFFERED_NO_NAME | AutofillMetrics::UPLOAD_NOT_OFFERED_NO_NAME |
AutofillMetrics::UPLOAD_NOT_OFFERED_NO_ZIP_CODE | AutofillMetrics::UPLOAD_NOT_OFFERED_NO_ZIP_CODE |
AutofillMetrics::CVC_VALUE_NOT_FOUND, AutofillMetrics::CVC_VALUE_NOT_FOUND;
#if defined(OS_ANDROID)
ExpectCardUploadDecision(
histogram_tester,
AutofillMetrics::USER_REQUESTED_TO_PROVIDE_CARDHOLDER_NAME);
upload_decision |= AutofillMetrics::USER_REQUESTED_TO_PROVIDE_CARDHOLDER_NAME;
#endif
// Verify that the correct UKM was logged.
ExpectMetric(UkmCardUploadDecisionType::kUploadDecisionName,
UkmCardUploadDecisionType::kEntryName, upload_decision,
1 /* expected_num_matching_entries */); 1 /* expected_num_matching_entries */);
} }
...@@ -3842,11 +3897,18 @@ TEST_P(CreditCardSaveManagerFeatureParameterizedTest, ...@@ -3842,11 +3897,18 @@ TEST_P(CreditCardSaveManagerFeatureParameterizedTest,
ExpectCardUploadDecision(histogram_tester, AutofillMetrics::UPLOAD_OFFERED); ExpectCardUploadDecision(histogram_tester, AutofillMetrics::UPLOAD_OFFERED);
ExpectCardUploadDecision(histogram_tester, ExpectCardUploadDecision(histogram_tester,
AutofillMetrics::UPLOAD_NOT_OFFERED_NO_NAME); AutofillMetrics::UPLOAD_NOT_OFFERED_NO_NAME);
int upload_decision = AutofillMetrics::UPLOAD_OFFERED |
AutofillMetrics::UPLOAD_NOT_OFFERED_NO_NAME;
#if defined(OS_ANDROID)
ExpectCardUploadDecision(
histogram_tester,
AutofillMetrics::USER_REQUESTED_TO_PROVIDE_CARDHOLDER_NAME);
upload_decision |= AutofillMetrics::USER_REQUESTED_TO_PROVIDE_CARDHOLDER_NAME;
#endif
// Verify that the correct UKM was logged. // Verify that the correct UKM was logged.
ExpectMetric(UkmCardUploadDecisionType::kUploadDecisionName, ExpectMetric(UkmCardUploadDecisionType::kUploadDecisionName,
UkmCardUploadDecisionType::kEntryName, UkmCardUploadDecisionType::kEntryName, upload_decision,
AutofillMetrics::UPLOAD_OFFERED |
AutofillMetrics::UPLOAD_NOT_OFFERED_NO_NAME,
1 /* expected_num_matching_entries */); 1 /* expected_num_matching_entries */);
} }
...@@ -3884,11 +3946,18 @@ TEST_P(CreditCardSaveManagerFeatureParameterizedTest, ...@@ -3884,11 +3946,18 @@ TEST_P(CreditCardSaveManagerFeatureParameterizedTest,
ExpectCardUploadDecision(histogram_tester, AutofillMetrics::UPLOAD_OFFERED); ExpectCardUploadDecision(histogram_tester, AutofillMetrics::UPLOAD_OFFERED);
ExpectCardUploadDecision( ExpectCardUploadDecision(
histogram_tester, AutofillMetrics::UPLOAD_NOT_OFFERED_CONFLICTING_NAMES); histogram_tester, AutofillMetrics::UPLOAD_NOT_OFFERED_CONFLICTING_NAMES);
int upload_decision = AutofillMetrics::UPLOAD_OFFERED |
AutofillMetrics::UPLOAD_NOT_OFFERED_CONFLICTING_NAMES;
#if defined(OS_ANDROID)
ExpectCardUploadDecision(
histogram_tester,
AutofillMetrics::USER_REQUESTED_TO_PROVIDE_CARDHOLDER_NAME);
upload_decision |= AutofillMetrics::USER_REQUESTED_TO_PROVIDE_CARDHOLDER_NAME;
#endif
// Verify that the correct UKM was logged. // Verify that the correct UKM was logged.
ExpectMetric(UkmCardUploadDecisionType::kUploadDecisionName, ExpectMetric(UkmCardUploadDecisionType::kUploadDecisionName,
UkmCardUploadDecisionType::kEntryName, UkmCardUploadDecisionType::kEntryName, upload_decision,
AutofillMetrics::UPLOAD_OFFERED |
AutofillMetrics::UPLOAD_NOT_OFFERED_CONFLICTING_NAMES,
1 /* expected_num_matching_entries */); 1 /* expected_num_matching_entries */);
} }
...@@ -4031,13 +4100,19 @@ TEST_P(CreditCardSaveManagerFeatureParameterizedTest, ...@@ -4031,13 +4100,19 @@ TEST_P(CreditCardSaveManagerFeatureParameterizedTest,
AutofillMetrics::UPLOAD_NOT_OFFERED_NO_NAME); AutofillMetrics::UPLOAD_NOT_OFFERED_NO_NAME);
ExpectCardUploadDecision(histogram_tester, ExpectCardUploadDecision(histogram_tester,
AutofillMetrics::UPLOAD_NOT_OFFERED_NO_ZIP_CODE); AutofillMetrics::UPLOAD_NOT_OFFERED_NO_ZIP_CODE);
// Verify that the correct UKM was logged. int upload_decision = AutofillMetrics::UPLOAD_OFFERED |
ExpectMetric(UkmCardUploadDecisionType::kUploadDecisionName,
UkmCardUploadDecisionType::kEntryName,
AutofillMetrics::UPLOAD_OFFERED |
AutofillMetrics::CVC_VALUE_NOT_FOUND | AutofillMetrics::CVC_VALUE_NOT_FOUND |
AutofillMetrics::UPLOAD_NOT_OFFERED_NO_NAME | AutofillMetrics::UPLOAD_NOT_OFFERED_NO_NAME |
AutofillMetrics::UPLOAD_NOT_OFFERED_NO_ZIP_CODE, AutofillMetrics::UPLOAD_NOT_OFFERED_NO_ZIP_CODE;
#if defined(OS_ANDROID)
ExpectCardUploadDecision(histogram_tester,
AutofillMetrics::UPLOAD_NOT_OFFERED_NO_ZIP_CODE);
upload_decision |= AutofillMetrics::USER_REQUESTED_TO_PROVIDE_CARDHOLDER_NAME;
#endif
// Verify that the correct UKM was logged.
ExpectMetric(UkmCardUploadDecisionType::kUploadDecisionName,
UkmCardUploadDecisionType::kEntryName, upload_decision,
1 /* expected_num_matching_entries */); 1 /* expected_num_matching_entries */);
} }
......
...@@ -129,7 +129,12 @@ const base::Feature kAutofillUpstreamDisallowJcb{ ...@@ -129,7 +129,12 @@ const base::Feature kAutofillUpstreamDisallowJcb{
const base::Feature kAutofillUpstreamEditableCardholderName{ const base::Feature kAutofillUpstreamEditableCardholderName{
"AutofillUpstreamEditableCardholderName", "AutofillUpstreamEditableCardholderName",
base::FEATURE_DISABLED_BY_DEFAULT}; #if defined(OS_ANDROID)
base::FEATURE_ENABLED_BY_DEFAULT
#else
base::FEATURE_DISABLED_BY_DEFAULT
#endif
};
const base::Feature kAutofillUpstreamEditableExpirationDate{ const base::Feature kAutofillUpstreamEditableExpirationDate{
"AutofillUpstreamEditableExpirationDate", "AutofillUpstreamEditableExpirationDate",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment