chromium/chrome/browser/picture_in_picture/auto_pip_setting_view_unittest.cc

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

#include "chrome/browser/picture_in_picture/auto_pip_setting_view.h"

#include <memory>
#include <utility>

#include "base/memory/raw_ptr.h"
#include "base/test/mock_callback.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "components/url_formatter/url_formatter.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "ui/base/ui_base_features.h"
#include "ui/events/test/event_generator.h"
#include "ui/gfx/text_elider.h"
#include "ui/views/test/views_test_base.h"
#include "ui/views/widget/widget.h"
#include "ui/views/widget/widget_utils.h"

HasSubstr;
NotNull;

UiResult;

struct TestParams {};

class AutoPipSettingViewTest : public views::ViewsTestBase,
                               public testing::WithParamInterface<TestParams> {};

TEST_F(AutoPipSettingViewTest, TestInitControlViewButton) {}

TEST_F(AutoPipSettingViewTest, TestShow) {}

TEST_F(AutoPipSettingViewTest, TestViewConstructor) {}

TEST_F(AutoPipSettingViewTest, TestBubbleTitleNoElide) {}

TEST_F(AutoPipSettingViewTest, TestBubbleTitleElideBehaviorForNonFileURL) {}

TEST_F(AutoPipSettingViewTest, TestBubbleTitleElideBehaviorForFileURL) {}

TEST_F(AutoPipSettingViewTest, TestOriginLabelForGURLWithLocalHost) {}

#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) || \
    BUILDFLAG(IS_LINUX)
// TODO (crbug/1521332): Evaluate fix and re-enable
#define MAYBE_WidgetIsCenteredWhenArrowIsFloat
#else
#define MAYBE_WidgetIsCenteredWhenArrowIsFloat
#endif
TEST_F(AutoPipSettingViewTest, MAYBE_WidgetIsCenteredWhenArrowIsFloat) {}

const struct TestParams kTestParams[] =;

INSTANTIATE_TEST_SUITE_P();

// Test UiResult callbacks.
TEST_P(AutoPipSettingViewTest, ButtonCallbackTest) {}

INSTANTIATE_TEST_SUITE_P();

// Verify that multiple clicks on UI button does not crash.
TEST_P(AutoPipSettingViewTest, MultipleClicksDontCrash) {}

INSTANTIATE_TEST_SUITE_P();

// Verify that the |hide_view_cb_| is executed.
TEST_P(AutoPipSettingViewTest, OverlayBackgroundLayerIsHidden) {}