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

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

Issue 2519263002: [layout-ng] Convert ng_block_layout_algorithm to yield to the coordinator (Closed)
Patch Set: sync to head 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 7ba9e05c357b619964ac23c4415092776e0fa0d5..195b4b0a4bce9376fedcffa2aa5d7709c6723dfe 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
@@ -9,6 +9,7 @@
#include "core/layout/ng/ng_constraint_space_builder.h"
#include "core/layout/ng/ng_physical_fragment_base.h"
#include "core/layout/ng/ng_physical_fragment.h"
+#include "core/layout/ng/ng_layout_coordinator.h"
#include "core/layout/ng/ng_length_utils.h"
#include "core/layout/ng/ng_units.h"
#include "core/style/ComputedStyle.h"
@@ -33,11 +34,18 @@ class NGBlockLayoutAlgorithmTest : public ::testing::Test {
NGPhysicalFragment* RunBlockLayoutAlgorithm(NGConstraintSpace* space,
NGBlockNode* first_child) {
- NGBlockLayoutAlgorithm algorithm(style_, first_child, space);
- NGPhysicalFragmentBase* frag;
- while (!algorithm.Layout(nullptr, &frag, nullptr))
- continue;
- return toNGPhysicalFragment(frag);
+ NGBlockNode parent(style_.get());
+ parent.SetFirstChild(first_child);
+
+ NGLayoutCoordinator coordinator(&parent, space);
+ NGPhysicalFragmentBase* fragment;
+ coordinator.Tick(&fragment);
+ EXPECT_EQ(kBlockLayoutAlgorithm,
+ coordinator.GetAlgorithmStackForTesting()[0]->algorithmType());
+ while (!coordinator.Tick(&fragment))
+ ;
+
+ return toNGPhysicalFragment(fragment);
}
RefPtr<ComputedStyle> style_;

Powered by Google App Engine
This is Rietveld 408576698