Index: third_party/WebKit/Source/core/layout/ng/ng_units_test.cc |
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_units_test.cc b/third_party/WebKit/Source/core/layout/ng/ng_units_test.cc |
index 10d4834456411bd1f4a4bd3bb2f2f61b808a836c..a9063d1a757b1d29b140c4863affe036115adcff 100644 |
--- a/third_party/WebKit/Source/core/layout/ng/ng_units_test.cc |
+++ b/third_party/WebKit/Source/core/layout/ng/ng_units_test.cc |
@@ -100,6 +100,22 @@ TEST(NGUnitsTest, ConvertPhysicalStrutToLogical) { |
EXPECT_EQ(right, logical.block_start); |
} |
+TEST(NGUnitsTest, ShrinkToFit) { |
+ MinAndMaxContentSizes sizes; |
+ |
+ sizes.min_content = LayoutUnit(100); |
+ sizes.max_content = LayoutUnit(200); |
+ EXPECT_EQ(LayoutUnit(200), sizes.ShrinkToFit(LayoutUnit(300))); |
+ |
+ sizes.min_content = LayoutUnit(100); |
+ sizes.max_content = LayoutUnit(300); |
+ EXPECT_EQ(LayoutUnit(200), sizes.ShrinkToFit(LayoutUnit(200))); |
+ |
+ sizes.min_content = LayoutUnit(200); |
+ sizes.max_content = LayoutUnit(300); |
+ EXPECT_EQ(LayoutUnit(200), sizes.ShrinkToFit(LayoutUnit(100))); |
+} |
+ |
} // namespace |
} // namespace blink |