OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 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 "core/layout/ng/ng_units.h" | 5 #include "core/layout/ng/ng_units.h" |
6 | 6 |
7 #include "platform/text/TextDirection.h" | |
8 #include "core/layout/ng/ng_writing_mode.h" | |
9 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
10 | 8 |
11 namespace blink { | 9 namespace blink { |
12 | 10 |
13 namespace { | 11 namespace { |
14 | 12 |
15 TEST(NGUnitsTest, ConvertLogicalOffsetToPhysicalOffset) { | 13 TEST(NGUnitsTest, ConvertLogicalOffsetToPhysicalOffset) { |
16 NGLogicalOffset logical_offset(LayoutUnit(20), LayoutUnit(30)); | 14 NGLogicalOffset logical_offset(LayoutUnit(20), LayoutUnit(30)); |
17 NGPhysicalSize outer_size(LayoutUnit(300), LayoutUnit(400)); | 15 NGPhysicalSize outer_size(LayoutUnit(300), LayoutUnit(400)); |
18 NGPhysicalSize inner_size(LayoutUnit(5), LayoutUnit(65)); | 16 NGPhysicalSize inner_size(LayoutUnit(5), LayoutUnit(65)); |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 EXPECT_EQ(LayoutUnit(200), sizes.ShrinkToFit(LayoutUnit(200))); | 110 EXPECT_EQ(LayoutUnit(200), sizes.ShrinkToFit(LayoutUnit(200))); |
113 | 111 |
114 sizes.min_content = LayoutUnit(200); | 112 sizes.min_content = LayoutUnit(200); |
115 sizes.max_content = LayoutUnit(300); | 113 sizes.max_content = LayoutUnit(300); |
116 EXPECT_EQ(LayoutUnit(200), sizes.ShrinkToFit(LayoutUnit(100))); | 114 EXPECT_EQ(LayoutUnit(200), sizes.ShrinkToFit(LayoutUnit(100))); |
117 } | 115 } |
118 | 116 |
119 } // namespace | 117 } // namespace |
120 | 118 |
121 } // namespace blink | 119 } // namespace blink |
OLD | NEW |