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_length_utils.h" | 5 #include "core/layout/ng/ng_length_utils.h" |
6 | 6 |
7 #include "core/layout/ng/ng_box_fragment.h" | 7 #include "core/layout/ng/ng_box_fragment.h" |
8 #include "core/layout/ng/ng_constraint_space.h" | 8 #include "core/layout/ng/ng_constraint_space.h" |
9 #include "core/layout/ng/ng_constraint_space_builder.h" | 9 #include "core/layout/ng/ng_constraint_space_builder.h" |
10 #include "core/layout/ng/ng_fragment_builder.h" | 10 #include "core/layout/ng/ng_fragment_builder.h" |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 TEST_F(NGLengthUtilsTest, testResolveInlineLength) { | 78 TEST_F(NGLengthUtilsTest, testResolveInlineLength) { |
79 EXPECT_EQ(LayoutUnit(60), ResolveInlineLength(Length(30, Percent))); | 79 EXPECT_EQ(LayoutUnit(60), ResolveInlineLength(Length(30, Percent))); |
80 EXPECT_EQ(LayoutUnit(150), ResolveInlineLength(Length(150, Fixed))); | 80 EXPECT_EQ(LayoutUnit(150), ResolveInlineLength(Length(150, Fixed))); |
81 EXPECT_EQ(LayoutUnit(0), | 81 EXPECT_EQ(LayoutUnit(0), |
82 ResolveInlineLength(Length(Auto), LengthResolveType::kMinSize)); | 82 ResolveInlineLength(Length(Auto), LengthResolveType::kMinSize)); |
83 EXPECT_EQ(LayoutUnit(200), ResolveInlineLength(Length(Auto))); | 83 EXPECT_EQ(LayoutUnit(200), ResolveInlineLength(Length(Auto))); |
84 EXPECT_EQ(LayoutUnit(200), ResolveInlineLength(Length(FillAvailable))); | 84 EXPECT_EQ(LayoutUnit(200), ResolveInlineLength(Length(FillAvailable))); |
85 | 85 |
86 EXPECT_EQ(LayoutUnit(200), | 86 EXPECT_EQ(LayoutUnit(200), |
87 ResolveInlineLength(Length(Auto), LengthResolveType::kMaxSize)); | 87 ResolveInlineLength(Length(Auto), LengthResolveType::kMaxSize)); |
88 EXPECT_EQ(LayoutUnit(200), ResolveInlineLength(Length(FillAvailable), | 88 EXPECT_EQ( |
89 LengthResolveType::kMaxSize)); | 89 LayoutUnit(200), |
| 90 ResolveInlineLength(Length(FillAvailable), LengthResolveType::kMaxSize)); |
90 MinAndMaxContentSizes sizes; | 91 MinAndMaxContentSizes sizes; |
91 sizes.min_content = LayoutUnit(30); | 92 sizes.min_content = LayoutUnit(30); |
92 sizes.max_content = LayoutUnit(40); | 93 sizes.max_content = LayoutUnit(40); |
93 EXPECT_EQ(LayoutUnit(30), | 94 EXPECT_EQ(LayoutUnit(30), |
94 ResolveInlineLength(Length(MinContent), | 95 ResolveInlineLength(Length(MinContent), |
95 LengthResolveType::kContentSize, sizes)); | 96 LengthResolveType::kContentSize, sizes)); |
96 EXPECT_EQ(LayoutUnit(40), | 97 EXPECT_EQ(LayoutUnit(40), |
97 ResolveInlineLength(Length(MaxContent), | 98 ResolveInlineLength(Length(MaxContent), |
98 LengthResolveType::kContentSize, sizes)); | 99 LengthResolveType::kContentSize, sizes)); |
99 EXPECT_EQ(LayoutUnit(40), | 100 EXPECT_EQ(LayoutUnit(40), |
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
488 EXPECT_EQ(125, GetUsedColumnWidth(4, 100, 10, 530)); | 489 EXPECT_EQ(125, GetUsedColumnWidth(4, 100, 10, 530)); |
489 EXPECT_EQ(4, GetUsedColumnCount(4, 100, 10, 530)); | 490 EXPECT_EQ(4, GetUsedColumnCount(4, 100, 10, 530)); |
490 EXPECT_EQ(100, GetUsedColumnWidth(6, 100, 10, 540)); | 491 EXPECT_EQ(100, GetUsedColumnWidth(6, 100, 10, 540)); |
491 EXPECT_EQ(5, GetUsedColumnCount(6, 100, 10, 540)); | 492 EXPECT_EQ(5, GetUsedColumnCount(6, 100, 10, 540)); |
492 EXPECT_EQ(100, GetUsedColumnWidth(0, 100, 10, 540)); | 493 EXPECT_EQ(100, GetUsedColumnWidth(0, 100, 10, 540)); |
493 EXPECT_EQ(5, GetUsedColumnCount(0, 100, 10, 540)); | 494 EXPECT_EQ(5, GetUsedColumnCount(0, 100, 10, 540)); |
494 } | 495 } |
495 | 496 |
496 } // namespace | 497 } // namespace |
497 } // namespace blink | 498 } // namespace blink |
OLD | NEW |