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

Unified 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, 1 month 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« 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