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

Unified Diff: components/autofill/core/browser/autofill_field_unittest.cc

Issue 1080883002: Remove some more bad ASCII-centric autofill code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix test Created 5 years, 8 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
Index: components/autofill/core/browser/autofill_field_unittest.cc
diff --git a/components/autofill/core/browser/autofill_field_unittest.cc b/components/autofill/core/browser/autofill_field_unittest.cc
index 36096f20f4b014b9fc22d9a953900124bec78b07..c65daaa811105800646e3a308bb148d27436580f 100644
--- a/components/autofill/core/browser/autofill_field_unittest.cc
+++ b/components/autofill/core/browser/autofill_field_unittest.cc
@@ -402,6 +402,28 @@ TEST(AutofillFieldTest, FillSelectControlWithFullMonthName) {
EXPECT_EQ(ASCIIToUTF16("April"), field.value);
}
+TEST(AutofillFieldTest, FillSelectControlWithFrenchMonthName) {
+ const char* const kMonthsFrench[] = {
+ "JANV", "FÉVR.", "MARS", "décembre"
+ };
+ AutofillField field(
+ GenerateSelectFieldWithOptions(kMonthsFrench, arraysize(kMonthsFrench)),
+ base::string16());
+ field.set_heuristic_type(CREDIT_CARD_EXP_MONTH);
+
+ AutofillField::FillFormField(
+ field, ASCIIToUTF16("02"), "fr-FR", "fr-FR", &field);
+ EXPECT_EQ(UTF8ToUTF16("FÉVR."), field.value);
+
+ AutofillField::FillFormField(
+ field, ASCIIToUTF16("01"), "fr-FR", "fr-FR", &field);
+ EXPECT_EQ(UTF8ToUTF16("JANV"), field.value);
+
+ AutofillField::FillFormField(
+ field, ASCIIToUTF16("12"), "fr-FR", "fr-FR", &field);
+ EXPECT_EQ(UTF8ToUTF16("décembre"), field.value);
+}
+
TEST(AutofillFieldTest, FillSelectControlWithNumericMonthSansLeadingZero) {
const char* const kMonthsNumeric[] = {
"1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12",
« no previous file with comments | « components/autofill/core/browser/autofill_field.cc ('k') | components/autofill/core/browser/autofill_profile_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698