| Index: components/autofill/core/browser/autofill_manager_unittest.cc
|
| diff --git a/components/autofill/core/browser/autofill_manager_unittest.cc b/components/autofill/core/browser/autofill_manager_unittest.cc
|
| index 3588d9d34e9a2b4e8548d1e9ea34e7835f2eed6f..b66f15f6a3da6111cddc3a20fd601302be7d1730 100644
|
| --- a/components/autofill/core/browser/autofill_manager_unittest.cc
|
| +++ b/components/autofill/core/browser/autofill_manager_unittest.cc
|
| @@ -1979,6 +1979,42 @@ TEST_F(AutofillManagerTest, FillCreditCardFormYearMonth) {
|
| kDefaultPageID, false, "2012", "04");
|
| }
|
|
|
| +// Test that we correctly fill a credit card form with first and last cardholder
|
| +// name.
|
| +TEST_F(AutofillManagerTest, FillCreditCardFormSplitName) {
|
| + // Set up our form data.
|
| + FormData form;
|
| + form.name = ASCIIToUTF16("MyForm");
|
| + form.origin = GURL("https://myform.com/form.html");
|
| + form.action = GURL("https://myform.com/submit.html");
|
| +
|
| + FormFieldData field;
|
| + test::CreateTestFormField("Card Name", "cardname", "", "text", &field);
|
| + form.fields.push_back(field);
|
| + test::CreateTestFormField("Last Name", "cardlastname", "", "text", &field);
|
| + form.fields.push_back(field);
|
| + test::CreateTestFormField("Card Number", "cardnumber", "", "text", &field);
|
| + form.fields.push_back(field);
|
| + test::CreateTestFormField("CVC", "cvc", "", "text", &field);
|
| + form.fields.push_back(field);
|
| +
|
| + std::vector<FormData> forms(1, form);
|
| + FormsSeen(forms);
|
| +
|
| + const char guid[] = "00000000-0000-0000-0000-000000000004";
|
| + int response_page_id = 0;
|
| + FormData response_data;
|
| + FillAutofillFormDataAndSaveResults(kDefaultPageID, form, *form.fields.begin(),
|
| + MakeFrontendID(guid, std::string()),
|
| + &response_page_id, &response_data);
|
| + ExpectFilledField("Card Name", "cardname", "Elvis", "text",
|
| + response_data.fields[0]);
|
| + ExpectFilledField("Last Name", "cardlastname", "Presley", "text",
|
| + response_data.fields[1]);
|
| + ExpectFilledField("Card Number", "cardnumber", "4234567890123456", "text",
|
| + response_data.fields[2]);
|
| +}
|
| +
|
| // Test that we correctly fill a combined address and credit card form.
|
| TEST_F(AutofillManagerTest, FillAddressAndCreditCardForm) {
|
| // Set up our form data.
|
|
|