summaryrefslogtreecommitdiffstats
path: root/ui/base/text/text_elider_unittest.cc
diff options
context:
space:
mode:
Diffstat (limited to 'ui/base/text/text_elider_unittest.cc')
-rw-r--r--ui/base/text/text_elider_unittest.cc27
1 files changed, 0 insertions, 27 deletions
diff --git a/ui/base/text/text_elider_unittest.cc b/ui/base/text/text_elider_unittest.cc
index 60ab1f7..0ff70e4 100644
--- a/ui/base/text/text_elider_unittest.cc
+++ b/ui/base/text/text_elider_unittest.cc
@@ -547,31 +547,4 @@ TEST(TextEliderTest, ElideRectangleWide32) {
EXPECT_EQ(out, output);
}
-TEST(TextEliderTest, TruncateString) {
- string16 string = ASCIIToUTF16("foooooey bxxxar baz");
-
- // Make sure it doesn't modify the string if length > string length.
- EXPECT_EQ(string, ui::TruncateString(string, 100));
-
- // Test no characters.
- EXPECT_EQ(L"", UTF16ToWide(ui::TruncateString(string, 0)));
-
- // Test 1 character.
- EXPECT_EQ(L"\x2026", UTF16ToWide(ui::TruncateString(string, 1)));
-
- // Test adds ... at right spot when there is enough room to break at a
- // word boundary.
- EXPECT_EQ(L"foooooey\x2026", UTF16ToWide(ui::TruncateString(string, 14)));
-
- // Test adds ... at right spot when there is not enough space in first word.
- EXPECT_EQ(L"f\x2026", UTF16ToWide(ui::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", UTF16ToWide(ui::TruncateString(string, 11)));
-
- // Test completely truncates string if break is on initial whitespace.
- EXPECT_EQ(L"\x2026", UTF16ToWide(ui::TruncateString(ASCIIToUTF16(" "), 2)));
-}
-
} // namespace ui