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

Unified Diff: ui/gfx/render_text_unittest.cc

Issue 354963003: Move gfx::ElideText functionality to RenderText. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync and rebase. Created 6 years, 5 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 | « ui/gfx/render_text_pango.cc ('k') | ui/gfx/text_constants.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/render_text_unittest.cc
diff --git a/ui/gfx/render_text_unittest.cc b/ui/gfx/render_text_unittest.cc
index 3cd3b98e75e0eea0e30a426aeb57a2aefdd21ce2..3fc5aa3408abd1f9090e5103628d34c8f0ee4d2d 100644
--- a/ui/gfx/render_text_unittest.cc
+++ b/ui/gfx/render_text_unittest.cc
@@ -1267,6 +1267,18 @@ TEST_F(RenderTextTest, StringSizeSanity) {
EXPECT_GT(string_size.height(), 0);
}
+TEST_F(RenderTextTest, StringSizeLongStrings) {
+ scoped_ptr<RenderText> render_text(RenderText::CreateInstance());
+ Size previous_string_size;
+ for (size_t length = 10; length < 1000000; length *= 10) {
+ render_text->SetText(base::string16(length, 'a'));
+ const Size string_size = render_text->GetStringSize();
+ EXPECT_GT(string_size.width(), previous_string_size.width());
+ EXPECT_GT(string_size.height(), 0);
+ previous_string_size = string_size;
+ }
+}
+
// TODO(asvitkine): This test fails because PlatformFontMac uses point font
// sizes instead of pixel sizes like other implementations.
#if !defined(OS_MACOSX)
« no previous file with comments | « ui/gfx/render_text_pango.cc ('k') | ui/gfx/text_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698