OLD | NEW |
| (Empty) |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #include "core/layout/ng/ng_min_max_content_size.h" | |
6 | |
7 #include "testing/gtest/include/gtest/gtest.h" | |
8 | |
9 namespace blink { | |
10 | |
11 namespace { | |
12 | |
13 TEST(NGUnitsTest, ShrinkToFit) { | |
14 MinMaxContentSize sizes; | |
15 | |
16 sizes.min_content = LayoutUnit(100); | |
17 sizes.max_content = LayoutUnit(200); | |
18 EXPECT_EQ(LayoutUnit(200), sizes.ShrinkToFit(LayoutUnit(300))); | |
19 | |
20 sizes.min_content = LayoutUnit(100); | |
21 sizes.max_content = LayoutUnit(300); | |
22 EXPECT_EQ(LayoutUnit(200), sizes.ShrinkToFit(LayoutUnit(200))); | |
23 | |
24 sizes.min_content = LayoutUnit(200); | |
25 sizes.max_content = LayoutUnit(300); | |
26 EXPECT_EQ(LayoutUnit(200), sizes.ShrinkToFit(LayoutUnit(100))); | |
27 } | |
28 | |
29 } // namespace | |
30 | |
31 } // namespace blink | |
OLD | NEW |