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 22b3ba0ef54e13058b30a5dcf49382a2e8714f65..d82aba92d3561dafeabc4d344d0502eeb444f50f 100644 |
--- a/components/autofill/core/browser/autofill_profile_unittest.cc |
+++ b/components/autofill/core/browser/autofill_profile_unittest.cc |
@@ -853,4 +853,23 @@ TEST(AutofillProfileTest, SetInfoTrimsWhitespace) { |
profile.GetRawInfo(EMAIL_ADDRESS)); |
} |
+TEST(AutofillProfileTest, FullAddress) { |
+ AutofillProfile profile(base::GenerateGUID(), "https://www.example.com/"); |
+ test::SetProfileInfo(&profile, "Marion", "Mitchell", "Morrison", |
+ "marion@me.xyz", "Fox", "123 Zoo St.", "unit 5", |
+ "Hollywood", "CA", "91601", "US", |
+ "12345678910"); |
+ |
+ AutofillType full_address(HTML_TYPE_FULL_ADDRESS, HTML_MODE_NONE); |
+ base::string16 formatted_address(ASCIIToUTF16( |
+ "Marion Mitchell Morrison\n" |
+ "123 Zoo St.\n" |
+ "unit 5\n" |
+ "Hollywood, CA 91601")); |
+ EXPECT_EQ(formatted_address, profile.GetInfo(full_address, "en-US")); |
+ // This should fail and leave the profile unchanged. |
+ EXPECT_FALSE(profile.SetInfo(full_address, ASCIIToUTF16("foobar"), "en-US")); |
+ EXPECT_EQ(formatted_address, profile.GetInfo(full_address, "en-US")); |
+} |
Ilya Sherman
2014/05/07 01:19:19
Please add a test for getting the full address fro
|
+ |
} // namespace autofill |