Commit 01c4071c authored by dbeam@chromium.org's avatar dbeam@chromium.org

rAc: don't DCHECK() when switching from Wallet -> Autofill with only 1 name.

This can happen after the account_chooser_model has been changed to the new data
source but before all the suggestions have been updated.  In this small amount
of time we snapshot SECTION_CC_BILLING while the account chooser doesn't have
wallet selected.

R=estade@chromium.org
BUG=361321

Review URL: https://codereview.chromium.org/229593002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@262921 0039d316-1c4b-4281-b951-d872f2087c98
parent 55182d38
...@@ -1811,9 +1811,8 @@ base::string16 AutofillDialogControllerImpl::InputValidityMessage( ...@@ -1811,9 +1811,8 @@ base::string16 AutofillDialogControllerImpl::InputValidityMessage(
case NAME_FULL: case NAME_FULL:
// Wallet requires a first and last billing name. // Wallet requires a first and last billing name.
if (section == SECTION_CC_BILLING && !value.empty() && if (IsPayingWithWallet() && !value.empty() &&
!IsCardHolderNameValidForWallet(value)) { !IsCardHolderNameValidForWallet(value)) {
DCHECK(IsPayingWithWallet());
return l10n_util::GetStringUTF16( return l10n_util::GetStringUTF16(
IDS_AUTOFILL_DIALOG_VALIDATION_WALLET_REQUIRES_TWO_NAMES); IDS_AUTOFILL_DIALOG_VALIDATION_WALLET_REQUIRES_TWO_NAMES);
} }
......
...@@ -3404,4 +3404,14 @@ TEST_F(AutofillDialogControllerTest, SuggestCountrylessProfiles) { ...@@ -3404,4 +3404,14 @@ TEST_F(AutofillDialogControllerTest, SuggestCountrylessProfiles) {
EXPECT_EQ(NAME_FULL, controller()->popup_input_type()); EXPECT_EQ(NAME_FULL, controller()->popup_input_type());
} }
TEST_F(AutofillDialogControllerTest, SwitchFromWalletWithFirstName) {
controller()->MenuModelForSection(SECTION_CC_BILLING)->ActivatedAt(2);
FieldValueMap outputs;
outputs[NAME_FULL] = ASCIIToUTF16("madonna");
controller()->GetView()->SetUserInput(SECTION_CC_BILLING, outputs);
ASSERT_NO_FATAL_FAILURE(SwitchToAutofill());
}
} // namespace autofill } // namespace autofill
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