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

Unified Diff: ui/views/layout/box_layout_unittest.cc

Issue 494273003: Add a minimum cross axis size to BoxLayout. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: initialize Created 6 years, 4 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/layout/box_layout.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/layout/box_layout_unittest.cc
diff --git a/ui/views/layout/box_layout_unittest.cc b/ui/views/layout/box_layout_unittest.cc
index 85b54f47d8b440e4e1a915dcba420ba061d84dbe..c5a5edda115db1a5ecc5666d30fa182f01d6a394 100644
--- a/ui/views/layout/box_layout_unittest.cc
+++ b/ui/views/layout/box_layout_unittest.cc
@@ -590,4 +590,24 @@ TEST_F(BoxLayoutTest, FlexShrinkVerticalWithRemainder) {
}
}
+TEST_F(BoxLayoutTest, MinimumCrossAxisVertical) {
+ BoxLayout* layout = new BoxLayout(BoxLayout::kVertical, 0, 0, 0);
+ host_->SetLayoutManager(layout);
+ View* v1 = new StaticSizedView(gfx::Size(20, 10));
+ host_->AddChildView(v1);
+ layout->set_minimum_cross_axis_size(30);
+
+ EXPECT_EQ(gfx::Size(30, 10), layout->GetPreferredSize(host_.get()));
+}
+
+TEST_F(BoxLayoutTest, MinimumCrossAxisHorizontal) {
+ BoxLayout* layout = new BoxLayout(BoxLayout::kHorizontal, 0, 0, 0);
+ host_->SetLayoutManager(layout);
+ View* v1 = new StaticSizedView(gfx::Size(20, 10));
+ host_->AddChildView(v1);
+ layout->set_minimum_cross_axis_size(30);
+
+ EXPECT_EQ(gfx::Size(20, 30), layout->GetPreferredSize(host_.get()));
+}
+
} // namespace views
« no previous file with comments | « ui/views/layout/box_layout.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698