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

Side by Side Diff: third_party/WebKit/Source/core/layout/ng/ng_box_test.cc

Issue 2462153002: [layoutng] Support computing min-content and max-content (Closed)
Patch Set: more review comments Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "core/layout/ng/ng_box.h"
6
7 #include "core/layout/ng/ng_fragment.h"
8 #include "core/style/ComputedStyle.h"
9 #include "testing/gtest/include/gtest/gtest.h"
10
11 namespace blink {
12 namespace {
13 class NGBoxTest : public ::testing::Test {
14 protected:
15 void SetUp() override { style_ = ComputedStyle::create(); }
16
17 RefPtr<ComputedStyle> style_;
18 };
19
20 TEST_F(NGBoxTest, MinAndMaxContent) {
21 const int kWidth = 30;
22
23 RefPtr<ComputedStyle> first_style = ComputedStyle::create();
24 first_style->setWidth(Length(kWidth, Fixed));
25 NGBox* first_child = new NGBox(first_style.get());
26
27 NGBox* box = new NGBox(style_.get());
28 box->SetFirstChild(first_child);
29
30 MinAndMaxContentSizes sizes;
31 while (!box->ComputeMinAndMaxContentSizes(&sizes))
32 continue;
33 EXPECT_EQ(LayoutUnit(kWidth), sizes.min_content);
34 EXPECT_EQ(LayoutUnit(kWidth), sizes.max_content);
35 }
36 } // namespace
37 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/ng/ng_box.cc ('k') | third_party/WebKit/Source/core/layout/ng/ng_layout_algorithm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698