| 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 dcf3227070e2e16bca2499e68a4941f5b504579b..2f6bf8ac1647ac8f9e4309deedd629da4cf8ad60 100644
|
| --- a/ui/views/layout/box_layout_unittest.cc
|
| +++ b/ui/views/layout/box_layout_unittest.cc
|
| @@ -109,3 +109,20 @@ TEST_F(BoxLayoutTest, InvisibleChild) {
|
| layout_->Layout(host_.get());
|
| EXPECT_EQ(gfx::Rect(10, 10, 10, 10), v2->bounds());
|
| }
|
| +
|
| +TEST_F(BoxLayoutTest, DistributeEmptySpace) {
|
| + layout_.reset(
|
| + new views::BoxLayout(views::BoxLayout::kHorizontal, 10, 10, 10));
|
| + layout_->set_spread_blank_space(true);
|
| +
|
| + views::View* v1 = new StaticSizedView(gfx::Size(20, 20));
|
| + host_->AddChildView(v1);
|
| + views::View* v2 = new StaticSizedView(gfx::Size(10, 10));
|
| + host_->AddChildView(v2);
|
| + EXPECT_EQ(gfx::Size(60, 40), layout_->GetPreferredSize(host_.get()));
|
| +
|
| + host_->SetBounds(0, 0, 100, 40);
|
| + layout_->Layout(host_.get());
|
| + EXPECT_EQ(gfx::Rect(10, 10, 40, 20).ToString(), v1->bounds().ToString());
|
| + EXPECT_EQ(gfx::Rect(60, 10, 30, 20).ToString(), v2->bounds().ToString());
|
| +}
|
|
|