summaryrefslogtreecommitdiffstats
path: root/app/l10n_util_unittest.cc
diff options
context:
space:
mode:
authorevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-10 19:06:21 +0000
committerevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-10 19:06:21 +0000
commit52fcf3c789f31c2538fc94240d269f0e56ff6087 (patch)
tree7debd5844f9edda7fa456824d100714006293cad /app/l10n_util_unittest.cc
parenta08e94a424db1cecf68845f5052fc9924ccc3b6a (diff)
downloadchromium_src-52fcf3c789f31c2538fc94240d269f0e56ff6087.zip
chromium_src-52fcf3c789f31c2538fc94240d269f0e56ff6087.tar.gz
chromium_src-52fcf3c789f31c2538fc94240d269f0e56ff6087.tar.bz2
wstrings: make l10n_util::TruncateString use string16
BUG=23581 Review URL: http://codereview.chromium.org/5742006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@68875 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'app/l10n_util_unittest.cc')
-rw-r--r--app/l10n_util_unittest.cc17
1 files changed, 10 insertions, 7 deletions
diff --git a/app/l10n_util_unittest.cc b/app/l10n_util_unittest.cc
index 8d48813..fa4cc24 100644
--- a/app/l10n_util_unittest.cc
+++ b/app/l10n_util_unittest.cc
@@ -61,30 +61,33 @@ TEST_F(L10nUtilTest, DISABLED_GetString) {
#endif // defined(OS_WIN)
TEST_F(L10nUtilTest, TruncateString) {
- std::wstring string(L"foooooey bxxxar baz");
+ string16 string = ASCIIToUTF16("foooooey bxxxar baz");
// Make sure it doesn't modify the string if length > string length.
EXPECT_EQ(string, l10n_util::TruncateString(string, 100));
// Test no characters.
- EXPECT_EQ(L"", l10n_util::TruncateString(string, 0));
+ EXPECT_EQ(L"", UTF16ToWide(l10n_util::TruncateString(string, 0)));
// Test 1 character.
- EXPECT_EQ(L"\x2026", l10n_util::TruncateString(string, 1));
+ EXPECT_EQ(L"\x2026", UTF16ToWide(l10n_util::TruncateString(string, 1)));
// Test adds ... at right spot when there is enough room to break at a
// word boundary.
- EXPECT_EQ(L"foooooey\x2026", l10n_util::TruncateString(string, 14));
+ EXPECT_EQ(L"foooooey\x2026",
+ UTF16ToWide(l10n_util::TruncateString(string, 14)));
// Test adds ... at right spot when there is not enough space in first word.
- EXPECT_EQ(L"f\x2026", l10n_util::TruncateString(string, 2));
+ EXPECT_EQ(L"f\x2026", UTF16ToWide(l10n_util::TruncateString(string, 2)));
// Test adds ... at right spot when there is not enough room to break at a
// word boundary.
- EXPECT_EQ(L"foooooey\x2026", l10n_util::TruncateString(string, 11));
+ EXPECT_EQ(L"foooooey\x2026",
+ UTF16ToWide(l10n_util::TruncateString(string, 11)));
// Test completely truncates string if break is on initial whitespace.
- EXPECT_EQ(L"\x2026", l10n_util::TruncateString(L" ", 2));
+ EXPECT_EQ(L"\x2026",
+ UTF16ToWide(l10n_util::TruncateString(ASCIIToUTF16(" "), 2)));
}
void SetICUDefaultLocale(const std::string& locale_string) {