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

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

Issue 2013063002: Remove diacritics when normalizing autofill profile strings for comparison. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Simplify normalization loop and expand test cases. Created 4 years, 7 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 | components/autofill/core/browser/autofill_profile.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 c9fd67d0f7eebd0220dae7f83dce36308a7a06b7..4cad2867e6d7067e221f6ffd9c8cc4cf8cc9fa84 100644
--- a/components/autofill/core/browser/autofill_manager_unittest.cc
+++ b/components/autofill/core/browser/autofill_manager_unittest.cc
@@ -3514,7 +3514,7 @@ TEST_F(AutofillManagerTest, DeterminePossibleFieldTypesForUpload) {
profiles.push_back(profile);
test::SetProfileInfo(&profile, "Charles", "", "Baudelaire",
"lesfleursdumal@gmail.com", "", "108 Rue Saint-Lazare",
- "Apt. 10", "Paris", "Ile de France", "75008", "FR",
+ "Apt. 10", "Paris", "Île de France", "75008", "FR",
"+33 2 49 19 70 70");
profile.set_guid("00000000-0000-0000-0000-000000000001");
profiles.push_back(profile);
@@ -3558,9 +3558,12 @@ TEST_F(AutofillManagerTest, DeterminePossibleFieldTypesForUpload) {
{"567", PHONE_HOME_NUMBER},
{"8901", PHONE_HOME_NUMBER},
- // Test an european profile.
+ // Test a European profile.
{"Paris", ADDRESS_HOME_CITY},
- {"Ile de France", ADDRESS_HOME_STATE},
+ {"Île de France", ADDRESS_HOME_STATE}, // Exact match
+ {"Ile de France", ADDRESS_HOME_STATE}, // Missing accent.
+ {"-Ile-de-France-", ADDRESS_HOME_STATE}, // Extra punctuation.
+ {"île dÉ FrÃÑÇË", ADDRESS_HOME_STATE}, // Other accents & case mismatch.
{"75008", ADDRESS_HOME_ZIP},
{"FR", ADDRESS_HOME_COUNTRY},
{"France", ADDRESS_HOME_COUNTRY},
@@ -3582,7 +3585,7 @@ TEST_F(AutofillManagerTest, DeterminePossibleFieldTypesForUpload) {
{"99", CREDIT_CARD_EXP_2_DIGIT_YEAR},
{"04/2999", CREDIT_CARD_EXP_DATE_4_DIGIT_YEAR},
- // Make sure whitespaces and invalid characters are handled properly.
+ // Make sure whitespace and invalid characters are handled properly.
{"", EMPTY_TYPE},
{" ", EMPTY_TYPE},
{"***", UNKNOWN_TYPE},
@@ -3622,7 +3625,7 @@ TEST_F(AutofillManagerTest, DeterminePossibleFieldTypesForUpload) {
FormFieldData field;
test::CreateTestFormField("", "1", "", "text", &field);
- field.value = ASCIIToUTF16(test_case.input_value);
+ field.value = UTF8ToUTF16(test_case.input_value);
form.fields.push_back(field);
FormStructure form_structure(form);
@@ -3635,7 +3638,8 @@ TEST_F(AutofillManagerTest, DeterminePossibleFieldTypesForUpload) {
form_structure.field(0)->possible_types();
EXPECT_EQ(1U, possible_types.size());
- EXPECT_NE(possible_types.end(), possible_types.find(test_case.field_type));
+ EXPECT_NE(possible_types.end(), possible_types.find(test_case.field_type))
+ << "Failed to determine type for: \"" << test_case.input_value << "\"";
}
}
« no previous file with comments | « no previous file | components/autofill/core/browser/autofill_profile.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698