#include "chrome/browser/ui/views/extensions/extensions_toolbar_container.h"
#include "base/json/json_reader.h"
#include "base/ranges/algorithm.h"
#include "base/test/metrics/user_action_tester.h"
#include "chrome/browser/extensions/chrome_test_extension_loader.h"
#include "chrome/browser/extensions/extension_action_runner.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/extension_tab_util.h"
#include "chrome/browser/ui/toolbar/toolbar_action_view_controller.h"
#include "chrome/browser/ui/views/extensions/extensions_toolbar_button.h"
#include "chrome/browser/ui/views/extensions/extensions_toolbar_unittest.h"
#include "components/sync_preferences/testing_pref_service_syncable.h"
#include "extensions/browser/pref_names.h"
#include "extensions/browser/test_extension_registry_observer.h"
#include "extensions/common/extension_features.h"
#include "extensions/common/extension_id.h"
#include "extensions/test/permissions_manager_waiter.h"
#include "extensions/test/test_extension_dir.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "ui/base/dragdrop/drag_drop_types.h"
#include "ui/base/dragdrop/mojom/drag_drop_types.mojom.h"
namespace {
SitePermissionsHelper;
PermissionsManager;
base::TimeDelta kConfirmationDisplayDuration = …;
class AdditionalBrowser { … };
}
class ExtensionsToolbarContainerUnitTest : public ExtensionsToolbarUnitTest { … };
ExtensionsToolbarContainerUnitTest::ExtensionsToolbarContainerUnitTest()
: … { … }
void ExtensionsToolbarContainerUnitTest::NavigateAndCommit(const GURL& url) { … }
ToolbarActionView* ExtensionsToolbarContainerUnitTest::GetPinnedExtensionView(
const extensions::ExtensionId& extension_id) { … }
bool ExtensionsToolbarContainerUnitTest::IsRequestAccessButtonVisible() { … }
void ExtensionsToolbarContainerUnitTest::SetUp() { … }
TEST_F(ExtensionsToolbarContainerUnitTest, ReorderPinnedExtensions) { … }
TEST_F(ExtensionsToolbarContainerUnitTest, ForcePinnedExtensionsCannotReorder) { … }
TEST_F(ExtensionsToolbarContainerUnitTest, ReloadExtensionKeepsPinnedState) { … }
TEST_F(ExtensionsToolbarContainerUnitTest, ReloadExtensionFailed) { … }
TEST_F(ExtensionsToolbarContainerUnitTest,
PinnedExtensionAppearsInAnotherWindow) { … }
TEST_F(ExtensionsToolbarContainerUnitTest,
PinnedExtensionsReorderOnPrefChange) { … }
TEST_F(ExtensionsToolbarContainerUnitTest, RunDropCallback) { … }
TEST_F(ExtensionsToolbarContainerUnitTest, ResetDropCallback) { … }
TEST_F(ExtensionsToolbarContainerUnitTest,
InvalidateDropCallbackOnActionAdded) { … }
TEST_F(ExtensionsToolbarContainerUnitTest, InvalidateDropCallbackOnPrefChange) { … }
TEST_F(ExtensionsToolbarContainerUnitTest,
ExtensionsButton_SitePermissionsUpdates) { … }
TEST_F(ExtensionsToolbarContainerUnitTest,
ExtensionsButton_ChromeRestrictedSite) { … }
TEST_F(ExtensionsToolbarContainerUnitTest, RequestAccessButton_Extensions) { … }
TEST_F(ExtensionsToolbarContainerUnitTest,
RequestAccessButton_RequestWithPattern) { … }
TEST_F(ExtensionsToolbarContainerUnitTest,
RequestAccessButton_ExtensionGrantedSiteAccess) { … }
TEST_F(ExtensionsToolbarContainerUnitTest,
RequestAccessButtonVisibility_NavigationBetweenPages) { … }
TEST_F(ExtensionsToolbarContainerUnitTest,
RequestAccessButton_NavigationBetweenPages_RequestWithPattern) { … }
TEST_F(ExtensionsToolbarContainerUnitTest,
RequestAccessButton_UserSiteSetting) { … }
TEST_F(ExtensionsToolbarContainerUnitTest,
RequestAccessButton_ExtensionsNotAllowedInButton) { … }
TEST_F(ExtensionsToolbarContainerUnitTest,
RequestAccessButton_RequestDismissed) { … }
TEST_F(ExtensionsToolbarContainerUnitTest,
RequestAccessButton_OnPressedExecuteAction) { … }
TEST_F(ExtensionsToolbarContainerUnitTest,
RequestAccessButton_UpdateInBetweenClickAndConfirmationCollapse) { … }
class ExtensionsToolbarContainerWithPermittedSitesUnitTest
: public ExtensionsToolbarContainerUnitTest { … };
TEST_F(ExtensionsToolbarContainerWithPermittedSitesUnitTest,
RequestAccessButtonVisibilityOnPermittedSites) { … }