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

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

Issue 342833002: [Password Generation] Update Aura UI (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 d360aedb1b02d9fdd3b2b3143ffed75d388063a7..2e2425a00f62498aecf7417995b943c1b0e67f14 100644
--- a/ui/views/controls/styled_label_unittest.cc
+++ b/ui/views/controls/styled_label_unittest.cc
@@ -405,6 +405,16 @@ TEST_F(StyledLabelTest, SetBaseFontList) {
EXPECT_EQ(label.GetPreferredSize().width(), styled()->width());
}
+TEST_F(StyledLabelTest, LineHeightMultiplier) {
+ const std::string text("one\ntwo\nthree");
+ InitStyledLabel(text);
+ int default_height = styled()->GetHeightForWidth(100);
+ styled()->SetLineHeightMultiplier(1.2);
+ // Can't directly multiply the total height because rounding happens per line.
+ EXPECT_EQ(static_cast<int>((default_height / 3) * 1.2) * 3,
+ styled()->GetHeightForWidth(100));
+}
+
TEST_F(StyledLabelTest, HandleEmptyLayout) {
const std::string text("This is a test block of text.");
InitStyledLabel(text);
« 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