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

Unified Diff: components/autofill/core/browser/contact_info_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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/autofill/core/browser/contact_info.cc ('k') | components/autofill/core/browser/credit_card.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/autofill/core/browser/contact_info_unittest.cc
diff --git a/components/autofill/core/browser/contact_info_unittest.cc b/components/autofill/core/browser/contact_info_unittest.cc
index 27d7d7663399b00c17d8722b596599926f76ac73..54e0be4704ab01d3512941ecf5ea6fb15738c024 100644
--- a/components/autofill/core/browser/contact_info_unittest.cc
+++ b/components/autofill/core/browser/contact_info_unittest.cc
@@ -14,6 +14,7 @@
#include "testing/gtest/include/gtest/gtest.h"
using base::ASCIIToUTF16;
+using base::UTF8ToUTF16;
namespace autofill {
@@ -216,6 +217,11 @@ TEST(NameInfoTest, ParsedNamesAreEqual) {
{{"Marion", "Mitchell", "Morrison"},
{"David", "Mitchell", "Morrison"},
false},
+
+ // Non-ASCII characters.
+ {{"M\xc3\xa1rion Mitchell", "", "Morrison"},
+ {"M\xc3\x81RION MITCHELL", "", "MORRISON"},
+ true},
};
for (size_t i = 0; i < arraysize(test_cases); ++i) {
@@ -224,20 +230,20 @@ TEST(NameInfoTest, ParsedNamesAreEqual) {
// Construct the starting_profile.
NameInfo starting_profile;
starting_profile.SetRawInfo(NAME_FIRST,
- ASCIIToUTF16(test_cases[i].starting_names[0]));
+ UTF8ToUTF16(test_cases[i].starting_names[0]));
starting_profile.SetRawInfo(NAME_MIDDLE,
- ASCIIToUTF16(test_cases[i].starting_names[1]));
+ UTF8ToUTF16(test_cases[i].starting_names[1]));
starting_profile.SetRawInfo(NAME_LAST,
- ASCIIToUTF16(test_cases[i].starting_names[2]));
+ UTF8ToUTF16(test_cases[i].starting_names[2]));
// Construct the additional_profile.
NameInfo additional_profile;
additional_profile.SetRawInfo(
- NAME_FIRST, ASCIIToUTF16(test_cases[i].additional_names[0]));
+ NAME_FIRST, UTF8ToUTF16(test_cases[i].additional_names[0]));
additional_profile.SetRawInfo(
- NAME_MIDDLE, ASCIIToUTF16(test_cases[i].additional_names[1]));
+ NAME_MIDDLE, UTF8ToUTF16(test_cases[i].additional_names[1]));
additional_profile.SetRawInfo(
- NAME_LAST, ASCIIToUTF16(test_cases[i].additional_names[2]));
+ NAME_LAST, UTF8ToUTF16(test_cases[i].additional_names[2]));
// Verify the test expectations.
EXPECT_EQ(test_cases[i].expected_result,
« no previous file with comments | « components/autofill/core/browser/contact_info.cc ('k') | components/autofill/core/browser/credit_card.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698