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

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

Issue 2286403004: [LayoutNG] Initial NGLayoutOpportunityIterator implementation (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_constraint_space.h" 5 #include "core/layout/ng/ng_constraint_space.h"
6 6
7 #include "core/layout/ng/ng_derived_constraint_space.h" 7 #include "core/layout/ng/ng_derived_constraint_space.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 9
10 namespace blink { 10 namespace blink {
(...skipping 22 matching lines...) Expand all
33 EXPECT_TRUE(horz_space->FixedInlineSize()); 33 EXPECT_TRUE(horz_space->FixedInlineSize());
34 EXPECT_TRUE(vert_space->FixedBlockSize()); 34 EXPECT_TRUE(vert_space->FixedBlockSize());
35 35
36 EXPECT_FALSE(horz_space->FixedBlockSize()); 36 EXPECT_FALSE(horz_space->FixedBlockSize());
37 EXPECT_FALSE(vert_space->FixedInlineSize()); 37 EXPECT_FALSE(vert_space->FixedInlineSize());
38 38
39 EXPECT_EQ(FragmentColumn, horz_space->BlockFragmentationType()); 39 EXPECT_EQ(FragmentColumn, horz_space->BlockFragmentationType());
40 EXPECT_EQ(FragmentNone, vert_space->BlockFragmentationType()); 40 EXPECT_EQ(FragmentNone, vert_space->BlockFragmentationType());
41 } 41 }
42 42
43 TEST(NGConstraintSpaceTest, LayoutOpportunities) {
44 NGPhysicalSize physical_size;
45 physical_size.width = LayoutUnit(600);
46 physical_size.height = LayoutUnit(400);
47 auto* physical_space = new NGPhysicalConstraintSpace(physical_size);
48 auto* space = new NGConstraintSpace(HorizontalTopBottom, physical_space);
49
50 bool for_inline_or_bfc = false;
51 auto iterator = space->LayoutOpportunities(NGClearNone, for_inline_or_bfc);
cbiesinger 2016/08/30 15:58:01 Should this be NGClearFragment...?
52
53 auto firstOppertunity = iterator.Next();
cbiesinger 2016/08/30 15:58:01 Since it's unclear what the type of this variable
54 EXPECT_EQ(LayoutUnit(600), firstOppertunity->Size().inline_size);
55 EXPECT_EQ(LayoutUnit(400), firstOppertunity->Size().block_size);
56 }
57
43 } // namespace 58 } // namespace
44 59
45 } // namespace blink 60 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698