#include "chrome/browser/ui/tab_sharing/tab_sharing_infobar_delegate.h"
#include <tuple>
#include "base/strings/utf_string_conversions.h"
#include "base/test/scoped_feature_list.h"
#include "chrome/browser/favicon/favicon_utils.h"
#include "chrome/browser/ui/tab_sharing/tab_sharing_ui.h"
#include "chrome/grit/generated_resources.h"
#include "chrome/test/base/browser_with_test_window_test.h"
#include "components/infobars/content/content_infobar_manager.h"
#include "components/infobars/core/infobar.h"
#include "components/url_formatter/elide_url.h"
#include "components/vector_icons/vector_icons.h"
#include "content/public/common/content_features.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/models/image_model.h"
#include "ui/gfx/favicon_size.h"
#include "ui/gfx/image/image_unittest_util.h"
#include "ui/gfx/vector_icon_types.h"
namespace {
FocusTarget;
TabRole;
const std::u16string kSharedTabName = …;
const std::u16string kAppName = …;
const std::u16string kSinkName = …;
const std::u16string kCapturedUrl = …;
const std::u16string kCapturingUrl = …;
class MockTabSharingUIViews : public TabSharingUI { … };
}
class TabSharingInfoBarDelegateTest
: public BrowserWithTestWindowTest,
public ::testing::WithParamInterface<std::tuple<bool, bool>> { … };
INSTANTIATE_TEST_SUITE_P(…);
TEST_P(TabSharingInfoBarDelegateTest, StartSharingOnCancel) { … }
TEST_P(TabSharingInfoBarDelegateTest, StopSharingOnAccept) { … }
TEST_P(TabSharingInfoBarDelegateTest, InfobarOnCapturingTab) { … }
TEST_P(TabSharingInfoBarDelegateTest, InfobarOnCapturedTab) { … }
TEST_P(TabSharingInfoBarDelegateTest, InfobarOnNotSharedTab) { … }
TEST_P(TabSharingInfoBarDelegateTest, InfobarWhenSharingNotAllowed) { … }
TEST_P(TabSharingInfoBarDelegateTest,
InfobarOnCapturingTabIfCapturedAnotherTabButSelfCapturePreferred) { … }
TEST_P(TabSharingInfoBarDelegateTest, MultipleInfobarsOnSameTab) { … }
TEST_P(TabSharingInfoBarDelegateTest, InfobarNotDismissedOnNavigation) { … }
TEST_P(TabSharingInfoBarDelegateTest, InfobarOnNotCastTab) { … }
TEST_P(TabSharingInfoBarDelegateTest, InfobarOnCastTab) { … }