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

Unified Diff: ui/views/controls/styled_label_unittest.cc

Issue 2722503005: Add bottom border to StyledLabel. (Closed)
Patch Set: Addressed reviewer comments Created 3 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/views/controls/styled_label.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/styled_label_unittest.cc
diff --git a/ui/views/controls/styled_label_unittest.cc b/ui/views/controls/styled_label_unittest.cc
index 78b7238ea39d1bc8e77b066747cb618f9e1c238f..00f16052b78fd10b10f8a99bc5db703585041314 100644
--- a/ui/views/controls/styled_label_unittest.cc
+++ b/ui/views/controls/styled_label_unittest.cc
@@ -562,4 +562,21 @@ TEST_F(StyledLabelTest, CacheSize) {
EXPECT_NE(first_child_after_text_update, first_child_after_layout);
}
+TEST_F(StyledLabelTest, Border) {
+ const std::string text("One line");
+ InitStyledLabel(text);
+ Label label(ASCIIToUTF16(text));
+ gfx::Size label_preferred_size = label.GetPreferredSize();
+ styled()->SetBorder(CreateEmptyBorder(5 /* top */, 10 /* left */,
+ 6 /* bottom */, 20 /*right*/));
msw 2017/03/08 16:34:25 optional nit: use consistent spacing inside these
dvadym 2017/03/08 17:08:22 Done.
+ styled()->SetBounds(0, 0, 1000, 0);
+ styled()->Layout();
+ EXPECT_EQ(
+ label_preferred_size.height() + 5 /*top border*/ + 6 /* bottom border */,
+ styled()->GetPreferredSize().height());
+ EXPECT_EQ(
+ label_preferred_size.width() + 10 /*left border*/ + 20 /* right border */,
+ styled()->GetPreferredSize().width());
+}
+
} // namespace views
« no previous file with comments | « ui/views/controls/styled_label.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698