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

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

Issue 2722503005: Add bottom border to StyledLabel. (Closed)
Patch Set: Spacing fixed 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..806a75c0ca34431943c62757943b557d55522faa 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*/));
+ 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