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

Unified Diff: third_party/WebKit/Source/core/layout/ng/ng_constraint_space_test.cc

Issue 2286403004: [LayoutNG] Initial NGLayoutOpportunityIterator implementation (Closed)
Patch Set: Fix typo Created 4 years, 4 months 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
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

Powered by Google App Engine
This is Rietveld 408576698