#ifndef CHROME_BROWSER_UI_WEB_APPLICATIONS_TEST_WEB_APP_BROWSERTEST_UTIL_H_
#define CHROME_BROWSER_UI_WEB_APPLICATIONS_TEST_WEB_APP_BROWSERTEST_UTIL_H_
#include <string_view>
#include "base/functional/callback.h"
#include "base/location.h"
#include "base/memory/raw_ptr.h"
#include "base/run_loop.h"
#include "base/scoped_observation.h"
#include "chrome/browser/ui/browser_list_observer.h"
#include "chrome/browser/web_applications/externally_managed_app_manager.h"
#include "chrome/browser/web_applications/web_app_constants.h"
#include "chrome/browser/web_applications/web_app_install_manager.h"
#include "chrome/browser/web_applications/web_app_install_manager_observer.h"
#include "components/webapps/common/web_app_id.h"
#include "third_party/skia/include/core/SkColor.h"
#include "ui/base/window_open_disposition.h"
class Browser;
class GURL;
class Profile;
namespace base {
class FilePath;
}
namespace webapps {
enum class InstallResultCode;
}
namespace web_app {
struct ExternalInstallOptions;
class WebAppInstallManager;
webapps::AppId InstallWebAppFromPage(Browser* browser, const GURL& app_url);
webapps::AppId InstallWebAppFromPageAndCloseAppBrowser(Browser* browser,
const GURL& app_url);
webapps::AppId InstallWebAppFromManifest(Browser* browser, const GURL& app_url);
Browser* LaunchWebAppBrowser(
Profile*,
const webapps::AppId&,
WindowOpenDisposition disposition = WindowOpenDisposition::CURRENT_TAB);
Browser* LaunchWebAppBrowserAndWait(
Profile*,
const webapps::AppId&,
WindowOpenDisposition disposition = WindowOpenDisposition::CURRENT_TAB);
Browser* LaunchBrowserForWebAppInTab(Profile*, const webapps::AppId&);
Browser* LaunchWebAppToURL(Profile* profile,
const webapps::AppId& app_id,
const GURL& url);
ExternalInstallOptions CreateInstallOptions(
const GURL& url,
const ExternalInstallSource& source =
ExternalInstallSource::kInternalDefault);
ExternallyManagedAppManager::InstallResult ExternallyManagedAppManagerInstall(
Profile*,
ExternalInstallOptions);
void NavigateViaLinkClickToURLAndWait(
Browser* browser,
const GURL& url,
bool proceed_through_interstitial = false);
void NavigateAndCheckForToolbar(Browser* browser,
const GURL& url,
bool expected_visibility,
bool proceed_through_interstitial = false);
enum AppMenuCommandState { … };
AppMenuCommandState GetAppMenuCommandState(int command_id, Browser* browser);
Browser* FindWebAppBrowser(Profile* profile, const webapps::AppId& app_id);
void CloseAndWait(Browser* browser);
bool IsBrowserOpen(const Browser* test_browser);
std::optional<webapps::AppId> ForceInstallWebApp(Profile* profile, GURL url);
class BrowserWaiter : public BrowserListObserver { … };
class UpdateAwaiter : public WebAppInstallManagerObserver { … };
base::FilePath CreateTestFileWithExtension(std::string_view extension);
bool WaitForIPHToShowIfAny(Browser* browser);
}
#endif