#include "base/feature_list.h"
#include "base/path_service.h"
#include "base/time/time_override.h"
#include "build/build_config.h"
#include "chrome/browser/content_settings/host_content_settings_map_factory.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/optimization_guide/optimization_guide_keyed_service.h"
#include "chrome/browser/optimization_guide/optimization_guide_keyed_service_factory.h"
#include "chrome/browser/page_info/about_this_site_service_factory.h"
#include "chrome/browser/safe_browsing/chrome_password_protection_service.h"
#include "chrome/browser/ui/test/test_browser_dialog.h"
#include "chrome/browser/ui/views/frame/browser_view.h"
#include "chrome/browser/ui/views/location_bar/location_icon_view.h"
#include "chrome/browser/ui/views/page_info/page_info_bubble_view.h"
#include "chrome/browser/ui/views/page_info/page_info_cookies_content_view.h"
#include "chrome/browser/ui/views/page_info/page_info_main_view.h"
#include "chrome/browser/ui/views/page_info/page_info_view_factory.h"
#include "chrome/browser/ui/views/toolbar/toolbar_view.h"
#include "chrome/browser/ui/web_applications/test/isolated_web_app_test_utils.h"
#include "chrome/browser/ui/web_applications/test/web_app_browsertest_util.h"
#include "chrome/browser/web_applications/isolated_web_apps/isolated_web_app_url_info.h"
#include "chrome/browser/web_applications/test/os_integration_test_override_impl.h"
#include "chrome/browser/web_applications/test/web_app_install_test_utils.h"
#include "chrome/common/chrome_features.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/url_constants.h"
#include "chrome/test/base/testing_profile_manager.h"
#include "chrome/test/base/ui_test_utils.h"
#include "components/content_settings/browser/page_specific_content_settings.h"
#include "components/content_settings/core/browser/content_settings_registry.h"
#include "components/content_settings/core/common/cookie_blocking_3pcd_status.h"
#include "components/content_settings/core/common/features.h"
#include "components/history/core/browser/history_service.h"
#include "components/optimization_guide/core/optimization_guide_switches.h"
#include "components/page_info/core/about_this_site_service.h"
#include "components/page_info/core/features.h"
#include "components/page_info/core/proto/about_this_site_metadata.pb.h"
#include "components/page_info/page_info.h"
#include "components/privacy_sandbox/canonical_topic.h"
#include "components/privacy_sandbox/privacy_sandbox_features.h"
#include "components/safe_browsing/content/browser/password_protection/password_protection_test_util.h"
#include "components/safe_browsing/core/browser/password_protection/metrics_util.h"
#include "components/safe_browsing/core/common/features.h"
#include "components/strings/grit/components_strings.h"
#include "components/webapps/common/web_app_id.h"
#include "content/public/common/content_features.h"
#include "content/public/test/browser_test.h"
#include "net/dns/mock_host_resolver.h"
#include "net/test/cert_test_util.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
#include "net/test/test_certificate_data.h"
#include "net/test/test_data_directory.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/events/test/test_event.h"
#include "url/gurl.h"
#include "url/origin.h"
#if BUILDFLAG(IS_MAC)
#include "chrome/browser/web_applications/os_integration/mac/app_shim_registry.h"
#endif
namespace {
Status;
FeatureType;
constexpr int kTopicsAPITestTaxonomyVersion = …;
constexpr char kExpiredCertificateFile[] = …;
constexpr char kAboutThisSiteUrl[] = …;
constexpr char kHistoryUrl[] = …;
void OpenPageInfoBubble(Browser* browser) { … }
views::View* GetView(Browser* browser, int view_id) { … }
}
class PageInfoBubbleViewDialogBrowserTest : public DialogBrowserTest { … };
IN_PROC_BROWSER_TEST_F(PageInfoBubbleViewDialogBrowserTest,
InvokeUi_TrackingProtection3pcAllowedForSite) { … }
IN_PROC_BROWSER_TEST_F(PageInfoBubbleViewDialogBrowserTest,
InvokeUi_TrackingProtection3pcBlocked) { … }
IN_PROC_BROWSER_TEST_F(PageInfoBubbleViewDialogBrowserTest,
InvokeUi_TrackingProtection3pcLimited) { … }
IN_PROC_BROWSER_TEST_F(PageInfoBubbleViewDialogBrowserTest, InvokeUi_Insecure) { … }
IN_PROC_BROWSER_TEST_F(PageInfoBubbleViewDialogBrowserTest, InvokeUi_Secure) { … }
IN_PROC_BROWSER_TEST_F(PageInfoBubbleViewDialogBrowserTest,
InvokeUi_SecureSubpage) { … }
IN_PROC_BROWSER_TEST_F(PageInfoBubbleViewDialogBrowserTest, InvokeUi_EvSecure) { … }
IN_PROC_BROWSER_TEST_F(PageInfoBubbleViewDialogBrowserTest,
InvokeUi_EvSecureSubpage) { … }
IN_PROC_BROWSER_TEST_F(PageInfoBubbleViewDialogBrowserTest, InvokeUi_Internal) { … }
IN_PROC_BROWSER_TEST_F(PageInfoBubbleViewDialogBrowserTest,
InvokeUi_InternalExtension) { … }
IN_PROC_BROWSER_TEST_F(PageInfoBubbleViewDialogBrowserTest,
InvokeUi_InternalViewSource) { … }
IN_PROC_BROWSER_TEST_F(PageInfoBubbleViewDialogBrowserTest, InvokeUi_File) { … }
IN_PROC_BROWSER_TEST_F(PageInfoBubbleViewDialogBrowserTest, InvokeUi_Malware) { … }
IN_PROC_BROWSER_TEST_F(PageInfoBubbleViewDialogBrowserTest,
InvokeUi_Deceptive) { … }
IN_PROC_BROWSER_TEST_F(PageInfoBubbleViewDialogBrowserTest,
InvokeUi_UnwantedSoftware) { … }
IN_PROC_BROWSER_TEST_F(PageInfoBubbleViewDialogBrowserTest,
InvokeUi_MalwareAndBadCert) { … }
IN_PROC_BROWSER_TEST_F(PageInfoBubbleViewDialogBrowserTest,
InvokeUi_MixedContentForm) { … }
IN_PROC_BROWSER_TEST_F(PageInfoBubbleViewDialogBrowserTest,
InvokeUi_MixedContent) { … }
IN_PROC_BROWSER_TEST_F(PageInfoBubbleViewDialogBrowserTest,
InvokeUi_AllowAllPermissions) { … }
IN_PROC_BROWSER_TEST_F(PageInfoBubbleViewDialogBrowserTest,
InvokeUi_BlockAllPermissions) { … }
IN_PROC_BROWSER_TEST_F(PageInfoBubbleViewDialogBrowserTest,
InvokeUi_SavedPasswordReuse) { … }
IN_PROC_BROWSER_TEST_F(PageInfoBubbleViewDialogBrowserTest,
InvokeUi_SignInSyncPasswordReuse) { … }
IN_PROC_BROWSER_TEST_F(PageInfoBubbleViewDialogBrowserTest,
InvokeUi_SignInNonSyncPasswordReuse) { … }
IN_PROC_BROWSER_TEST_F(PageInfoBubbleViewDialogBrowserTest,
InvokeUi_EnterprisePasswordReuse) { … }
class PageInfoBubbleViewAboutThisSiteDialogBrowserTest
: public DialogBrowserTest { … };
IN_PROC_BROWSER_TEST_F(PageInfoBubbleViewAboutThisSiteDialogBrowserTest,
InvokeUi_AboutThisSite) { … }
class PageInfoBubbleViewPrivacySandboxDialogBrowserTest
: public DialogBrowserTest { … };
IN_PROC_BROWSER_TEST_F(PageInfoBubbleViewPrivacySandboxDialogBrowserTest,
InvokeUi_PrivacySandboxMain) { … }
IN_PROC_BROWSER_TEST_F(PageInfoBubbleViewPrivacySandboxDialogBrowserTest,
InvokeUi_PrivacySandboxSubpage) { … }
class PageInfoBubbleViewHistoryDialogBrowserTest : public DialogBrowserTest { … };
IN_PROC_BROWSER_TEST_F(PageInfoBubbleViewHistoryDialogBrowserTest,
InvokeUi_History) { … }
class PageInfoBubbleViewCookiesSubpageBrowserTest
: public DialogBrowserTest,
public testing::WithParamInterface<CookieBlocking3pcdStatus> { … };
IN_PROC_BROWSER_TEST_F(PageInfoBubbleViewCookiesSubpageBrowserTest,
InvokeUi_CookiesAllowedByTpcdGrant_3pcdLimited) { … }
IN_PROC_BROWSER_TEST_F(PageInfoBubbleViewCookiesSubpageBrowserTest,
InvokeUi_RwsOn) { … }
IN_PROC_BROWSER_TEST_F(PageInfoBubbleViewCookiesSubpageBrowserTest,
InvokeUi_ManagedRwsOn) { … }
IN_PROC_BROWSER_TEST_P(PageInfoBubbleViewCookiesSubpageBrowserTest,
InvokeUi_CookiesBlocked) { … }
IN_PROC_BROWSER_TEST_P(PageInfoBubbleViewCookiesSubpageBrowserTest,
InvokeUi_CookiesAllowedByCookieSetting) { … }
IN_PROC_BROWSER_TEST_P(PageInfoBubbleViewCookiesSubpageBrowserTest,
InvokeUi_TemporaryException) { … }
std::string ParamToTestSuffix(
const testing::TestParamInfo<
PageInfoBubbleViewCookiesSubpageBrowserTest::ParamType>& info) { … }
INSTANTIATE_TEST_SUITE_P(…);
class PageInfoBubbleViewIsolatedWebAppBrowserTest : public DialogBrowserTest { … };
IN_PROC_BROWSER_TEST_F(
PageInfoBubbleViewIsolatedWebAppBrowserTest,
InvokeUi_AppNameIsDisplayedInsteadOfOriginForIsolatedWebApps_REV2) { … }
namespace {
enum class WebAppWindowMode { … };
std::string WebAppWindowModeToString(
const testing::TestParamInfo<WebAppWindowMode>& info) { … }
}
class PageInfoBubbleViewWebAppBrowserTest
: public PageInfoBubbleViewDialogBrowserTest,
public testing::WithParamInterface<WebAppWindowMode> { … };
IN_PROC_BROWSER_TEST_P(PageInfoBubbleViewWebAppBrowserTest, InvokeUi_Default) { … }
#if BUILDFLAG(IS_MAC)
IN_PROC_BROWSER_TEST_P(PageInfoBubbleViewWebAppBrowserTest,
InvokeUi_NotificationSystemPermissionDenied) {
ShowAndVerifyUi();
}
#endif
INSTANTIATE_TEST_SUITE_P(…);