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

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

Issue 2267383003: [LayoutNG] Introduces NGPhysicalConstraintSpace and makes NGConstraintSpace a "view". (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: .. Created 4 years, 4 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_constraint_space_test.cc
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_constraint_space_test.cc b/third_party/WebKit/Source/core/layout/ng/ng_constraint_space_test.cc
new file mode 100644
index 0000000000000000000000000000000000000000..bb2c8a3bfd8f09c84ee8aa63af482b8a83c76002
--- /dev/null
+++ b/third_party/WebKit/Source/core/layout/ng/ng_constraint_space_test.cc
@@ -0,0 +1,45 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "core/layout/ng/ng_constraint_space.h"
+
+#include "core/layout/ng/ng_derived_constraint_space.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace blink {
+
+namespace {
+
+TEST(NGConstraintSpaceTest, WritingMode) {
+ NGConstraintSpace* horz_space = new NGDerivedConstraintSpace(
+ HorizontalTopBottom, NGLogicalSize(LayoutUnit(200), LayoutUnit(100)),
+ true, false, true, false, FragmentColumn);
cbiesinger 2016/08/25 22:22:16 That list of true and false is so hard to understa
ikilpatrick 2016/08/25 23:14:29 +1. Ack.
+ NGConstraintSpace* vert_space =
+ new NGConstraintSpace(VerticalRightLeft, horz_space);
+
+ EXPECT_EQ(LayoutUnit(200), horz_space->ContainerSize().inline_size);
+ EXPECT_EQ(LayoutUnit(200), vert_space->ContainerSize().block_size);
+
+ EXPECT_EQ(LayoutUnit(100), horz_space->ContainerSize().block_size);
+ EXPECT_EQ(LayoutUnit(100), vert_space->ContainerSize().inline_size);
+
+ EXPECT_TRUE(horz_space->InlineTriggersScrollbar());
+ EXPECT_TRUE(vert_space->BlockTriggersScrollbar());
+
+ EXPECT_FALSE(horz_space->BlockTriggersScrollbar());
+ EXPECT_FALSE(vert_space->InlineTriggersScrollbar());
+
+ EXPECT_TRUE(horz_space->FixedInlineSize());
+ EXPECT_TRUE(vert_space->FixedBlockSize());
+
+ EXPECT_FALSE(horz_space->FixedBlockSize());
+ EXPECT_FALSE(vert_space->FixedInlineSize());
+
+ EXPECT_EQ(FragmentColumn, horz_space->BlockFragmentationType());
+ EXPECT_EQ(FragmentNone, vert_space->BlockFragmentationType());
+}
+
+} // namespace
+
+} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698