#include "ui/views/bubble/bubble_frame_view.h"
#include <algorithm>
#include <memory>
#include <utility>
#include "base/memory/raw_ptr.h"
#include "base/strings/utf_string_conversions.h"
#include "base/time/time.h"
#include "build/build_config.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "third_party/skia/include/core/SkColor.h"
#include "ui/base/metadata/metadata_header_macros.h"
#include "ui/base/metadata/metadata_impl_macros.h"
#include "ui/base/mojom/dialog_button.mojom.h"
#include "ui/events/base_event_utils.h"
#include "ui/events/event.h"
#include "ui/gfx/geometry/insets.h"
#include "ui/gfx/geometry/point.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/size.h"
#include "ui/gfx/text_utils.h"
#include "ui/views/accessibility/view_accessibility.h"
#include "ui/views/bubble/bubble_border.h"
#include "ui/views/bubble/bubble_dialog_delegate_view.h"
#include "ui/views/bubble/footnote_container_view.h"
#include "ui/views/controls/button/label_button.h"
#include "ui/views/metrics.h"
#include "ui/views/test/button_test_api.h"
#include "ui/views/test/test_layout_provider.h"
#include "ui/views/test/test_views.h"
#include "ui/views/test/view_metadata_test_utils.h"
#include "ui/views/test/views_test_base.h"
#include "ui/views/view_class_properties.h"
#include "ui/views/widget/widget.h"
#include "ui/views/widget/widget_delegate.h"
#include "ui/views/widget/widget_interactive_uitest_utils.h"
#include "ui/views/window/dialog_client_view.h"
namespace views {
namespace {
constexpr BubbleBorder::Arrow kArrow = …;
constexpr int kMargin = …;
constexpr gfx::Size kMinimumClientSize = …;
constexpr gfx::Size kPreferredClientSize = …;
constexpr gfx::Size kMaximumClientSize = …;
gfx::Size AddAdditionalSize(gfx::Size size) { … }
class TestBubbleFrameViewWidgetDelegate : public WidgetDelegate { … };
class TestBubbleFrameView : public BubbleFrameView { … };
}
class BubbleFrameViewTest : public ViewsTestBase { … };
TEST_F(BubbleFrameViewTest, GetBoundsForClientView) { … }
TEST_F(BubbleFrameViewTest, GetBoundsForClientViewWithClose) { … }
TEST_F(BubbleFrameViewTest, RemoveFootnoteView) { … }
TEST_F(BubbleFrameViewTest,
FootnoteContainerViewShouldMatchVisibilityOfFirstChild) { … }
TEST_F(BubbleFrameViewTest, GetUpdatedWindowBounds) { … }
TEST_F(BubbleFrameViewTest, GetUpdatedWindowBoundsMirroringFails) { … }
TEST_F(BubbleFrameViewTest, TestMirroringForCenteredArrow) { … }
TEST_F(BubbleFrameViewTest, GetUpdatedWindowBoundsDontTryMirror) { … }
TEST_F(BubbleFrameViewTest, GetUpdatedWindowBoundsCenterArrows) { … }
TEST_F(BubbleFrameViewTest, GetUpdatedWindowBoundsForBubbleWithAnchorWindow) { … }
TEST_F(BubbleFrameViewTest,
GetUpdatedWindowBoundsForBubbleWithAnchorWindowExitingScreen) { … }
TEST_F(BubbleFrameViewTest, BubbleNotUsingAnchorWindowBounds) { … }
TEST_F(BubbleFrameViewTest, MirroringNotStickyForGetUpdatedWindowBounds) { … }
TEST_F(BubbleFrameViewTest, GetUpdatedWindowBoundsForBubbleSetToOffset) { … }
TEST_F(BubbleFrameViewTest,
GetUpdatedWindowBoundsForBubbleSetToOffsetLargerThanAvailableBounds) { … }
TEST_F(BubbleFrameViewTest, GetPreferredSize) { … }
TEST_F(BubbleFrameViewTest, GetPreferredSizeWithFootnote) { … }
TEST_F(BubbleFrameViewTest, GetMinimumSize) { … }
TEST_F(BubbleFrameViewTest, GetMaximumSize) { … }
TEST_F(BubbleFrameViewTest, LayoutWithHeader) { … }
TEST_F(BubbleFrameViewTest, LayoutWithHeaderAndCloseButton) { … }
TEST_F(BubbleFrameViewTest, MetadataTest) { … }
namespace {
class TestBubbleDialogDelegateView : public BubbleDialogDelegateView { … };
BEGIN_METADATA(…)
class TestAnchor { … };
class TestWidthSnapDelegate : public TestBubbleDialogDelegateView { … };
BEGIN_METADATA(…)
}
TEST_F(BubbleFrameViewTest, WidthSnaps) { … }
TEST_F(BubbleFrameViewTest, LayoutEdgeCases) { … }
TEST_F(BubbleFrameViewTest, LayoutEdgeCasesWithHeader) { … }
TEST_F(BubbleFrameViewTest, LayoutSubtitleEdgeCases) { … }
TEST_F(BubbleFrameViewTest, LayoutWithIcon) { … }
TEST_F(BubbleFrameViewTest, NoElideTitle) { … }
TEST_F(BubbleFrameViewTest, LabelWithHeadingLevel) { … }
TEST_F(BubbleFrameViewTest, IgnorePossiblyUnintendedClicksClose) { … }
TEST_F(BubbleFrameViewTest, IgnorePossiblyUnintendedClicksMinimize) { … }
TEST_F(BubbleFrameViewTest, IgnorePossiblyUnintendedClicksAnchorBoundsChanged) { … }
TEST_F(BubbleFrameViewTest, LayoutWithProgressIndicator) { … }
TEST_F(BubbleFrameViewTest, MinimizeBeforeClose) { … }
}