Chromium Code Reviews| OLD | NEW |
|---|---|
| (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_block_layout_algorithm.h" | |
| 6 | |
| 7 #include "core/layout/ng/ng_constraint_space.h" | |
| 8 #include "core/layout/ng/ng_fragment.h" | |
| 9 #include "core/style/ComputedStyle.h" | |
| 10 #include "testing/gtest/include/gtest/gtest.h" | |
| 11 | |
| 12 namespace blink { | |
| 13 namespace { | |
| 14 | |
| 15 class NGBlockLayoutAlgorithmTest : public ::testing::Test { | |
| 16 protected: | |
| 17 void SetUp() override { | |
| 18 style_ = ComputedStyle::create(); | |
| 19 } | |
| 20 | |
| 21 RefPtr<ComputedStyle> style_; | |
| 22 }; | |
| 23 | |
| 24 TEST_F(NGBlockLayoutAlgorithmTest, FixedSize) { | |
| 25 style_->setWidth(Length(30, Fixed)); | |
| 26 style_->setHeight(Length(40, Fixed)); | |
| 27 | |
| 28 NGConstraintSpace space(LayoutUnit(100), LayoutUnit(-1)); | |
|
eae
2016/08/10 15:55:19
For abs-pos we need the hight to be the viewport h
| |
| 29 | |
| 30 NGBlockLayoutAlgorithm algorithm(style_.get()); | |
| 31 NGFragment* frag = algorithm.layout(space); | |
| 32 EXPECT_EQ(frag->inlineSize(), LayoutUnit(30)); | |
| 33 EXPECT_EQ(frag->blockSize(), LayoutUnit(40)); | |
| 34 } | |
| 35 | |
| 36 } // namespace | |
| 37 } // namespace blink | |
| OLD | NEW |