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

Unified Diff: ui/gfx/render_text_unittest.cc

Issue 1037573006: Fix accidental updates of host's baselines_ in Elide(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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_harfbuzz.cc ('k') | no next file » | 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 42825579ec6cb0b68fe701de431a2c1444d5c1f7..d2101932855ae94268a62979d86b2e1f697b57b2 100644
--- a/ui/gfx/render_text_unittest.cc
+++ b/ui/gfx/render_text_unittest.cc
@@ -719,6 +719,21 @@ TEST_F(RenderTextTest, TruncatedCursorMovementRTL) {
RunMoveCursorLeftRightTest(render_text.get(), expected, CURSOR_RIGHT);
}
+TEST_F(RenderTextTest, HarfBuzz_ElideEmail) {
msw 2015/03/25 23:17:09 nit: Rename Elide[d]Email, move after ElidedText o
Jun Mukai 2015/03/26 16:34:12 Done.
+ scoped_ptr<RenderText> render_text(RenderText::CreateInstance());
+ render_text->SetText(ASCIIToUTF16("test@example.com"));
+ const gfx::Size size = render_text->GetStringSize();
+
+ const base::string16 long_email =
+ ASCIIToUTF16("longemailaddresstest@example.com");
+ render_text->SetText(long_email);
+ render_text->SetElideBehavior(ELIDE_EMAIL);
+ render_text->SetDisplayRect(gfx::Rect(size));
+ EXPECT_GE(size.width(), render_text->GetStringSize().width());
+ EXPECT_NE(long_email, render_text->GetDisplayText());
msw 2015/03/25 23:17:09 optional nit: you can remove this, the statement b
Jun Mukai 2015/03/26 16:34:12 Done.
+ EXPECT_GT(long_email.size(), render_text->GetDisplayText().size());
+}
+
TEST_F(RenderTextTest, GetDisplayTextDirection) {
struct {
const wchar_t* text;
« no previous file with comments | « ui/gfx/render_text_harfbuzz.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698