| Index: components/autofill/content/browser/wallet/wallet_client_unittest.cc
|
| diff --git a/components/autofill/content/browser/wallet/wallet_client_unittest.cc b/components/autofill/content/browser/wallet/wallet_client_unittest.cc
|
| index 9360b950391c228adc419a00837ab0dde5d0686c..e77bc75cc2a37ff7ee977f4e10621befacbacfdd 100644
|
| --- a/components/autofill/content/browser/wallet/wallet_client_unittest.cc
|
| +++ b/components/autofill/content/browser/wallet/wallet_client_unittest.cc
|
| @@ -317,12 +317,14 @@ const char kGetFullWalletValidRequest[] =
|
| "\"feature\":\"REQUEST_AUTOCOMPLETE\","
|
| "\"google_transaction_id\":\"google_transaction_id\","
|
| "\"merchant_domain\":\"https://example.com/\","
|
| + "\"phone_number_required\":true,"
|
| "\"risk_params\":\"risky business\","
|
| "\"selected_address_id\":\"shipping_address_id\","
|
| "\"selected_instrument_id\":\"instrument_id\","
|
| "\"supported_risk_challenge\":"
|
| "["
|
| - "]"
|
| + "],"
|
| + "\"use_minimal_addresses\":false"
|
| "}";
|
|
|
| const char kGetFullWalletWithRiskCapabilitesValidRequest[] =
|
| @@ -330,23 +332,29 @@ const char kGetFullWalletWithRiskCapabilitesValidRequest[] =
|
| "\"feature\":\"REQUEST_AUTOCOMPLETE\","
|
| "\"google_transaction_id\":\"google_transaction_id\","
|
| "\"merchant_domain\":\"https://example.com/\","
|
| + "\"phone_number_required\":true,"
|
| "\"risk_params\":\"risky business\","
|
| "\"selected_address_id\":\"shipping_address_id\","
|
| "\"selected_instrument_id\":\"instrument_id\","
|
| "\"supported_risk_challenge\":"
|
| "["
|
| "\"VERIFY_CVC\""
|
| - "]"
|
| + "],"
|
| + "\"use_minimal_addresses\":false"
|
| "}";
|
|
|
| const char kGetWalletItemsValidRequest[] =
|
| "{"
|
| - "\"merchant_domain\":\"https://example.com/\""
|
| + "\"merchant_domain\":\"https://example.com/\","
|
| + "\"phone_number_required\":true,"
|
| + "\"shipping_address_required\":true,"
|
| + "\"use_minimal_addresses\":false"
|
| "}";
|
|
|
| const char kSaveAddressValidRequest[] =
|
| "{"
|
| "\"merchant_domain\":\"https://example.com/\","
|
| + "\"phone_number_required\":true,"
|
| "\"risk_params\":\"risky business\","
|
| "\"shipping_address\":"
|
| "{"
|
| @@ -364,7 +372,8 @@ const char kSaveAddressValidRequest[] =
|
| "\"postal_code_number\":\"save_postal_code_number\","
|
| "\"recipient_name\":\"save_recipient_name\""
|
| "}"
|
| - "}"
|
| + "},"
|
| + "\"use_minimal_addresses\":false"
|
| "}";
|
|
|
| const char kSaveInstrumentValidRequest[] =
|
| @@ -395,7 +404,9 @@ const char kSaveInstrumentValidRequest[] =
|
| "},"
|
| "\"instrument_phone_number\":\"phone_number\","
|
| "\"merchant_domain\":\"https://example.com/\","
|
| - "\"risk_params\":\"risky business\""
|
| + "\"phone_number_required\":true,"
|
| + "\"risk_params\":\"risky business\","
|
| + "\"use_minimal_addresses\":false"
|
| "}";
|
|
|
| const char kSaveInstrumentAndAddressValidRequest[] =
|
| @@ -426,6 +437,7 @@ const char kSaveInstrumentAndAddressValidRequest[] =
|
| "},"
|
| "\"instrument_phone_number\":\"phone_number\","
|
| "\"merchant_domain\":\"https://example.com/\","
|
| + "\"phone_number_required\":true,"
|
| "\"risk_params\":\"risky business\","
|
| "\"shipping_address\":"
|
| "{"
|
| @@ -443,7 +455,8 @@ const char kSaveInstrumentAndAddressValidRequest[] =
|
| "\"postal_code_number\":\"save_postal_code_number\","
|
| "\"recipient_name\":\"save_recipient_name\""
|
| "}"
|
| - "}"
|
| + "},"
|
| + "\"use_minimal_addresses\":false"
|
| "}";
|
|
|
| const char kSendAutocheckoutStatusOfSuccessValidRequest[] =
|
| @@ -473,6 +486,7 @@ const char kSendAutocheckoutStatusOfFailureValidRequest[] =
|
| const char kUpdateAddressValidRequest[] =
|
| "{"
|
| "\"merchant_domain\":\"https://example.com/\","
|
| + "\"phone_number_required\":true,"
|
| "\"risk_params\":\"risky business\","
|
| "\"shipping_address\":"
|
| "{"
|
| @@ -491,13 +505,15 @@ const char kUpdateAddressValidRequest[] =
|
| "\"postal_code_number\":\"ship_postal_code_number\","
|
| "\"recipient_name\":\"ship_recipient_name\""
|
| "}"
|
| - "}"
|
| + "},"
|
| + "\"use_minimal_addresses\":false"
|
| "}";
|
|
|
| const char kUpdateInstrumentAddressValidRequest[] =
|
| "{"
|
| "\"instrument_phone_number\":\"phone_number\","
|
| "\"merchant_domain\":\"https://example.com/\","
|
| + "\"phone_number_required\":true,"
|
| "\"risk_params\":\"risky business\","
|
| "\"upgraded_billing_address\":"
|
| "{"
|
| @@ -512,13 +528,15 @@ const char kUpdateInstrumentAddressValidRequest[] =
|
| "\"postal_code_number\":\"postal_code_number\","
|
| "\"recipient_name\":\"recipient_name\""
|
| "},"
|
| - "\"upgraded_instrument_id\":\"instrument_id\""
|
| + "\"upgraded_instrument_id\":\"instrument_id\","
|
| + "\"use_minimal_addresses\":false"
|
| "}";
|
|
|
| const char kUpdateInstrumentAddressWithNameChangeValidRequest[] =
|
| "{"
|
| "\"instrument_phone_number\":\"phone_number\","
|
| "\"merchant_domain\":\"https://example.com/\","
|
| + "\"phone_number_required\":true,"
|
| "\"risk_params\":\"risky business\","
|
| "\"upgraded_billing_address\":"
|
| "{"
|
| @@ -533,7 +551,8 @@ const char kUpdateInstrumentAddressWithNameChangeValidRequest[] =
|
| "\"postal_code_number\":\"postal_code_number\","
|
| "\"recipient_name\":\"recipient_name\""
|
| "},"
|
| - "\"upgraded_instrument_id\":\"instrument_id\""
|
| + "\"upgraded_instrument_id\":\"instrument_id\","
|
| + "\"use_minimal_addresses\":false"
|
| "}";
|
|
|
| const char kUpdateInstrumentExpirationDateValidRequest[] =
|
| @@ -548,8 +567,10 @@ const char kUpdateInstrumentExpirationDateValidRequest[] =
|
| "\"type\":\"CREDIT_CARD\""
|
| "},"
|
| "\"merchant_domain\":\"https://example.com/\","
|
| + "\"phone_number_required\":true,"
|
| "\"risk_params\":\"risky business\","
|
| - "\"upgraded_instrument_id\":\"instrument_id\""
|
| + "\"upgraded_instrument_id\":\"instrument_id\","
|
| + "\"use_minimal_addresses\":false"
|
| "}";
|
|
|
| class MockAutofillMetrics : public AutofillMetrics {
|
| @@ -589,6 +610,18 @@ class MockWalletClientDelegate : public WalletClientDelegate {
|
| return "gdToken";
|
| }
|
|
|
| + virtual bool IsShippingAddressRequired() const OVERRIDE {
|
| + return true;
|
| + }
|
| +
|
| + virtual bool IsMinimalAddressAccepted() const OVERRIDE {
|
| + return false;
|
| + }
|
| +
|
| + virtual bool IsPhoneNumberRequired() const OVERRIDE {
|
| + return true;
|
| + }
|
| +
|
| void ExpectLogWalletApiCallDuration(
|
| AutofillMetrics::WalletApiCallMetric metric,
|
| size_t times) {
|
|
|