Commit 53c6873e authored by Jared Saul's avatar Jared Saul Committed by Commit Bot

[AF] Enable AutofillUpstreamEditableCardholderName by default

With the release of the cardholder name fix flow on iOS and conflicts
with Project Butter resolved in M76, we finally have feature parity
across all platforms and can enable this feature by default client-side.

Change-Id: I7ab9779188c3a1d913b998554568a6e03ef53415
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2017911Reviewed-by: default avatarManas Verma <manasverma@google.com>
Commit-Queue: Jared Saul <jsaul@google.com>
Cr-Commit-Position: refs/heads/master@{#737505}
parent b3c68405
...@@ -1848,16 +1848,14 @@ TEST_F(CreditCardSaveManagerTest, UploadCreditCard_NoNameAvailable) { ...@@ -1848,16 +1848,14 @@ TEST_F(CreditCardSaveManagerTest, UploadCreditCard_NoNameAvailable) {
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);
// Verify that the correct UKM was logged.
int upload_decision = AutofillMetrics::UPLOAD_OFFERED |
AutofillMetrics::UPLOAD_NOT_OFFERED_NO_NAME;
#if defined(OS_ANDROID)
ExpectCardUploadDecision( ExpectCardUploadDecision(
histogram_tester, histogram_tester,
AutofillMetrics::USER_REQUESTED_TO_PROVIDE_CARDHOLDER_NAME); AutofillMetrics::USER_REQUESTED_TO_PROVIDE_CARDHOLDER_NAME);
upload_decision |= AutofillMetrics::USER_REQUESTED_TO_PROVIDE_CARDHOLDER_NAME; // Verify that the correct UKM was logged.
#endif ExpectCardUploadDecisionUkm(
ExpectCardUploadDecisionUkm(upload_decision); AutofillMetrics::UPLOAD_OFFERED |
AutofillMetrics::UPLOAD_NOT_OFFERED_NO_NAME |
AutofillMetrics::USER_REQUESTED_TO_PROVIDE_CARDHOLDER_NAME);
} }
TEST_F(CreditCardSaveManagerTest, TEST_F(CreditCardSaveManagerTest,
...@@ -1889,17 +1887,15 @@ TEST_F(CreditCardSaveManagerTest, ...@@ -1889,17 +1887,15 @@ TEST_F(CreditCardSaveManagerTest,
histogram_tester, AutofillMetrics::UPLOAD_NOT_OFFERED_NO_ADDRESS_PROFILE); histogram_tester, AutofillMetrics::UPLOAD_NOT_OFFERED_NO_ADDRESS_PROFILE);
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.
int upload_decision = AutofillMetrics::UPLOAD_OFFERED |
AutofillMetrics::UPLOAD_NOT_OFFERED_NO_ADDRESS_PROFILE |
AutofillMetrics::UPLOAD_NOT_OFFERED_NO_NAME;
#if defined(OS_ANDROID)
ExpectCardUploadDecision( ExpectCardUploadDecision(
histogram_tester, histogram_tester,
AutofillMetrics::USER_REQUESTED_TO_PROVIDE_CARDHOLDER_NAME); AutofillMetrics::USER_REQUESTED_TO_PROVIDE_CARDHOLDER_NAME);
upload_decision |= AutofillMetrics::USER_REQUESTED_TO_PROVIDE_CARDHOLDER_NAME; // Verify that the correct UKM was logged.
#endif ExpectCardUploadDecisionUkm(
ExpectCardUploadDecisionUkm(upload_decision); AutofillMetrics::UPLOAD_OFFERED |
AutofillMetrics::UPLOAD_NOT_OFFERED_NO_ADDRESS_PROFILE |
AutofillMetrics::UPLOAD_NOT_OFFERED_NO_NAME |
AutofillMetrics::USER_REQUESTED_TO_PROVIDE_CARDHOLDER_NAME);
} }
TEST_F(CreditCardSaveManagerTest, UploadCreditCard_ZipCodesConflict) { TEST_F(CreditCardSaveManagerTest, UploadCreditCard_ZipCodesConflict) {
...@@ -2201,16 +2197,14 @@ TEST_F(CreditCardSaveManagerTest, ...@@ -2201,16 +2197,14 @@ TEST_F(CreditCardSaveManagerTest,
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);
// Verify that the correct UKM was logged.
int upload_decision = AutofillMetrics::UPLOAD_OFFERED |
AutofillMetrics::UPLOAD_NOT_OFFERED_CONFLICTING_NAMES;
#if defined(OS_ANDROID)
ExpectCardUploadDecision( ExpectCardUploadDecision(
histogram_tester, histogram_tester,
AutofillMetrics::USER_REQUESTED_TO_PROVIDE_CARDHOLDER_NAME); AutofillMetrics::USER_REQUESTED_TO_PROVIDE_CARDHOLDER_NAME);
upload_decision |= AutofillMetrics::USER_REQUESTED_TO_PROVIDE_CARDHOLDER_NAME; // Verify that the correct UKM was logged.
#endif ExpectCardUploadDecisionUkm(
ExpectCardUploadDecisionUkm(upload_decision); AutofillMetrics::UPLOAD_OFFERED |
AutofillMetrics::UPLOAD_NOT_OFFERED_CONFLICTING_NAMES |
AutofillMetrics::USER_REQUESTED_TO_PROVIDE_CARDHOLDER_NAME);
} }
TEST_F(CreditCardSaveManagerTest, UploadCreditCard_CCFormHasAddressMiddleName) { TEST_F(CreditCardSaveManagerTest, UploadCreditCard_CCFormHasAddressMiddleName) {
...@@ -2245,16 +2239,14 @@ TEST_F(CreditCardSaveManagerTest, UploadCreditCard_CCFormHasAddressMiddleName) { ...@@ -2245,16 +2239,14 @@ TEST_F(CreditCardSaveManagerTest, UploadCreditCard_CCFormHasAddressMiddleName) {
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);
// Verify that the correct UKM was logged.
int upload_decision = AutofillMetrics::UPLOAD_OFFERED |
AutofillMetrics::UPLOAD_NOT_OFFERED_CONFLICTING_NAMES;
#if defined(OS_ANDROID)
ExpectCardUploadDecision( ExpectCardUploadDecision(
histogram_tester, histogram_tester,
AutofillMetrics::USER_REQUESTED_TO_PROVIDE_CARDHOLDER_NAME); AutofillMetrics::USER_REQUESTED_TO_PROVIDE_CARDHOLDER_NAME);
upload_decision |= AutofillMetrics::USER_REQUESTED_TO_PROVIDE_CARDHOLDER_NAME; // Verify that the correct UKM was logged.
#endif ExpectCardUploadDecisionUkm(
ExpectCardUploadDecisionUkm(upload_decision); AutofillMetrics::UPLOAD_OFFERED |
AutofillMetrics::UPLOAD_NOT_OFFERED_CONFLICTING_NAMES |
AutofillMetrics::USER_REQUESTED_TO_PROVIDE_CARDHOLDER_NAME);
} }
TEST_F(CreditCardSaveManagerTest, UploadCreditCard_NamesCanMismatch) { TEST_F(CreditCardSaveManagerTest, UploadCreditCard_NamesCanMismatch) {
...@@ -2298,16 +2290,14 @@ TEST_F(CreditCardSaveManagerTest, UploadCreditCard_NamesCanMismatch) { ...@@ -2298,16 +2290,14 @@ TEST_F(CreditCardSaveManagerTest, UploadCreditCard_NamesCanMismatch) {
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);
// Verify that the correct UKM was logged.
int upload_decision = AutofillMetrics::UPLOAD_OFFERED |
AutofillMetrics::UPLOAD_NOT_OFFERED_CONFLICTING_NAMES;
#if defined(OS_ANDROID)
ExpectCardUploadDecision( ExpectCardUploadDecision(
histogram_tester, histogram_tester,
AutofillMetrics::USER_REQUESTED_TO_PROVIDE_CARDHOLDER_NAME); AutofillMetrics::USER_REQUESTED_TO_PROVIDE_CARDHOLDER_NAME);
upload_decision |= AutofillMetrics::USER_REQUESTED_TO_PROVIDE_CARDHOLDER_NAME; // Verify that the correct UKM was logged.
#endif ExpectCardUploadDecisionUkm(
ExpectCardUploadDecisionUkm(upload_decision); AutofillMetrics::UPLOAD_OFFERED |
AutofillMetrics::UPLOAD_NOT_OFFERED_CONFLICTING_NAMES |
AutofillMetrics::USER_REQUESTED_TO_PROVIDE_CARDHOLDER_NAME);
} }
TEST_F(CreditCardSaveManagerTest, UploadCreditCard_IgnoreOldProfiles) { TEST_F(CreditCardSaveManagerTest, UploadCreditCard_IgnoreOldProfiles) {
...@@ -2355,8 +2345,6 @@ TEST_F(CreditCardSaveManagerTest, UploadCreditCard_IgnoreOldProfiles) { ...@@ -2355,8 +2345,6 @@ TEST_F(CreditCardSaveManagerTest, UploadCreditCard_IgnoreOldProfiles) {
AutofillMetrics::UPLOAD_OFFERED); AutofillMetrics::UPLOAD_OFFERED);
} }
// Requesting cardholder name currently not available on Android.
#if !defined(OS_ANDROID)
TEST_F( TEST_F(
CreditCardSaveManagerTest, CreditCardSaveManagerTest,
UploadCreditCard_RequestCardholderNameIfNameMissingAndNoPaymentsCustomer) { UploadCreditCard_RequestCardholderNameIfNameMissingAndNoPaymentsCustomer) {
...@@ -2797,7 +2785,7 @@ TEST_F( ...@@ -2797,7 +2785,7 @@ TEST_F(
FormData address_form; FormData address_form;
test::CreateTestAddressFormData(&address_form); test::CreateTestAddressFormData(&address_form);
FormsSeen(std::vector<FormData>(1, address_form)); FormsSeen(std::vector<FormData>(1, address_form));
ManuallyFillAddressForm("Flo", "Master", "77401", "US", &address_form); ManuallyFillAddressForm("Jane", "Doe", "77401", "US", &address_form);
FormSubmitted(address_form); FormSubmitted(address_form);
// Set up our credit card form data. // Set up our credit card form data.
...@@ -3239,7 +3227,6 @@ TEST_F(CreditCardSaveManagerTest, ...@@ -3239,7 +3227,6 @@ TEST_F(CreditCardSaveManagerTest,
EXPECT_TRUE(payments_client_->detected_values_in_upload_details() & EXPECT_TRUE(payments_client_->detected_values_in_upload_details() &
CreditCardSaveManager::DetectedValue::USER_PROVIDED_NAME); CreditCardSaveManager::DetectedValue::USER_PROVIDED_NAME);
} }
#endif
TEST_F(CreditCardSaveManagerTest, UploadCreditCard_UploadDetailsFails) { TEST_F(CreditCardSaveManagerTest, UploadCreditCard_UploadDetailsFails) {
// Anything other than "en-US" will cause GetUploadDetails to return a failure // Anything other than "en-US" will cause GetUploadDetails to return a failure
...@@ -3846,18 +3833,16 @@ TEST_F(CreditCardSaveManagerTest, ...@@ -3846,18 +3833,16 @@ TEST_F(CreditCardSaveManagerTest,
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);
int upload_decision =
AutofillMetrics::UPLOAD_NOT_OFFERED_GET_UPLOAD_DETAILS_FAILED |
AutofillMetrics::UPLOAD_NOT_OFFERED_NO_NAME |
AutofillMetrics::UPLOAD_NOT_OFFERED_NO_ZIP_CODE |
AutofillMetrics::CVC_VALUE_NOT_FOUND;
#if defined(OS_ANDROID)
ExpectCardUploadDecision( ExpectCardUploadDecision(
histogram_tester, histogram_tester,
AutofillMetrics::USER_REQUESTED_TO_PROVIDE_CARDHOLDER_NAME); 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.
int upload_decision =
AutofillMetrics::UPLOAD_NOT_OFFERED_GET_UPLOAD_DETAILS_FAILED |
AutofillMetrics::UPLOAD_NOT_OFFERED_NO_NAME |
AutofillMetrics::UPLOAD_NOT_OFFERED_NO_ZIP_CODE |
AutofillMetrics::CVC_VALUE_NOT_FOUND |
AutofillMetrics::USER_REQUESTED_TO_PROVIDE_CARDHOLDER_NAME;
ExpectMetric(UkmCardUploadDecisionType::kUploadDecisionName, ExpectMetric(UkmCardUploadDecisionType::kUploadDecisionName,
UkmCardUploadDecisionType::kEntryName, upload_decision, UkmCardUploadDecisionType::kEntryName, upload_decision,
1 /* expected_num_matching_entries */); 1 /* expected_num_matching_entries */);
...@@ -4067,16 +4052,14 @@ TEST_F(CreditCardSaveManagerTest, ...@@ -4067,16 +4052,14 @@ TEST_F(CreditCardSaveManagerTest,
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( ExpectCardUploadDecision(
histogram_tester, histogram_tester,
AutofillMetrics::USER_REQUESTED_TO_PROVIDE_CARDHOLDER_NAME); 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.
int upload_decision =
AutofillMetrics::UPLOAD_OFFERED |
AutofillMetrics::UPLOAD_NOT_OFFERED_NO_NAME |
AutofillMetrics::USER_REQUESTED_TO_PROVIDE_CARDHOLDER_NAME;
ExpectMetric(UkmCardUploadDecisionType::kUploadDecisionName, ExpectMetric(UkmCardUploadDecisionType::kUploadDecisionName,
UkmCardUploadDecisionType::kEntryName, upload_decision, UkmCardUploadDecisionType::kEntryName, upload_decision,
1 /* expected_num_matching_entries */); 1 /* expected_num_matching_entries */);
...@@ -4116,16 +4099,14 @@ TEST_F(CreditCardSaveManagerTest, ...@@ -4116,16 +4099,14 @@ TEST_F(CreditCardSaveManagerTest,
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( ExpectCardUploadDecision(
histogram_tester, histogram_tester,
AutofillMetrics::USER_REQUESTED_TO_PROVIDE_CARDHOLDER_NAME); 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.
int upload_decision =
AutofillMetrics::UPLOAD_OFFERED |
AutofillMetrics::UPLOAD_NOT_OFFERED_CONFLICTING_NAMES |
AutofillMetrics::USER_REQUESTED_TO_PROVIDE_CARDHOLDER_NAME;
ExpectMetric(UkmCardUploadDecisionType::kUploadDecisionName, ExpectMetric(UkmCardUploadDecisionType::kUploadDecisionName,
UkmCardUploadDecisionType::kEntryName, upload_decision, UkmCardUploadDecisionType::kEntryName, upload_decision,
1 /* expected_num_matching_entries */); 1 /* expected_num_matching_entries */);
...@@ -4270,17 +4251,15 @@ TEST_F(CreditCardSaveManagerTest, ...@@ -4270,17 +4251,15 @@ TEST_F(CreditCardSaveManagerTest,
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);
int upload_decision = AutofillMetrics::UPLOAD_OFFERED | ExpectCardUploadDecision(
AutofillMetrics::CVC_VALUE_NOT_FOUND | histogram_tester,
AutofillMetrics::UPLOAD_NOT_OFFERED_NO_NAME | AutofillMetrics::USER_REQUESTED_TO_PROVIDE_CARDHOLDER_NAME);
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. // Verify that the correct UKM was logged.
int upload_decision =
AutofillMetrics::UPLOAD_OFFERED | AutofillMetrics::CVC_VALUE_NOT_FOUND |
AutofillMetrics::UPLOAD_NOT_OFFERED_NO_NAME |
AutofillMetrics::UPLOAD_NOT_OFFERED_NO_ZIP_CODE |
AutofillMetrics::USER_REQUESTED_TO_PROVIDE_CARDHOLDER_NAME;
ExpectMetric(UkmCardUploadDecisionType::kUploadDecisionName, ExpectMetric(UkmCardUploadDecisionType::kUploadDecisionName,
UkmCardUploadDecisionType::kEntryName, upload_decision, UkmCardUploadDecisionType::kEntryName, upload_decision,
1 /* expected_num_matching_entries */); 1 /* expected_num_matching_entries */);
......
...@@ -103,13 +103,7 @@ const base::Feature kAutofillUpstreamAlwaysRequestCardholderName{ ...@@ -103,13 +103,7 @@ const base::Feature kAutofillUpstreamAlwaysRequestCardholderName{
// name in the offer-to-save bubble if it was not detected or was conflicting // name in the offer-to-save bubble if it was not detected or was conflicting
// during the checkout flow and the user is NOT a Google Payments customer. // during the checkout flow and the user is NOT a Google Payments customer.
const base::Feature kAutofillUpstreamEditableCardholderName{ const base::Feature kAutofillUpstreamEditableCardholderName{
"AutofillUpstreamEditableCardholderName", "AutofillUpstreamEditableCardholderName", base::FEATURE_ENABLED_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