#include <string>
#include "base/memory/raw_ptr.h"
#include "base/memory/scoped_refptr.h"
#include "base/strings/stringprintf.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/metrics/user_action_tester.h"
#include "build/build_config.h"
#include "chrome/browser/extensions/browsertest_util.h"
#include "chrome/browser/extensions/chrome_test_extension_loader.h"
#include "chrome/browser/extensions/extension_action_runner.h"
#include "chrome/browser/extensions/extension_context_menu_model.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/extension_tab_util.h"
#include "chrome/browser/extensions/extension_util.h"
#include "chrome/browser/extensions/permissions/scripting_permissions_modifier.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_tabstrip.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/toolbar/toolbar_action_view_controller.h"
#include "chrome/browser/ui/toolbar/toolbar_actions_model.h"
#include "chrome/browser/ui/views/extensions/extensions_menu_coordinator.h"
#include "chrome/browser/ui/views/extensions/extensions_request_access_button.h"
#include "chrome/browser/ui/views/extensions/extensions_toolbar_button.h"
#include "chrome/browser/ui/views/extensions/extensions_toolbar_container.h"
#include "chrome/browser/ui/views/extensions/extensions_toolbar_interactive_uitest.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/grit/generated_resources.h"
#include "chrome/test/base/interactive_test_utils.h"
#include "chrome/test/base/ui_test_utils.h"
#include "content/public/browser/web_contents.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/test_navigation_observer.h"
#include "content/public/test/test_utils.h"
#include "extensions/browser/disable_reason.h"
#include "extensions/browser/extension_host_test_helper.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/browser/extension_system.h"
#include "extensions/browser/permissions_manager.h"
#include "extensions/browser/process_manager.h"
#include "extensions/browser/test_extension_registry_observer.h"
#include "extensions/browser/uninstall_reason.h"
#include "extensions/common/extension.h"
#include "extensions/common/extension_features.h"
#include "extensions/test/extension_test_message_listener.h"
#include "extensions/test/test_extension_dir.h"
#include "net/dns/mock_host_resolver.h"
#include "ui/base/dragdrop/drag_drop_types.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/views/bubble/bubble_dialog_model_host.h"
#include "ui/views/layout/animating_layout_manager_test_util.h"
#include "ui/views/test/widget_test.h"
#include "ui/views/widget/widget.h"
namespace {
ScriptingPermissionsModifier;
PermissionsManager;
constexpr char kInjectionSucceededMessage[] = …;
views::Widget* CreateBubble(views::View* anchor_point) { … }
}
UserSiteAccess;
SiteInteraction;
class ExtensionsToolbarContainerUITest : public ExtensionsToolbarUITest { … };
IN_PROC_BROWSER_TEST_F(ExtensionsToolbarContainerUITest, InvocationMetrics) { … }
IN_PROC_BROWSER_TEST_F(ExtensionsToolbarContainerUITest,
InvisibleWithoutExtension_Disable) { … }
IN_PROC_BROWSER_TEST_F(ExtensionsToolbarContainerUITest,
InvisibleWithoutExtension_Uninstall) { … }
IN_PROC_BROWSER_TEST_F(ExtensionsToolbarContainerUITest,
InvisibleWithoutExtension_Blocklist) { … }
IN_PROC_BROWSER_TEST_F(ExtensionsToolbarContainerUITest,
InvisibleWithoutExtension_Terminate) { … }
#if BUILDFLAG(IS_CHROMEOS_LACROS)
#define MAYBE_ClickingOnASecondActionClosesTheFirst …
#else
#define MAYBE_ClickingOnASecondActionClosesTheFirst …
#endif
IN_PROC_BROWSER_TEST_F(ExtensionsToolbarContainerUITest,
MAYBE_ClickingOnASecondActionClosesTheFirst) { … }
IN_PROC_BROWSER_TEST_F(ExtensionsToolbarContainerUITest,
DoubleClickToolbarActionToClose) { … }
IN_PROC_BROWSER_TEST_F(ExtensionsToolbarContainerUITest,
ShowWidgetForExtension_Pinned) { … }
IN_PROC_BROWSER_TEST_F(ExtensionsToolbarContainerUITest,
ShowWidgetForExtension_Unpinned) { … }
IN_PROC_BROWSER_TEST_F(ExtensionsToolbarContainerUITest,
ShowWidgetForExtension_NoAction) { … }
IN_PROC_BROWSER_TEST_F(ExtensionsToolbarContainerUITest,
UninstallExtensionWithActivelyShownWidget) { … }
IN_PROC_BROWSER_TEST_F(ExtensionsToolbarContainerUITest,
IncognitoDraggingIsDisabled) { … }
IN_PROC_BROWSER_TEST_F(ExtensionsToolbarContainerUITest,
UnloadingExtensionWhileAboutToShowPopup) { … }
namespace {
class IncognitoExtensionsToolbarContainerUITest
: public ExtensionsToolbarContainerUITest { … };
}
IN_PROC_BROWSER_TEST_F(IncognitoExtensionsToolbarContainerUITest,
TestExtensionFirstLoadedInIncognitoMode) { … }
class ExtensionsToolbarRuntimeHostPermissionsBrowserTest
: public ExtensionsToolbarContainerUITest,
public testing::WithParamInterface<bool> { … };
INSTANTIATE_TEST_SUITE_P(…);
IN_PROC_BROWSER_TEST_P(ExtensionsToolbarRuntimeHostPermissionsBrowserTest,
ContextMenuPageAccess_RefreshRequired) { … }
IN_PROC_BROWSER_TEST_P(ExtensionsToolbarRuntimeHostPermissionsBrowserTest,
ContextMenuPageAccess_RefreshNotRequired) { … }
class ExtensionsToolbarContainerFeatureUITest
: public ExtensionsToolbarContainerUITest { … };
class ExtensionsToolbarContainerFeatureUIReloadBubbleAcceptanceTest
: public ExtensionsToolbarContainerFeatureUITest,
public testing::WithParamInterface<bool> { … };
INSTANTIATE_TEST_SUITE_P(…);
IN_PROC_BROWSER_TEST_P(
ExtensionsToolbarContainerFeatureUIReloadBubbleAcceptanceTest,
ClickingRequestAccessButtonRunsAction_RefreshRequired) { … }
IN_PROC_BROWSER_TEST_F(ExtensionsToolbarContainerFeatureUITest,
SidePanelContextMenuItemClosesExtensionsMenu) { … }
IN_PROC_BROWSER_TEST_F(
ExtensionsToolbarContainerFeatureUITest,
ClickingRequestAccessButtonRunsAction_RefreshNotRequired) { … }
IN_PROC_BROWSER_TEST_F(
ExtensionsToolbarContainerFeatureUITest,
DISABLED_ClickingRequestAccessButton_ConfirmationCollapsedOnNavigation) { … }
IN_PROC_BROWSER_TEST_F(ExtensionsToolbarContainerFeatureUITest,
SiteAccessRequestsForMultipleTabs) { … }
IN_PROC_BROWSER_TEST_F(ExtensionsToolbarContainerFeatureUITest,
CorrectReorderAfterDynamicChanges) { … }