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

Side by Side Diff: third_party/WebKit/Source/core/layout/ng/ng_units_test.cc

Issue 2528433006: [LayoutNG] Unit tests for MinAndMaxContentSizes::ShrinkToFit(). (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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/layout/ng/ng_units.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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" 7 #include "platform/text/TextDirection.h"
8 #include "core/layout/ng/ng_writing_mode.h" 8 #include "core/layout/ng/ng_writing_mode.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 93
94 logical = physical.ConvertToLogical(VerticalRightLeft, LTR); 94 logical = physical.ConvertToLogical(VerticalRightLeft, LTR);
95 EXPECT_EQ(top, logical.inline_start); 95 EXPECT_EQ(top, logical.inline_start);
96 EXPECT_EQ(right, logical.block_start); 96 EXPECT_EQ(right, logical.block_start);
97 97
98 logical = physical.ConvertToLogical(VerticalRightLeft, RTL); 98 logical = physical.ConvertToLogical(VerticalRightLeft, RTL);
99 EXPECT_EQ(bottom, logical.inline_start); 99 EXPECT_EQ(bottom, logical.inline_start);
100 EXPECT_EQ(right, logical.block_start); 100 EXPECT_EQ(right, logical.block_start);
101 } 101 }
102 102
103 TEST(NGUnitsTest, ShrinkToFit) {
104 MinAndMaxContentSizes sizes;
105
106 sizes.min_content = LayoutUnit(100);
107 sizes.max_content = LayoutUnit(200);
108 EXPECT_EQ(LayoutUnit(200), sizes.ShrinkToFit(LayoutUnit(300)));
109
110 sizes.min_content = LayoutUnit(100);
111 sizes.max_content = LayoutUnit(300);
112 EXPECT_EQ(LayoutUnit(200), sizes.ShrinkToFit(LayoutUnit(200)));
113
114 sizes.min_content = LayoutUnit(200);
115 sizes.max_content = LayoutUnit(300);
116 EXPECT_EQ(LayoutUnit(200), sizes.ShrinkToFit(LayoutUnit(100)));
117 }
118
103 } // namespace 119 } // namespace
104 120
105 } // namespace blink 121 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/ng/ng_units.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698