OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "testing/gtest/include/gtest/gtest.h" | 5 #include "testing/gtest/include/gtest/gtest.h" |
6 #include "views/grid_layout.h" | 6 #include "views/layout/grid_layout.h" |
7 #include "views/view.h" | 7 #include "views/view.h" |
8 | 8 |
9 using views::ColumnSet; | 9 using views::ColumnSet; |
10 using views::GridLayout; | 10 using views::GridLayout; |
11 using views::View; | 11 using views::View; |
12 | 12 |
13 static void ExpectViewBoundsEquals(int x, int y, int w, int h, | 13 static void ExpectViewBoundsEquals(int x, int y, int w, int h, |
14 const View* view) { | 14 const View* view) { |
15 EXPECT_EQ(x, view->x()); | 15 EXPECT_EQ(x, view->x()); |
16 EXPECT_EQ(y, view->y()); | 16 EXPECT_EQ(y, view->y()); |
(...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
599 // ordering doesn't influence sizing behaviour. | 599 // ordering doesn't influence sizing behaviour. |
600 layout->StartRow(0, 2); | 600 layout->StartRow(0, 2); |
601 View* view3 = new FlexibleView(40); | 601 View* view3 = new FlexibleView(40); |
602 layout->AddView(view3, 1, 1, GridLayout::FILL, GridLayout::LEADING); | 602 layout->AddView(view3, 1, 1, GridLayout::FILL, GridLayout::LEADING); |
603 | 603 |
604 // We expect a height of 50: 30 from the variable width view in the first row | 604 // We expect a height of 50: 30 from the variable width view in the first row |
605 // plus 20 from the statically sized view in the second row. The flexible | 605 // plus 20 from the statically sized view in the second row. The flexible |
606 // view in the third row should contribute no height. | 606 // view in the third row should contribute no height. |
607 EXPECT_EQ(gfx::Size(20, 50), layout->GetPreferredSize(&host)); | 607 EXPECT_EQ(gfx::Size(20, 50), layout->GetPreferredSize(&host)); |
608 } | 608 } |
OLD | NEW |