OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/views/layout/box_layout.h" | 5 #include "ui/views/layout/box_layout.h" |
6 | 6 |
7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
8 #include "ui/views/test/test_views.h" | 8 #include "ui/views/test/test_views.h" |
9 #include "ui/views/view.h" | 9 #include "ui/views/view.h" |
10 | 10 |
11 namespace views { | 11 namespace views { |
12 | 12 |
13 namespace { | 13 namespace { |
14 | 14 |
15 class BoxLayoutTest : public testing::Test { | 15 class BoxLayoutTest : public testing::Test { |
16 public: | 16 public: |
17 virtual void SetUp() OVERRIDE { | 17 virtual void SetUp() override { |
18 host_.reset(new View); | 18 host_.reset(new View); |
19 } | 19 } |
20 | 20 |
21 scoped_ptr<View> host_; | 21 scoped_ptr<View> host_; |
22 }; | 22 }; |
23 | 23 |
24 } // namespace | 24 } // namespace |
25 | 25 |
26 TEST_F(BoxLayoutTest, Empty) { | 26 TEST_F(BoxLayoutTest, Empty) { |
27 BoxLayout* layout = new BoxLayout(BoxLayout::kHorizontal, 10, 10, 20); | 27 BoxLayout* layout = new BoxLayout(BoxLayout::kHorizontal, 10, 10, 20); |
(...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
604 BoxLayout* layout = new BoxLayout(BoxLayout::kHorizontal, 0, 0, 0); | 604 BoxLayout* layout = new BoxLayout(BoxLayout::kHorizontal, 0, 0, 0); |
605 host_->SetLayoutManager(layout); | 605 host_->SetLayoutManager(layout); |
606 View* v1 = new StaticSizedView(gfx::Size(20, 10)); | 606 View* v1 = new StaticSizedView(gfx::Size(20, 10)); |
607 host_->AddChildView(v1); | 607 host_->AddChildView(v1); |
608 layout->set_minimum_cross_axis_size(30); | 608 layout->set_minimum_cross_axis_size(30); |
609 | 609 |
610 EXPECT_EQ(gfx::Size(20, 30), layout->GetPreferredSize(host_.get())); | 610 EXPECT_EQ(gfx::Size(20, 30), layout->GetPreferredSize(host_.get())); |
611 } | 611 } |
612 | 612 |
613 } // namespace views | 613 } // namespace views |
OLD | NEW |