chromium/third_party/blink/renderer/core/layout/flex/flex_layout_algorithm_test.cc

// Copyright 2021 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "testing/gmock/include/gmock/gmock.h"
#include "third_party/blink/renderer/core/layout/base_layout_algorithm_test.h"
#include "third_party/blink/renderer/core/layout/block_node.h"
#include "third_party/blink/renderer/core/layout/flex/flexible_box_algorithm.h"
#include "third_party/blink/renderer/core/layout/flex/layout_flexible_box.h"
#include "third_party/blink/renderer/core/layout/physical_box_fragment.h"
#include "third_party/blink/renderer/core/testing/core_unit_test_helper.h"

namespace blink {
namespace {

class FlexLayoutAlgorithmTest : public BaseLayoutAlgorithmTest {};

TEST_F(FlexLayoutAlgorithmTest, DetailsFlexDoesntCrash) {}

TEST_F(FlexLayoutAlgorithmTest, ReplacedAspectRatioPrecision) {}

TEST_F(FlexLayoutAlgorithmTest, DevtoolsBasic) {}

TEST_F(FlexLayoutAlgorithmTest, DevtoolsWrap) {}

TEST_F(FlexLayoutAlgorithmTest, DevtoolsCoordinates) {}

TEST_F(FlexLayoutAlgorithmTest, DevtoolsOverflow) {}

TEST_F(FlexLayoutAlgorithmTest, DevtoolsWithRelPosItem) {}

TEST_F(FlexLayoutAlgorithmTest, DevtoolsBaseline) {}

TEST_F(FlexLayoutAlgorithmTest, DevtoolsOneImageItemCrash) {}

TEST_F(FlexLayoutAlgorithmTest, DevtoolsColumnWrap) {}

TEST_F(FlexLayoutAlgorithmTest, DevtoolsColumnWrapOrtho) {}

TEST_F(FlexLayoutAlgorithmTest, DevtoolsRowWrapOrtho) {}

TEST_F(FlexLayoutAlgorithmTest, DevtoolsLegacyItem) {}

TEST_F(FlexLayoutAlgorithmTest, DevtoolsFragmentedItemDoesntCrash) {}

TEST_F(FlexLayoutAlgorithmTest, DevtoolsAutoScrollbar) {}

TEST_F(FlexLayoutAlgorithmTest, AbsPosUma1) {}

TEST_F(FlexLayoutAlgorithmTest, AbsPosUmaDifferent) {}

TEST_F(FlexLayoutAlgorithmTest, AbsPosUmaDifferentButRow) {}

TEST_F(FlexLayoutAlgorithmTest, AbsPosUmaBothCenter) {}

TEST_F(FlexLayoutAlgorithmTest, AbsPosUmaEndFlexEnd) {}

TEST_F(FlexLayoutAlgorithmTest, AbsPosUmaLeftEnd) {}

TEST_F(FlexLayoutAlgorithmTest, AbsPosUmaVerticalWritingMode) {}

TEST_F(FlexLayoutAlgorithmTest, AbsPosUmaOrthogonalWritingMode) {}

// column-reverse switches main-axis order (start placing items at block-end)
TEST_F(FlexLayoutAlgorithmTest, AbsPosUmaFlexEndReverseStart) {}

// wrap-reverse switches cross-axis order (of the lines)
TEST_F(FlexLayoutAlgorithmTest, AbsPosUmaFlexEndWrapReverse) {}

TEST_F(FlexLayoutAlgorithmTest, AbsPosUmaAlignItemsSame) {}

TEST_F(FlexLayoutAlgorithmTest, AbsPosUmaAlignItemsDifferent) {}

// These next 4 tests are disabled because we don't have a good way to compare
// the abspos size to the static position rectangle. This means we overcount the
// number of pages that will be changed by the abspos proposal in
// https://github.com/w3c/csswg-drafts/issues/5843.

TEST_F(FlexLayoutAlgorithmTest, DISABLED_AbsPosUma0px) {}

TEST_F(FlexLayoutAlgorithmTest, DISABLED_AbsPosUmaSameSize) {}

TEST_F(FlexLayoutAlgorithmTest, DISABLED_AbsPosUmaSameSizeWithMargin) {}

TEST_F(FlexLayoutAlgorithmTest, DISABLED_AbsPosUmaAutoInsetsSameSize) {}

TEST_F(FlexLayoutAlgorithmTest, AbsPosUmaNoAutoInsets) {}

TEST_F(FlexLayoutAlgorithmTest, AbsPosUmaAutoInsetsDifferentSize) {}

// Current:  item is at top of container.
// Proposed: item is at bottom of container.
TEST_F(FlexLayoutAlgorithmTest, UseCounter1) {}

TEST_F(FlexLayoutAlgorithmTest, UseCounter1b) {}

TEST_F(FlexLayoutAlgorithmTest, UseCounter2) {}

TEST_F(FlexLayoutAlgorithmTest, UseCounter2b) {}

TEST_F(FlexLayoutAlgorithmTest, UseCounter2c) {}

TEST_F(FlexLayoutAlgorithmTest, UseCounter2d) {}

TEST_F(FlexLayoutAlgorithmTest, UseCounter2e) {}

TEST_F(FlexLayoutAlgorithmTest, UseCounter2f) {}

TEST_F(FlexLayoutAlgorithmTest, UseCounter2g) {}

TEST_F(FlexLayoutAlgorithmTest, UseCounter3) {}

TEST_F(FlexLayoutAlgorithmTest, UseCounter4) {}

TEST_F(FlexLayoutAlgorithmTest, UseCounter5) {}

TEST_F(FlexLayoutAlgorithmTest, UseCounter6) {}

TEST_F(FlexLayoutAlgorithmTest, UseCounter7) {}

// Current:  item gets 50px height.
// Proposed: item gets 0px height and abuts bottom edge of container.
TEST_F(FlexLayoutAlgorithmTest, UseCounter9) {}

// Current:  item abuts left edge of container.
// Proposed: item abuts right edge of container.
TEST_F(FlexLayoutAlgorithmTest, UseCounter10) {}

TEST_F(FlexLayoutAlgorithmTest, UseCounter11) {}

// Current:  items abut left edge of container.
// Proposed: items abut right edge of container.
TEST_F(FlexLayoutAlgorithmTest, UseCounter12) {}

TEST_F(FlexLayoutAlgorithmTest, UseCounter14) {}

TEST_F(FlexLayoutAlgorithmTest, UseCounter15) {}

// Current: item at top
// Proposed: item at bottom
TEST_F(FlexLayoutAlgorithmTest, UseCounter15b) {}

TEST_F(FlexLayoutAlgorithmTest, UseCounter15c) {}

// Current: item at top
// Proposed: item in center
TEST_F(FlexLayoutAlgorithmTest, UseCounter15d) {}

TEST_F(FlexLayoutAlgorithmTest, UseCounter15e) {}

TEST_F(FlexLayoutAlgorithmTest, UseCounter15f) {}

// Current: first item is on the top
// Proposed: first item is on the bottom
TEST_F(FlexLayoutAlgorithmTest, UseCounter15g) {}

// Current: item is on the right.
// Proposed: item is on the left.
TEST_F(FlexLayoutAlgorithmTest, UseCounter16) {}

// Current: first item's right edge abuts container's right edge
//          second item is horizontally centered
// Proposal: both abut container's right edge
TEST_F(FlexLayoutAlgorithmTest, UseCounter17) {}

// Current: first item's bottom edge abuts container's bottom edge
//          second item is vertically centered
// Proposal: both abut container's bottom edge
TEST_F(FlexLayoutAlgorithmTest, UseCounter18) {}

// This case has no behavior change but checking the used width of each item
// against the flex container's width is too difficult without fully
// implementing the new behavior.
TEST_F(FlexLayoutAlgorithmTest, UseCounter19) {}

}  // namespace
}  // namespace blink