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

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

Issue 261013010: autocomplete: add ability to get full address (hidden behind a flag). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: GCC weirdness Created 6 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
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

Powered by Google App Engine
This is Rietveld 408576698