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

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 added 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..ab7c032857f17fb1bd2a881d5fd009329557c181 100644
--- a/components/autofill/core/browser/contact_info_unittest.cc
+++ b/components/autofill/core/browser/contact_info_unittest.cc
@@ -104,4 +104,21 @@ TEST(NameInfoTest, GetFullName) {
EXPECT_EQ(name.GetRawInfo(NAME_FULL), ASCIIToUTF16("First Middle Last"));
}
+TEST(NameInfoTest, Compare) {
+ NameInfo a, b;
+ a.SetRawInfo(NAME_FIRST, ASCIIToUTF16("First"));
+ a.SetRawInfo(NAME_MIDDLE, ASCIIToUTF16("Middle"));
+ a.SetRawInfo(NAME_LAST, ASCIIToUTF16("Last"));
+
+ // Result of assignment should be logically equal to the original NameInfo.
+ b = a;
+ EXPECT_TRUE(a == b);
+
+ // a{first|middle|last} is not equal to b{first||middle last}
+ a.SetRawInfo(NAME_FULL, ASCIIToUTF16("First Middle Last"));
+ b.SetRawInfo(NAME_FIRST, ASCIIToUTF16("First"));
+ b.SetRawInfo(NAME_MIDDLE, base::string16());
+ b.SetRawInfo(NAME_LAST, ASCIIToUTF16("Middle Last"));
+ EXPECT_TRUE(a != b);
+}
} // namespace autofill

Powered by Google App Engine
This is Rietveld 408576698