Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(901)

Unified Diff: chrome/browser/ui/autofill/autofill_dialog_controller_unittest.cc

Issue 328843002: Fill in country code correctly for wallet billing addresses. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: stupid test Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/autofill/data_model_wrapper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/autofill/autofill_dialog_controller_unittest.cc
diff --git a/chrome/browser/ui/autofill/autofill_dialog_controller_unittest.cc b/chrome/browser/ui/autofill/autofill_dialog_controller_unittest.cc
index 9d894ee306ed90568db83f3ee0eaf2a0fa63d2ff..30dff1ad446064a77ccc706a63fc31e1f7889143 100644
--- a/chrome/browser/ui/autofill/autofill_dialog_controller_unittest.cc
+++ b/chrome/browser/ui/autofill/autofill_dialog_controller_unittest.cc
@@ -3535,4 +3535,42 @@ TEST_F(AutofillDialogControllerTest, SwitchFromWalletWithFirstName) {
ASSERT_NO_FATAL_FAILURE(SwitchToAutofill());
}
+// Regression test for http://crbug.com/382777
+TEST_F(AutofillDialogControllerTest, WalletBillingCountry) {
+ FormFieldData cc_field;
+ cc_field.autocomplete_attribute = "cc-number";
+ FormFieldData billing_country, billing_country_name, shipping_country,
+ shipping_country_name;
+ billing_country.autocomplete_attribute = "billing country";
+ billing_country_name.autocomplete_attribute = "billing country-name";
+ shipping_country.autocomplete_attribute = "shipping country";
+ shipping_country_name.autocomplete_attribute = "shipping country-name";
+
+ FormData form_data;
+ form_data.fields.push_back(cc_field);
+ form_data.fields.push_back(billing_country);
+ form_data.fields.push_back(billing_country_name);
+ form_data.fields.push_back(shipping_country);
+ form_data.fields.push_back(shipping_country_name);
+
+ SetUpControllerWithFormData(form_data);
+ AcceptAndLoadFakeFingerprint();
+ controller()->OnDidGetFullWallet(wallet::GetTestFullWallet());
+ controller()->ForceFinishSubmit();
+
+ ASSERT_EQ(5U, form_structure()->field_count());
+ EXPECT_EQ(ADDRESS_HOME_COUNTRY,
+ form_structure()->field(1)->Type().GetStorableType());
+ EXPECT_EQ(ASCIIToUTF16("US"), form_structure()->field(1)->value);
+ EXPECT_EQ(ADDRESS_HOME_COUNTRY,
+ form_structure()->field(2)->Type().GetStorableType());
+ EXPECT_EQ(ASCIIToUTF16("United States"), form_structure()->field(2)->value);
+ EXPECT_EQ(ADDRESS_HOME_COUNTRY,
+ form_structure()->field(3)->Type().GetStorableType());
+ EXPECT_EQ(ASCIIToUTF16("US"), form_structure()->field(3)->value);
+ EXPECT_EQ(ADDRESS_HOME_COUNTRY,
+ form_structure()->field(4)->Type().GetStorableType());
+ EXPECT_EQ(ASCIIToUTF16("United States"), form_structure()->field(4)->value);
+}
+
} // namespace autofill
« no previous file with comments | « no previous file | chrome/browser/ui/autofill/data_model_wrapper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698