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

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

Issue 2013063002: Remove diacritics when normalizing autofill profile strings for comparison. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Simplify normalization loop and expand test cases. 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
« no previous file with comments | « components/autofill/core/browser/autofill_profile_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/personal_data_manager.h" 5 #include "components/autofill/core/browser/personal_data_manager.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <memory> 10 #include <memory>
(...skipping 4178 matching lines...) Expand 10 before | Expand all | Expand 10 after
4189 {{ADDRESS_HOME_LINE1, "123, Zoo St."}, {ADDRESS_HOME_LINE2, "unit. 5"}}, 4189 {{ADDRESS_HOME_LINE1, "123, Zoo St."}, {ADDRESS_HOME_LINE2, "unit. 5"}},
4190 {{ADDRESS_HOME_LINE1, "123, Zoo St."}, {ADDRESS_HOME_LINE2, "unit. 5"}}}, 4190 {{ADDRESS_HOME_LINE1, "123, Zoo St."}, {ADDRESS_HOME_LINE2, "unit. 5"}}},
4191 4191
4192 // Tests that saving an identical profile except less punctuation in the 4192 // Tests that saving an identical profile except less punctuation in the
4193 // two address lines results in a merge and that the original address gets 4193 // two address lines results in a merge and that the original address gets
4194 // overwritten. 4194 // overwritten.
4195 {{{ADDRESS_HOME_LINE1, "123, Zoo St."}, {ADDRESS_HOME_LINE2, "unit. 5"}}, 4195 {{{ADDRESS_HOME_LINE1, "123, Zoo St."}, {ADDRESS_HOME_LINE2, "unit. 5"}},
4196 ProfileFields(), 4196 ProfileFields(),
4197 {{ADDRESS_HOME_LINE1, "123 Zoo St"}, {ADDRESS_HOME_LINE2, "unit 5"}}}, 4197 {{ADDRESS_HOME_LINE1, "123 Zoo St"}, {ADDRESS_HOME_LINE2, "unit 5"}}},
4198 4198
4199 // Tests that saving an identical profile with accented characters in
4200 // the two address lines results in a merge and that the original address
4201 // gets overwritten.
4202 {ProfileFields(),
4203 {{ADDRESS_HOME_LINE1, "123 Zôö St"}, {ADDRESS_HOME_LINE2, "üñìt 5"}},
4204 {{ADDRESS_HOME_LINE1, "123 Zôö St"}, {ADDRESS_HOME_LINE2, "üñìt 5"}}},
4205
4206 // Tests that saving an identical profile without accented characters in
4207 // the two address lines results in a merge and that the original address
4208 // gets overwritten.
4209 {{{ADDRESS_HOME_LINE1, "123 Zôö St"}, {ADDRESS_HOME_LINE2, "üñìt 5"}},
4210 ProfileFields(),
4211 {{ADDRESS_HOME_LINE1, "123 Zoo St"}, {ADDRESS_HOME_LINE2, "unit 5"}}},
4212
4199 // Tests that saving an identical profile except that the address line 1 4213 // Tests that saving an identical profile except that the address line 1
4200 // is in the address line 2 results in a merge and that the original 4214 // is in the address line 2 results in a merge and that the original
4201 // address lines do not get overwritten. 4215 // address lines do not get overwritten.
4202 {ProfileFields(), 4216 {ProfileFields(),
4203 {{ADDRESS_HOME_LINE1, "123 Zoo St, unit 5"}, {ADDRESS_HOME_LINE2, ""}}, 4217 {{ADDRESS_HOME_LINE1, "123 Zoo St, unit 5"}, {ADDRESS_HOME_LINE2, ""}},
4204 {{ADDRESS_HOME_LINE1, "123 Zoo St"}, {ADDRESS_HOME_LINE2, "unit 5"}}}, 4218 {{ADDRESS_HOME_LINE1, "123 Zoo St"}, {ADDRESS_HOME_LINE2, "unit 5"}}},
4205 4219
4206 // Tests that saving an identical profile except that the address line 2 4220 // Tests that saving an identical profile except that the address line 2
4207 // contains part of the old address line 1 results in a merge and that the 4221 // contains part of the old address line 1 results in a merge and that the
4208 // original address lines of the reference profile get overwritten. 4222 // original address lines of the reference profile get overwritten.
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
4360 EXPECT_EQ(5U, profile.use_count()); 4374 EXPECT_EQ(5U, profile.use_count());
4361 // The use date and modification dates should have been set to less than 500 4375 // The use date and modification dates should have been set to less than 500
4362 // milliseconds ago. 4376 // milliseconds ago.
4363 EXPECT_GT(base::TimeDelta::FromMilliseconds(500), 4377 EXPECT_GT(base::TimeDelta::FromMilliseconds(500),
4364 base::Time::Now() - profile.use_date()); 4378 base::Time::Now() - profile.use_date());
4365 EXPECT_GT(base::TimeDelta::FromMilliseconds(500), 4379 EXPECT_GT(base::TimeDelta::FromMilliseconds(500),
4366 base::Time::Now() - profile.modification_date()); 4380 base::Time::Now() - profile.modification_date());
4367 } 4381 }
4368 4382
4369 } // namespace autofill 4383 } // namespace autofill
OLDNEW
« no previous file with comments | « components/autofill/core/browser/autofill_profile_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698