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

Side by Side Diff: components/autofill/core/browser/autofill_profile_unittest.cc

Issue 1989173005: [Autofill] Dedupe similar profiles on insertion. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments Created 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/autofill/core/browser/autofill_profile.h" 5 #include "components/autofill/core/browser/autofill_profile.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 10
(...skipping 1245 matching lines...) Expand 10 before | Expand all | Expand 10 after
1256 1256
1257 // The first, middle and last names should be kept and name full should be 1257 // The first, middle and last names should be kept and name full should be
1258 // added. 1258 // added.
1259 EXPECT_EQ(base::ASCIIToUTF16("Marion"), a.GetRawInfo(NAME_FIRST)); 1259 EXPECT_EQ(base::ASCIIToUTF16("Marion"), a.GetRawInfo(NAME_FIRST));
1260 EXPECT_EQ(base::ASCIIToUTF16("Mitchell"), a.GetRawInfo(NAME_MIDDLE)); 1260 EXPECT_EQ(base::ASCIIToUTF16("Mitchell"), a.GetRawInfo(NAME_MIDDLE));
1261 EXPECT_EQ(base::ASCIIToUTF16("Morrison"), a.GetRawInfo(NAME_LAST)); 1261 EXPECT_EQ(base::ASCIIToUTF16("Morrison"), a.GetRawInfo(NAME_LAST));
1262 EXPECT_EQ(base::ASCIIToUTF16("Marion Mitchell Morrison"), 1262 EXPECT_EQ(base::ASCIIToUTF16("Marion Mitchell Morrison"),
1263 a.GetRawInfo(NAME_FULL)); 1263 a.GetRawInfo(NAME_FULL));
1264 } 1264 }
1265 1265
1266 // Tests that PrimaryValues of two similar profiles with different
1267 // punctuation and case are equal.
1268 TEST(AutofillProfileTest, PrimaryValue_SimilarProfiles) {
1269 AutofillProfile profile1(base::GenerateGUID(), "https://www.example.com/");
1270 test::SetProfileInfo(&profile1, "Marion", "Mitchell", "Morrison",
1271 "marion@me.xyz", "Fox", "123 Zoo St.", "unit 5",
1272 "Hollywood", "CA", "91601", "US", "12345678910");
1273
1274 AutofillProfile profile2(base::GenerateGUID(), "https://www.example.com/");
1275 test::SetProfileInfo(&profile2, "marion", "mitchell", "morrison",
1276 "marion@me.xyz", "Fox", "123, Zoo St", "unit 5",
1277 "hollywood", "CA", "91601", "US", "12345678910");
1278
1279 EXPECT_EQ(profile1.PrimaryValue("en-US"), profile2.PrimaryValue("en-US"));
1280 }
1281
1266 } // namespace autofill 1282 } // namespace autofill
OLDNEW
« no previous file with comments | « components/autofill/core/browser/autofill_profile.cc ('k') | components/autofill/core/browser/personal_data_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698