#include "chrome/browser/picture_in_picture/auto_pip_setting_overlay_view.h"
#include <memory>
#include <utility>
#include "base/memory/raw_ptr.h"
#include "base/test/mock_callback.h"
#include "chrome/browser/ui/color/chrome_color_id.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "ui/compositor/layer.h"
#include "ui/compositor/layer_animator.h"
#include "ui/compositor/scoped_animation_duration_scale_mode.h"
#include "ui/events/test/event_generator.h"
#include "ui/views/test/views_test_base.h"
#include "ui/views/widget/widget.h"
#include "ui/views/widget/widget_observer.h"
#include "ui/views/widget/widget_utils.h"
namespace {
class MockWidgetObserver : public views::WidgetObserver { … };
}
class AutoPipSettingOverlayViewTest : public views::ViewsTestBase { … };
TEST_F(AutoPipSettingOverlayViewTest, TestViewInitialization) { … }
TEST_F(AutoPipSettingOverlayViewTest, TestBackgroundLayerAnimation) { … }
TEST_F(AutoPipSettingOverlayViewTest, TestWantsEvent) { … }
TEST_F(AutoPipSettingOverlayViewTest,
TestOverlayViewDoesNotHaveFocusForDocumentPip) { … }
TEST_F(AutoPipSettingOverlayViewTest,
TestOverlayViewDoesNotHaveFocusForVideoPip) { … }
#if BUILDFLAG(IS_MAC)
TEST_F(AutoPipSettingOverlayViewTest,
TestOverlayViewNotShownBeforeDelayForDocumentPip) {
setting_overlay()->ShowBubble(anchor_view_widget()->GetNativeView());
EXPECT_FALSE(
setting_overlay()->get_view_for_testing()->GetWidget()->IsVisible());
task_environment()->FastForwardBy(base::Milliseconds(179));
EXPECT_FALSE(
setting_overlay()->get_view_for_testing()->GetWidget()->IsVisible());
}
#endif
TEST_F(AutoPipSettingOverlayViewTest, TestOverlayViewShownWithDelay) { … }
TEST_F(AutoPipSettingOverlayViewTest, TestDeletingOverlayClosesBubble) { … }
namespace {
class TestAutoPipSettingOverlayViewDelegate
: public AutoPipSettingOverlayView::Delegate { … };
}
TEST_F(AutoPipSettingOverlayViewTest, TestAutoPipSettingOverlayViewDelegate) { … }