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

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

Issue 261993006: Modified to allow to preserve two-word string in first-name and last-name in autofill profile. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Incorporated review comments and updated unit-tests. 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
Index: components/autofill/core/browser/contact_info_unittest.cc
diff --git a/components/autofill/core/browser/contact_info_unittest.cc b/components/autofill/core/browser/contact_info_unittest.cc
index 4c2be9d42e490aa5f1ebe7c57e959e2f12a0604e..a79da0a31a9922e1bee0ee43d8ed143ddedb63e6 100644
--- a/components/autofill/core/browser/contact_info_unittest.cc
+++ b/components/autofill/core/browser/contact_info_unittest.cc
@@ -104,4 +104,17 @@ TEST(NameInfoTest, GetFullName) {
EXPECT_EQ(name.GetRawInfo(NAME_FULL), ASCIIToUTF16("First Middle Last"));
}
+TEST(NameInfoTest, EqualsIgnoreCase) {
+ NameInfo a, b;
+ a.SetRawInfo(NAME_FIRST, ASCIIToUTF16("First"));
+ a.SetRawInfo(NAME_MIDDLE, ASCIIToUTF16("Middle"));
+ a.SetRawInfo(NAME_LAST, ASCIIToUTF16("Last"));
+
+ b = a;
+ EXPECT_TRUE(a.EqualsIgnoreCase(b));
+
+ // Case insensitive compare, upper-case the first name and last name.
+ b.SetRawInfo(NAME_FULL, ASCIIToUTF16("FIRST Middle LAST"));
+ EXPECT_TRUE(a.EqualsIgnoreCase(b));
Ilya Sherman 2014/06/16 20:28:18 Please add a test case (or multiple test cases) wh
Pritam Nikam 2014/06/18 08:27:19 Done.
+}
} // namespace autofill

Powered by Google App Engine
This is Rietveld 408576698