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

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

Issue 399003002: Parse full name set in chrome://settings/autofill (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: satisfy msvc? Created 6 years, 5 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 | « components/autofill/core/browser/autofill_profile.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/autofill/core/browser/autofill_profile_unittest.cc
diff --git a/components/autofill/core/browser/autofill_profile_unittest.cc b/components/autofill/core/browser/autofill_profile_unittest.cc
index 112da958cc13b979cd3b0cacae50ac99b7c683a1..fac9b91ca1f860b1037a07476f72c6e722d6bced 100644
--- a/components/autofill/core/browser/autofill_profile_unittest.cc
+++ b/components/autofill/core/browser/autofill_profile_unittest.cc
@@ -672,6 +672,26 @@ TEST(AutofillProfileTest, AssignmentOperator) {
EXPECT_TRUE(a == b);
}
+TEST(AutofillProfileTest, SetMultiInfo) {
+ std::vector<base::string16> full_names;
+ full_names.push_back(ASCIIToUTF16("John Davis"));
+ full_names.push_back(ASCIIToUTF16("Elouise Davis"));
+ AutofillProfile p;
+ p.SetMultiInfo(AutofillType(NAME_FULL), full_names, "en-US");
+
+ std::vector<base::string16> first_names;
+ p.GetMultiInfo(AutofillType(NAME_FIRST), "en-US", &first_names);
+ ASSERT_EQ(2U, first_names.size());
+ EXPECT_EQ(ASCIIToUTF16("John"), first_names[0]);
+ EXPECT_EQ(ASCIIToUTF16("Elouise"), first_names[1]);
+
+ std::vector<base::string16> last_names;
+ p.GetMultiInfo(AutofillType(NAME_LAST), "en-US", &last_names);
+ ASSERT_EQ(2U, last_names.size());
+ EXPECT_EQ(ASCIIToUTF16("Davis"), last_names[0]);
+ EXPECT_EQ(ASCIIToUTF16("Davis"), last_names[1]);
+}
+
TEST(AutofillProfileTest, Copy) {
AutofillProfile a(base::GenerateGUID(), "https://www.example.com/");
test::SetProfileInfo(&a, "Marion", "Mitchell", "Morrison",
« no previous file with comments | « components/autofill/core/browser/autofill_profile.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698