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

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: 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 PrimaryValue returns a string containing the first name, last
1267 // name, first address line and city of the profile with a whitespace in between
1268 // each part.
1269 TEST(AutofillProfileTest, PrimaryValue) {
Mathieu 2016/06/08 18:32:24 This test is mostly testing JoinString, and it's n
sebsg 2016/06/08 21:58:46 You are right, it was not very useful. I added a t
1270 AutofillProfile profile(base::GenerateGUID(), "https://www.example.com/");
1271 test::SetProfileInfo(&profile, "Marion", "Mitchell", "Morrison",
1272 "marion@me.xyz", "Fox", "123 Zoo St.", "unit 5",
1273 "Hollywood", "CA", "91601", "US", "12345678910");
1274
1275 EXPECT_EQ(base::UTF8ToUTF16("Marion Morrison 123 Zoo St. Hollywood"),
1276 profile.PrimaryValue());
1277 }
1278
1266 } // namespace autofill 1279 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698