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

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

Issue 2281153002: [layoutng] async layout part 1: Change the API to support async (Closed)
Patch Set: Created 4 years, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/layout/ng/ng_block_layout_algorithm.h" 5 #include "core/layout/ng/ng_block_layout_algorithm.h"
6 6
7 #include "core/layout/ng/ng_box_iterator.h" 7 #include "core/layout/ng/ng_box_iterator.h"
8 #include "core/layout/ng/ng_constraint_space.h" 8 #include "core/layout/ng/ng_constraint_space.h"
9 #include "core/layout/ng/ng_fragment.h" 9 #include "core/layout/ng/ng_fragment.h"
10 #include "core/layout/ng/ng_length_utils.h" 10 #include "core/layout/ng/ng_length_utils.h"
(...skipping 11 matching lines...) Expand all
22 }; 22 };
23 23
24 TEST_F(NGBlockLayoutAlgorithmTest, FixedSize) { 24 TEST_F(NGBlockLayoutAlgorithmTest, FixedSize) {
25 style_->setWidth(Length(30, Fixed)); 25 style_->setWidth(Length(30, Fixed));
26 style_->setHeight(Length(40, Fixed)); 26 style_->setHeight(Length(40, Fixed));
27 27
28 NGConstraintSpace* space = new NGConstraintSpace( 28 NGConstraintSpace* space = new NGConstraintSpace(
29 HorizontalTopBottom, NGLogicalSize(LayoutUnit(100), NGSizeIndefinite)); 29 HorizontalTopBottom, NGLogicalSize(LayoutUnit(100), NGSizeIndefinite));
30 30
31 NGBlockLayoutAlgorithm algorithm(style_, NGBoxIterator(NGBox())); 31 NGBlockLayoutAlgorithm algorithm(style_, NGBoxIterator(NGBox()));
32 NGFragment* frag = algorithm.layout(space); 32 NGFragment* frag;
33 while (!algorithm.Layout(space, &frag))
34 ;
33 EXPECT_EQ(frag->InlineSize(), LayoutUnit(30)); 35 EXPECT_EQ(frag->InlineSize(), LayoutUnit(30));
34 EXPECT_EQ(frag->BlockSize(), LayoutUnit(40)); 36 EXPECT_EQ(frag->BlockSize(), LayoutUnit(40));
35 } 37 }
36 38
37 } // namespace 39 } // namespace
38 } // namespace blink 40 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698