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

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

Issue 1080883002: Remove some more bad ASCII-centric autofill code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix test Created 5 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 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 "base/basictypes.h" 5 #include "base/basictypes.h"
6 #include "base/format_macros.h" 6 #include "base/format_macros.h"
7 #include "base/guid.h" 7 #include "base/guid.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/memory/scoped_vector.h" 9 #include "base/memory/scoped_vector.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 1283 matching lines...) Expand 10 before | Expand all | Expand 10 after
1294 TEST(AutofillProfileTest, OverwriteOrAppendNames) { 1294 TEST(AutofillProfileTest, OverwriteOrAppendNames) {
1295 std::vector<TestCase> test_cases; 1295 std::vector<TestCase> test_cases;
1296 1296
1297 // Identical name. 1297 // Identical name.
1298 test_cases.push_back(TestCase(NameParts("Marion", "Mitchell", "Morrison"), 1298 test_cases.push_back(TestCase(NameParts("Marion", "Mitchell", "Morrison"),
1299 NameParts("Marion", "Mitchell", "Morrison"), 1299 NameParts("Marion", "Mitchell", "Morrison"),
1300 NameParts("Marion", "Mitchell", "Morrison"))); 1300 NameParts("Marion", "Mitchell", "Morrison")));
1301 test_cases.push_back(TestCase(NameParts("Marion", "Mitchell", "Morrison"), 1301 test_cases.push_back(TestCase(NameParts("Marion", "Mitchell", "Morrison"),
1302 NameParts("MARION", "MITCHELL", "MORRISON"), 1302 NameParts("MARION", "MITCHELL", "MORRISON"),
1303 NameParts("Marion", "Mitchell", "Morrison"))); 1303 NameParts("Marion", "Mitchell", "Morrison")));
1304 // Capital A with acute versus lower case a with acute. 1304 // Capital A with grave versus lower case a with grave.
1305 test_cases.push_back(TestCase(NameParts("M\xc3\xa1rion", "M", "Morrison"), 1305 test_cases.push_back(TestCase(NameParts("Màrion", "M", "Morrison"),
1306 NameParts("M\xc3\x81rion", "M", "Morrison"), 1306 NameParts("MÀrion", "M", "Morrison"),
1307 NameParts("M\xc3\x81rion", "M", "Morrison"))); 1307 NameParts("Màrion", "M", "Morrison")));
1308 1308
1309 // A parse that has a two-word last name should take precedence over a 1309 // A parse that has a two-word last name should take precedence over a
1310 // parse that assumes the two names are a middle and a last name. 1310 // parse that assumes the two names are a middle and a last name.
1311 test_cases.push_back(TestCase(NameParts("Marion", "Mitchell", "Morrison"), 1311 test_cases.push_back(TestCase(NameParts("Marion", "Mitchell", "Morrison"),
1312 NameParts("Marion", "", "Mitchell Morrison"), 1312 NameParts("Marion", "", "Mitchell Morrison"),
1313 NameParts("Marion", "", "Mitchell Morrison"))); 1313 NameParts("Marion", "", "Mitchell Morrison")));
1314 test_cases.push_back(TestCase(NameParts("Marion", "", "Mitchell Morrison"), 1314 test_cases.push_back(TestCase(NameParts("Marion", "", "Mitchell Morrison"),
1315 NameParts("Marion", "Mitchell", "Morrison"), 1315 NameParts("Marion", "Mitchell", "Morrison"),
1316 NameParts("Marion", "", "Mitchell Morrison"))); 1316 NameParts("Marion", "", "Mitchell Morrison")));
1317 1317
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
1454 AutofillProfile::CanonicalizeProfileString(ASCIIToUTF16( 1454 AutofillProfile::CanonicalizeProfileString(ASCIIToUTF16(
1455 "1600 Amphitheatre, Pkwy."))); 1455 "1600 Amphitheatre, Pkwy.")));
1456 1456
1457 // Unicode punctuation (hyphen and space), multiple spaces collapsed. 1457 // Unicode punctuation (hyphen and space), multiple spaces collapsed.
1458 EXPECT_EQ(ASCIIToUTF16("mid island plaza"), 1458 EXPECT_EQ(ASCIIToUTF16("mid island plaza"),
1459 AutofillProfile::CanonicalizeProfileString(base::WideToUTF16( 1459 AutofillProfile::CanonicalizeProfileString(base::WideToUTF16(
1460 L"Mid\x2013Island\x2003 Plaza"))); 1460 L"Mid\x2013Island\x2003 Plaza")));
1461 } 1461 }
1462 1462
1463 } // namespace autofill 1463 } // namespace autofill
OLDNEW
« no previous file with comments | « components/autofill/core/browser/autofill_field_unittest.cc ('k') | components/autofill/core/browser/contact_info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698