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

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

Issue 1029593004: Do not break lines when width is not specified. (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/views/controls/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/label_unittest.cc
diff --git a/ui/views/controls/label_unittest.cc b/ui/views/controls/label_unittest.cc
index 9dd2733413b3fdffd64817ae9fdeabadc11a1e7e..ecdab5288faef6147db1d6301f2626f3a1e29998 100644
--- a/ui/views/controls/label_unittest.cc
+++ b/ui/views/controls/label_unittest.cc
@@ -358,6 +358,17 @@ TEST_F(LabelTest, MultilineSmallAvailableWidthSizing) {
EXPECT_GT(label.GetHeightForWidth(i), 0);
}
+// Verifies if SetAllowCharacterBreak(true) doesn't change the preferred size.
+// See crbug.com/469559
+TEST_F(LabelTest, PreferredSizeForAllowCharacterBreak) {
+ Label label(base::ASCIIToUTF16("Example"));
+ gfx::Size preferred_size = label.GetPreferredSize();
+
+ label.SetMultiLine(true);
+ label.SetAllowCharacterBreak(true);
+ EXPECT_EQ(preferred_size, label.GetPreferredSize());
+}
+
TEST_F(LabelTest, MultiLineSizing) {
Label label;
label.SetFocusable(false);
« no previous file with comments | « ui/views/controls/label.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698