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

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

Issue 1868003003: Preserving first/middle/last names when an Autofill profile is submitted (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing stevenjb nits Created 4 years, 8 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_data_util.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_data_util_unittest.cc
diff --git a/components/autofill/core/browser/autofill_data_util_unittest.cc b/components/autofill/core/browser/autofill_data_util_unittest.cc
index ebed1f798d257b7bc3d93717137e1e2e09c367d0..707ac4925f1c69b15012ab4c4aa6e54398fb8212 100644
--- a/components/autofill/core/browser/autofill_data_util_unittest.cc
+++ b/components/autofill/core/browser/autofill_data_util_unittest.cc
@@ -5,6 +5,7 @@
#include "components/autofill/core/browser/autofill_data_util.h"
#include "base/strings/utf_string_conversions.h"
+#include "components/autofill/core/browser/autofill_test_utils.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace autofill {
@@ -42,5 +43,26 @@ TEST(AutofillDataUtilTest, SplitName) {
}
}
+TEST(AutofillDataUtilTest, ProfileMatchesFullName) {
+ autofill::AutofillProfile profile;
+ autofill::test::SetProfileInfo(
+ &profile, "First", "Middle", "Last", "fml@example.com", "Acme inc",
+ "123 Main", "Apt 2", "Laredo", "TX", "77300", "US", "832-555-1000");
+
+ EXPECT_TRUE(ProfileMatchesFullName(base::UTF8ToUTF16("First Last"), profile));
+
+ EXPECT_TRUE(
+ ProfileMatchesFullName(base::UTF8ToUTF16("First Middle Last"), profile));
+
+ EXPECT_TRUE(
+ ProfileMatchesFullName(base::UTF8ToUTF16("First M Last"), profile));
+
+ EXPECT_TRUE(
+ ProfileMatchesFullName(base::UTF8ToUTF16("First M. Last"), profile));
+
+ EXPECT_FALSE(
+ ProfileMatchesFullName(base::UTF8ToUTF16("Kirby Puckett"), profile));
+}
+
} // namespace data_util
} // namespace autofill
« no previous file with comments | « components/autofill/core/browser/autofill_data_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698