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

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

Issue 371633002: LabelButton: cache the last computed preferred size (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 5 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
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 ea81b22acaf3d26af4205d95980d02b31fd78a78..0cec2b39c7cbf252e7b844fc82c567d45a0140d7 100644
--- a/ui/views/controls/button/label_button_unittest.cc
+++ b/ui/views/controls/button/label_button_unittest.cc
@@ -69,11 +69,11 @@ TEST_F(LabelButtonTest, Label) {
EXPECT_GT(button.GetPreferredSize().width(), long_text_width);
// Clamp the size to a maximum value.
- button.set_max_size(gfx::Size(long_text_width, 1));
+ button.SetMaxSize(gfx::Size(long_text_width, 1));
EXPECT_EQ(button.GetPreferredSize(), gfx::Size(long_text_width, 1));
// Clear the monotonically increasing minimum size.
- button.set_min_size(gfx::Size());
+ button.SetMinSize(gfx::Size());
EXPECT_GT(button.GetPreferredSize().width(), short_text_width);
EXPECT_LT(button.GetPreferredSize().width(), long_text_width);
}
@@ -101,11 +101,11 @@ TEST_F(LabelButtonTest, Image) {
EXPECT_GT(button.GetPreferredSize().height(), large_size);
// Clamp the size to a maximum value.
- button.set_max_size(gfx::Size(large_size, 1));
+ button.SetMaxSize(gfx::Size(large_size, 1));
EXPECT_EQ(button.GetPreferredSize(), gfx::Size(large_size, 1));
// Clear the monotonically increasing minimum size.
- button.set_min_size(gfx::Size());
+ button.SetMinSize(gfx::Size());
EXPECT_GT(button.GetPreferredSize().width(), small_size);
EXPECT_LT(button.GetPreferredSize().width(), large_size);
}
@@ -157,11 +157,11 @@ TEST_F(LabelButtonTest, LabelAndImage) {
EXPECT_GT(button.GetPreferredSize().height(), image_size);
// Clamp the size to a maximum value.
- button.set_max_size(gfx::Size(image_size, 1));
+ button.SetMaxSize(gfx::Size(image_size, 1));
EXPECT_EQ(button.GetPreferredSize(), gfx::Size(image_size, 1));
// Clear the monotonically increasing minimum size.
- button.set_min_size(gfx::Size());
+ button.SetMinSize(gfx::Size());
EXPECT_LT(button.GetPreferredSize().width(), text_width);
EXPECT_LT(button.GetPreferredSize().width(), image_size);
EXPECT_LT(button.GetPreferredSize().height(), image_size);
@@ -184,7 +184,7 @@ TEST_F(LabelButtonTest, FontList) {
// The button returns to its original size when the minimal size is cleared
// and the original font size is restored.
- button.set_min_size(gfx::Size());
+ button.SetMinSize(gfx::Size());
button.SetFontList(original_font_list);
EXPECT_EQ(original_width, button.GetPreferredSize().width());
EXPECT_EQ(original_height, button.GetPreferredSize().height());

Powered by Google App Engine
This is Rietveld 408576698