Index: third_party/WebKit/Source/core/layout/ng/ng_min_max_content_size_test.cc |
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_min_max_content_size_test.cc b/third_party/WebKit/Source/core/layout/ng/ng_min_max_content_size_test.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..910750362f6a9580b9e64362a6616ad8decd51c9 |
--- /dev/null |
+++ b/third_party/WebKit/Source/core/layout/ng/ng_min_max_content_size_test.cc |
@@ -0,0 +1,31 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "core/layout/ng/ng_min_max_content_size.h" |
+ |
+#include "testing/gtest/include/gtest/gtest.h" |
+ |
+namespace blink { |
+ |
+namespace { |
+ |
+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 |