#ifndef CHROME_BROWSER_UI_TEST_TEST_INFOBAR_H_
#define CHROME_BROWSER_UI_TEST_TEST_INFOBAR_H_
#include <optional>
#include "chrome/browser/ui/test/test_browser_ui.h"
#include "components/infobars/core/infobar_delegate.h"
#include "components/infobars/core/infobar_manager.h"
namespace content {
class WebContents;
}
namespace infobars {
class ContentInfoBarManager;
}
class TestInfoBar : public UiBrowserTest {
public:
TestInfoBar();
TestInfoBar(const TestInfoBar&) = delete;
TestInfoBar& operator=(const TestInfoBar&) = delete;
~TestInfoBar() override;
void PreShow() override;
bool VerifyUi() override;
void WaitForUserDismissal() override;
protected:
using InfoBarDelegateIdentifier =
infobars::InfoBarDelegate::InfoBarIdentifier;
void AddExpectedInfoBar(InfoBarDelegateIdentifier identifier);
content::WebContents* GetWebContents();
const content::WebContents* GetWebContents() const;
infobars::ContentInfoBarManager* GetInfoBarManager();
const infobars::ContentInfoBarManager* GetInfoBarManager() const;
private:
using InfoBars = infobars::InfoBarManager::InfoBars;
std::optional<InfoBars> GetNewInfoBars() const;
InfoBars starting_infobars_;
std::vector<InfoBarDelegateIdentifier> expected_identifiers_;
};
#endif