| Index: ash/common/system/tray/tri_view_unittest.cc
|
| diff --git a/ash/common/system/tray/tri_view_unittest.cc b/ash/common/system/tray/tri_view_unittest.cc
|
| index 4f9cc3f270aef226b6919f15a5fef08041ab95d1..6e2885fd8fc87d3cc67fc25a2f8e9c552b378d73 100644
|
| --- a/ash/common/system/tray/tri_view_unittest.cc
|
| +++ b/ash/common/system/tray/tri_view_unittest.cc
|
| @@ -34,6 +34,9 @@ class TriViewTest : public testing::Test {
|
| TriViewTest();
|
|
|
| protected:
|
| + // Convenience function to get the minimum height of |container|.
|
| + int GetMinHeight(TriView::Container container) const;
|
| +
|
| // Returns the bounds of |child| in the coordinate space of
|
| // |tri_view_|.
|
| gfx::Rect GetBoundsInHost(const views::View* child) const;
|
| @@ -50,6 +53,10 @@ class TriViewTest : public testing::Test {
|
|
|
| TriViewTest::TriViewTest() : tri_view_(base::MakeUnique<TriView>()) {}
|
|
|
| +int TriViewTest::GetMinHeight(TriView::Container container) const {
|
| + return tri_view_->GetMinSize(container).height();
|
| +}
|
| +
|
| gfx::Rect TriViewTest::GetBoundsInHost(const views::View* child) const {
|
| gfx::RectF rect_f(child->bounds());
|
| views::View::ConvertRectToTarget(child, tri_view_.get(), &rect_f);
|
| @@ -356,4 +363,18 @@ TEST_F(TriViewTest, ChildViewsPreferredSizeChanged) {
|
| EXPECT_EQ(child_view->GetPreferredSize(), child_view->size());
|
| }
|
|
|
| +TEST_F(TriViewTest, SetMinHeight) {
|
| + const int kMinHeight = 10;
|
| +
|
| + EXPECT_NE(kMinHeight, GetMinHeight(TriView::Container::START));
|
| + EXPECT_NE(kMinHeight, GetMinHeight(TriView::Container::CENTER));
|
| + EXPECT_NE(kMinHeight, GetMinHeight(TriView::Container::END));
|
| +
|
| + tri_view_->SetMinHeight(kMinHeight);
|
| +
|
| + EXPECT_EQ(kMinHeight, GetMinHeight(TriView::Container::START));
|
| + EXPECT_EQ(kMinHeight, GetMinHeight(TriView::Container::CENTER));
|
| + EXPECT_EQ(kMinHeight, GetMinHeight(TriView::Container::END));
|
| +}
|
| +
|
| } // namespace ash
|
|
|