#include "third_party/blink/renderer/core/layout/length_utils.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/renderer/core/css/resolver/style_resolver.h"
#include "third_party/blink/renderer/core/layout/block_node.h"
#include "third_party/blink/renderer/core/layout/constraint_space.h"
#include "third_party/blink/renderer/core/layout/constraint_space_builder.h"
#include "third_party/blink/renderer/core/style/computed_style.h"
#include "third_party/blink/renderer/core/testing/core_unit_test_helper.h"
#include "third_party/blink/renderer/platform/geometry/calculation_value.h"
#include "third_party/blink/renderer/platform/geometry/layout_unit.h"
#include "third_party/blink/renderer/platform/geometry/length.h"
#include "third_party/blink/renderer/platform/testing/task_environment.h"
namespace blink {
namespace {
static ConstraintSpace ConstructConstraintSpace(
int inline_size,
int block_size,
bool fixed_inline = false,
bool fixed_block = false,
WritingMode writing_mode = WritingMode::kHorizontalTb) { … }
class LengthUtilsTest : public testing::Test { … };
class LengthUtilsTestWithNode : public RenderingTest { … };
TEST_F(LengthUtilsTest, TestResolveInlineLength) { … }
TEST_F(LengthUtilsTest, TestIndefiniteResolveInlineLength) { … }
TEST_F(LengthUtilsTest, TestResolveBlockLength) { … }
TEST_F(LengthUtilsTestWithNode, TestComputeContentContribution) { … }
TEST_F(LengthUtilsTestWithNode, TestComputeInlineSizeForFragment) { … }
TEST_F(LengthUtilsTestWithNode, TestComputeBlockSizeForFragment) { … }
TEST_F(LengthUtilsTestWithNode, TestIndefinitePercentages) { … }
TEST_F(LengthUtilsTestWithNode, ComputeReplacedSizeSvgNoScaling) { … }
TEST_F(LengthUtilsTest, TestMargins) { … }
TEST_F(LengthUtilsTest, TestBorders) { … }
TEST_F(LengthUtilsTest, TestPadding) { … }
TEST_F(LengthUtilsTest, TestAutoMargins) { … }
int GetUsedColumnWidth(int computed_column_count,
int computed_column_width,
int used_column_gap,
int available_inline_size) { … }
int GetUsedColumnCount(int computed_column_count,
int computed_column_width,
int used_column_gap,
int available_inline_size) { … }
TEST_F(LengthUtilsTest, TestColumnWidthAndCount) { … }
LayoutUnit ComputeInlineSize(LogicalSize aspect_ratio, LayoutUnit block_size) { … }
TEST_F(LengthUtilsTest, AspectRatio) { … }
}
}