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

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

Issue 2525033002: Deprecate NGPhysicalConstraintSpace (Closed)
Patch Set: update TestExpectations Created 4 years 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_block_layout_algorithm_test.cc
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm_test.cc b/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm_test.cc
index 39408108346b99b5224400f87d54c5b1e11ac202..7ba9e05c357b619964ac23c4415092776e0fa0d5 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm_test.cc
+++ b/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm_test.cc
@@ -20,11 +20,11 @@ namespace {
NGConstraintSpace* ConstructConstraintSpace(NGWritingMode writing_mode,
TextDirection direction,
NGLogicalSize size) {
- NGConstraintSpaceBuilder builder(writing_mode);
- builder.SetAvailableSize(size).SetPercentageResolutionSize(size);
-
- return new NGConstraintSpace(writing_mode, direction,
- builder.ToConstraintSpace());
+ return NGConstraintSpaceBuilder(writing_mode)
+ .SetAvailableSize(size)
+ .SetPercentageResolutionSize(size)
+ .SetTextDirection(direction)
+ .ToConstraintSpace();
}
class NGBlockLayoutAlgorithmTest : public ::testing::Test {
@@ -167,14 +167,14 @@ TEST_F(NGBlockLayoutAlgorithmTest, CollapsingMarginsCase1) {
div1->SetFirstChild(div2);
- NGLogicalSize size(LayoutUnit(100), NGSizeIndefinite);
- NGConstraintSpaceBuilder builder(kHorizontalTopBottom);
- builder.SetAvailableSize(size)
- .SetPercentageResolutionSize(size)
- .SetIsNewFormattingContext(true);
- auto* space = new NGConstraintSpace(kHorizontalTopBottom, LTR,
- builder.ToConstraintSpace());
-
+ auto* space =
+ NGConstraintSpaceBuilder(kHorizontalTopBottom)
+ .SetAvailableSize(NGLogicalSize(LayoutUnit(100), NGSizeIndefinite))
+ .SetPercentageResolutionSize(
+ NGLogicalSize(LayoutUnit(100), NGSizeIndefinite))
+ .SetTextDirection(LTR)
+ .SetIsNewFormattingContext(true)
+ .ToConstraintSpace();
NGPhysicalFragment* frag = RunBlockLayoutAlgorithm(space, div1);
EXPECT_TRUE(frag->MarginStrut().IsEmpty());

Powered by Google App Engine
This is Rietveld 408576698