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

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

Issue 2693193002: [LayoutNG] A different approach to multi-col. (Closed)
Patch Set: 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
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 f2803c4dd07eca0ea66c485f1765f74e0b0c88a6..35c9f3bb482efab13011870141744c9ac43b4867 100644
--- a/third_party/WebKit/Source/web/tests/NGInlineLayoutTest.cpp
+++ b/third_party/WebKit/Source/web/tests/NGInlineLayoutTest.cpp
@@ -46,16 +46,13 @@ TEST_F(NGInlineLayoutTest, BlockWithSingleTextNode) {
LayoutNGBlockFlow* blockFlow = toLayoutNGBlockFlow(target->layoutObject());
NGConstraintSpace* constraintSpace = constraintSpaceForElement(blockFlow);
- NGInlineNode* inlineBox =
- new NGInlineNode(blockFlow->firstChild(), blockFlow->mutableStyle());
+ NGBlockNode* blockNode = new NGBlockNode(blockFlow);
RefPtr<NGPhysicalFragment> fragment =
- NGBlockLayoutAlgorithm(blockFlow, blockFlow->style(), inlineBox,
- constraintSpace)
- .Layout();
+ NGBlockLayoutAlgorithm(blockNode, constraintSpace).Layout();
EXPECT_TRUE(fragment);
String expectedText("Hello World!");
- EXPECT_EQ(expectedText, inlineBox->Text(0, 12));
+ EXPECT_EQ(expectedText, toNGInlineNode(blockNode->FirstChild())->Text(0, 12));
}
TEST_F(NGInlineLayoutTest, BlockWithTextAndAtomicInline) {
@@ -73,18 +70,15 @@ TEST_F(NGInlineLayoutTest, BlockWithTextAndAtomicInline) {
LayoutNGBlockFlow* blockFlow = toLayoutNGBlockFlow(target->layoutObject());
NGConstraintSpace* constraintSpace = constraintSpaceForElement(blockFlow);
- NGInlineNode* inlineBox =
- new NGInlineNode(blockFlow->firstChild(), blockFlow->mutableStyle());
+ NGBlockNode* blockNode = new NGBlockNode(blockFlow);
RefPtr<NGPhysicalFragment> fragment =
- NGBlockLayoutAlgorithm(blockFlow, blockFlow->style(), inlineBox,
- constraintSpace)
- .Layout();
+ NGBlockLayoutAlgorithm(blockNode, constraintSpace).Layout();
EXPECT_TRUE(fragment);
String expectedText("Hello ");
expectedText.append(objectReplacementCharacter);
expectedText.append(".");
- EXPECT_EQ(expectedText, inlineBox->Text(0, 8));
+ EXPECT_EQ(expectedText, toNGInlineNode(blockNode->FirstChild())->Text(0, 8));
// Delete the line box tree to avoid leaks in the test.
blockFlow->deleteLineBoxTree();

Powered by Google App Engine
This is Rietveld 408576698