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

Unified Diff: third_party/WebKit/Source/web/tests/NGInlineLayoutTest.cpp

Issue 2692403003: [LayoutNG] Make NGBlockLayoutAlgorithm accept a NGBlockNode. (Closed)
Patch Set: comments! Created 3 years, 10 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
« no previous file with comments | « third_party/WebKit/Source/core/layout/ng/ng_out_of_flow_layout_part_test.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/web/tests/NGInlineLayoutTest.cpp
diff --git a/third_party/WebKit/Source/web/tests/NGInlineLayoutTest.cpp b/third_party/WebKit/Source/web/tests/NGInlineLayoutTest.cpp
index 5cb230f515d75d39eecf509b25416bc59289df39..8528b8b46aec0000a0eec4a953f3c81f5c4ca2f4 100644
--- a/third_party/WebKit/Source/web/tests/NGInlineLayoutTest.cpp
+++ b/third_party/WebKit/Source/web/tests/NGInlineLayoutTest.cpp
@@ -46,17 +46,14 @@ TEST_F(NGInlineLayoutTest, BlockWithSingleTextNode) {
Element* target = document().getElementById("target");
LayoutNGBlockFlow* blockFlow = toLayoutNGBlockFlow(target->layoutObject());
NGConstraintSpace* constraintSpace = constraintSpaceForElement(blockFlow);
+ NGBlockNode* node = new NGBlockNode(blockFlow);
- NGInlineNode* inlineBox =
- new NGInlineNode(blockFlow->firstChild(), blockFlow->mutableStyle());
RefPtr<NGPhysicalFragment> fragment =
- NGBlockLayoutAlgorithm(blockFlow, blockFlow->style(), inlineBox,
- constraintSpace)
- .Layout();
+ NGBlockLayoutAlgorithm(node, constraintSpace).Layout();
EXPECT_TRUE(fragment);
String expectedText("Hello World!");
- EXPECT_EQ(expectedText, inlineBox->Text(0, 12));
+ EXPECT_EQ(expectedText, toNGInlineNode(node->FirstChild())->Text(0, 12));
}
TEST_F(NGInlineLayoutTest, BlockWithTextAndAtomicInline) {
@@ -73,19 +70,16 @@ TEST_F(NGInlineLayoutTest, BlockWithTextAndAtomicInline) {
Element* target = document().getElementById("target");
LayoutNGBlockFlow* blockFlow = toLayoutNGBlockFlow(target->layoutObject());
NGConstraintSpace* constraintSpace = constraintSpaceForElement(blockFlow);
+ NGBlockNode* node = new NGBlockNode(blockFlow);
- NGInlineNode* inlineBox =
- new NGInlineNode(blockFlow->firstChild(), blockFlow->mutableStyle());
RefPtr<NGPhysicalFragment> fragment =
- NGBlockLayoutAlgorithm(blockFlow, blockFlow->style(), inlineBox,
- constraintSpace)
- .Layout();
+ NGBlockLayoutAlgorithm(node, constraintSpace).Layout();
EXPECT_TRUE(fragment);
String expectedText("Hello ");
expectedText.append(objectReplacementCharacter);
expectedText.append(".");
- EXPECT_EQ(expectedText, inlineBox->Text(0, 8));
+ EXPECT_EQ(expectedText, toNGInlineNode(node->FirstChild())->Text(0, 8));
// Delete the line box tree to avoid leaks in the test.
blockFlow->deleteLineBoxTree();
« no previous file with comments | « third_party/WebKit/Source/core/layout/ng/ng_out_of_flow_layout_part_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698