OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |