Index: third_party/WebKit/Source/core/layout/ng/ng_constraint_space_test.cc |
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_constraint_space_test.cc b/third_party/WebKit/Source/core/layout/ng/ng_constraint_space_test.cc |
index bb2c8a3bfd8f09c84ee8aa63af482b8a83c76002..9229e4d8c3439693cf4f1050c46ddb2ebd8554f1 100644 |
--- a/third_party/WebKit/Source/core/layout/ng/ng_constraint_space_test.cc |
+++ b/third_party/WebKit/Source/core/layout/ng/ng_constraint_space_test.cc |
@@ -40,6 +40,21 @@ TEST(NGConstraintSpaceTest, WritingMode) { |
EXPECT_EQ(FragmentNone, vert_space->BlockFragmentationType()); |
} |
+TEST(NGConstraintSpaceTest, LayoutOpportunities) { |
+ NGPhysicalSize physical_size; |
+ physical_size.width = LayoutUnit(600); |
+ physical_size.height = LayoutUnit(400); |
+ auto* physical_space = new NGPhysicalConstraintSpace(physical_size); |
+ auto* space = new NGConstraintSpace(HorizontalTopBottom, physical_space); |
+ |
+ bool for_inline_or_bfc = false; |
+ auto iterator = space->LayoutOpportunities(NGClearNone, for_inline_or_bfc); |
+ |
+ auto firstOpportunity = iterator.Next(); |
+ EXPECT_EQ(LayoutUnit(600), firstOpportunity->Size().inline_size); |
+ EXPECT_EQ(LayoutUnit(400), firstOpportunity->Size().block_size); |
+} |
+ |
} // namespace |
} // namespace blink |