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

Unified Diff: ash/common/system/tray/tri_view_unittest.cc

Issue 2605513002: [ash-md] Changed the system info row height to 40 (instead of 48). (Closed)
Patch Set: Created 4 years 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 | « ash/common/system/tray/tri_view.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « ash/common/system/tray/tri_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698