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

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

Issue 2722503005: Add bottom border to StyledLabel. (Closed)
Patch Set: Tiny fix 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
« ui/views/controls/styled_label.cc ('K') | « 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..d3d0f52bb8565a52a478b70742a4c422023e9d6f 100644
--- a/ui/views/controls/styled_label_unittest.cc
+++ b/ui/views/controls/styled_label_unittest.cc
@@ -562,4 +562,14 @@ TEST_F(StyledLabelTest, CacheSize) {
EXPECT_NE(first_child_after_text_update, first_child_after_layout);
}
+TEST_F(StyledLabelTest, BottomBorder) {
+ const std::string text("One line");
+ InitStyledLabel(text);
+ Label label(ASCIIToUTF16(text));
+ gfx::Size label_preferred_size = label.GetPreferredSize();
+ styled()->SetBorder(CreateEmptyBorder(0, 0, 5 /* bottom */, 0));
+ EXPECT_EQ(label_preferred_size.height() + 5 /* bottom border */,
Evan Stade 2017/03/06 22:01:29 nit: can you also set other sides of the border an
dvadym 2017/03/07 13:22:53 Done.
+ styled()->GetHeightForWidth(1000));
+}
+
} // namespace views
« ui/views/controls/styled_label.cc ('K') | « ui/views/controls/styled_label.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698