#include "ui/views/layout/layout_manager_base.h"
#include <algorithm>
#include "base/memory/raw_ptr.h"
#include "base/ranges/algorithm.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/base/metadata/metadata_header_macros.h"
#include "ui/base/metadata/metadata_impl_macros.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/views/test/test_views.h"
#include "ui/views/test/views_test_utils.h"
#include "ui/views/view.h"
#include "ui/views/view_class_properties.h"
namespace views {
namespace {
constexpr int kChildViewPadding = …;
constexpr gfx::Size kMinimumSize(40, 50);
constexpr gfx::Size kPreferredSize(100, 90);
constexpr gfx::Size kSquarishSize(10, 11);
constexpr gfx::Size kLongSize(20, 8);
constexpr gfx::Size kTallSize(4, 22);
constexpr gfx::Size kLargeSize(30, 28);
class TestLayoutManagerBase : public LayoutManagerBase { … };
class MockLayoutManagerBase : public LayoutManagerBase { … };
void ExpectSameViews(const std::vector<const View*>& expected,
const std::vector<const View*>& actual) { … }
}
TEST(LayoutManagerBaseTest, GetMinimumSize) { … }
TEST(LayoutManagerBaseTest, GetPreferredSize) { … }
TEST(LayoutManagerBaseTest, GetPreferredHeightForWidth) { … }
TEST(LayoutManagerBaseTest, Installed) { … }
TEST(LayoutManagerBaseTest, SetChildIncludedInLayout) { … }
TEST(LayoutManagerBaseTest, InvalidateHost_NotInstalled) { … }
TEST(LayoutManagerBaseTest, InvalidateHost_Installed) { … }
namespace {
class LayoutManagerBaseManagerTest : public testing::Test { … };
}
TEST_F(LayoutManagerBaseManagerTest, ProposedLayout_GetLayoutFor) { … }
TEST_F(LayoutManagerBaseManagerTest, ApplyLayout) { … }
TEST_F(LayoutManagerBaseManagerTest, ApplyLayout_SkipsOmittedViews) { … }
TEST_F(LayoutManagerBaseManagerTest, Install) { … }
TEST_F(LayoutManagerBaseManagerTest, GetMinimumSize) { … }
TEST_F(LayoutManagerBaseManagerTest, GetPreferredSize) { … }
TEST_F(LayoutManagerBaseManagerTest, GetPreferredHeightForWidth) { … }
TEST_F(LayoutManagerBaseManagerTest, InvalidateLayout) { … }
TEST_F(LayoutManagerBaseManagerTest, Layout) { … }
TEST_F(LayoutManagerBaseManagerTest, IgnoresChildWithViewIgnoredByLayoutKey) { … }
TEST_F(LayoutManagerBaseManagerTest, ViewVisibilitySet) { … }
TEST_F(LayoutManagerBaseManagerTest, ViewAdded) { … }
TEST_F(LayoutManagerBaseManagerTest, ViewAdded_NotVisible) { … }
TEST_F(LayoutManagerBaseManagerTest, ViewRemoved) { … }
class TestIgnoredView : public View { … };
BEGIN_METADATA(…)
TEST_F(LayoutManagerBaseManagerTest, IgnoredView) { … }
TEST(LayoutManagerBase_ProposedLayoutTest, Equality) { … }
class LayoutManagerBaseAvailableSizeTest : public testing::Test { … };
TEST_F(LayoutManagerBaseAvailableSizeTest, ReturnsCorrectValues) { … }
TEST_F(LayoutManagerBaseAvailableSizeTest, AvailableSizesInNestedValuesAdd) { … }
TEST_F(LayoutManagerBaseAvailableSizeTest,
PartiallySpecifiedAvailableSizesInNestedLayoutsAddPartially) { … }
TEST_F(LayoutManagerBaseAvailableSizeTest,
MismatchedAvailableSizesInNestedLayoutsDoNotAdd) { … }
TEST_F(LayoutManagerBaseAvailableSizeTest,
AvaialbleSizeChangeTriggersDescendantLayout) { … }
ManualLayoutUtilTest;
TEST_F(ManualLayoutUtilTest, SetCanBeVisibleForManualLayout) { … }
TEST_F(ManualLayoutUtilTest, TemporarilyExcludeOneViewFromLayout) { … }
TEST_F(ManualLayoutUtilTest, TemporarilyExcludeTwoViewsFromLayout) { … }
TEST_F(ManualLayoutUtilTest, ViewStaysExcludedIfAlreadyExcludedByProperty) { … }
TEST_F(ManualLayoutUtilTest, ViewHiddenDuringTemporaryExclusion) { … }
TEST_F(ManualLayoutUtilTest, ViewUnhiddenDuringTemporaryExclusion) { … }
}