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

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

Issue 2725773002: Remove NGBlockNode constructor, SetFirstChild, SetNextSibling methods (Closed)
Patch Set: git cl web 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/core/layout/ng/ng_block_node_test.cc
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_block_node_test.cc b/third_party/WebKit/Source/core/layout/ng/ng_block_node_test.cc
index 656723f22b6f477156d9c01f5b1bfa275a64b93c..c7a12ff27979b9cd032d3922864b354876b9643c 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_block_node_test.cc
+++ b/third_party/WebKit/Source/core/layout/ng/ng_block_node_test.cc
@@ -4,29 +4,27 @@
#include "core/layout/ng/ng_block_node.h"
-#include "core/layout/ng/ng_box_fragment.h"
-#include "core/style/ComputedStyle.h"
+#include "core/layout/LayoutTestHelper.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace blink {
namespace {
-class NGBlockNodeForTest : public ::testing::Test {
- protected:
- void SetUp() override { style_ = ComputedStyle::create(); }
-
- RefPtr<ComputedStyle> style_;
+class NGBlockNodeForTest : public RenderingTest {
+ public:
+ NGBlockNodeForTest() { RuntimeEnabledFeatures::setLayoutNGEnabled(true); }
+ ~NGBlockNodeForTest() { RuntimeEnabledFeatures::setLayoutNGEnabled(false); };
};
TEST_F(NGBlockNodeForTest, MinAndMaxContent) {
+ setBodyInnerHTML(R"HTML(
+ <div id="box" >
+ <div id="first_child" style="width:30px">
+ </div>
+ </div>
+ )HTML");
const int kWidth = 30;
- RefPtr<ComputedStyle> first_style = ComputedStyle::create();
- first_style->setWidth(Length(kWidth, Fixed));
- NGBlockNode* first_child = new NGBlockNode(first_style.get());
-
- NGBlockNode* box = new NGBlockNode(style_.get());
- box->SetFirstChild(first_child);
-
+ NGBlockNode* box = new NGBlockNode(getLayoutObjectByElementId("box"));
MinAndMaxContentSizes sizes = box->ComputeMinAndMaxContentSizes();
EXPECT_EQ(LayoutUnit(kWidth), sizes.min_content);
EXPECT_EQ(LayoutUnit(kWidth), sizes.max_content);

Powered by Google App Engine
This is Rietveld 408576698