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

Unified Diff: ui/views/controls/button/label_button_unittest.cc

Issue 2556833002: Make LabelButton::SetFontList protected. (Closed)
Patch Set: update test Created 4 years 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/button/label_button.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/button/label_button_unittest.cc
diff --git a/ui/views/controls/button/label_button_unittest.cc b/ui/views/controls/button/label_button_unittest.cc
index 4696e7353d9ac00849110b5368e9adf0ae785d5e..459991d086251c07fdf1d38e61d51fd9d4e20d54 100644
--- a/ui/views/controls/button/label_button_unittest.cc
+++ b/ui/views/controls/button/label_button_unittest.cc
@@ -291,24 +291,21 @@ TEST_F(LabelButtonTest, LabelAndImage) {
EXPECT_LT(button_->GetPreferredSize().height(), image_size);
}
-TEST_F(LabelButtonTest, FontList) {
+TEST_F(LabelButtonTest, AdjustFontSize) {
button_->SetText(base::ASCIIToUTF16("abc"));
- const gfx::FontList original_font_list = button_->GetFontList();
- const gfx::FontList large_font_list =
- original_font_list.DeriveWithSizeDelta(100);
const int original_width = button_->GetPreferredSize().width();
const int original_height = button_->GetPreferredSize().height();
// The button size increases when the font size is increased.
- button_->SetFontList(large_font_list);
+ button_->AdjustFontSize(100);
EXPECT_GT(button_->GetPreferredSize().width(), original_width);
EXPECT_GT(button_->GetPreferredSize().height(), original_height);
// The button returns to its original size when the minimal size is cleared
// and the original font size is restored.
button_->SetMinSize(gfx::Size());
- button_->SetFontList(original_font_list);
+ button_->AdjustFontSize(-100);
EXPECT_EQ(original_width, button_->GetPreferredSize().width());
EXPECT_EQ(original_height, button_->GetPreferredSize().height());
}
« no previous file with comments | « ui/views/controls/button/label_button.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698