chromium/chrome/test/data/webui/extensions/extensions_browsertest.cc

// Copyright 2023 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "base/strings/stringprintf.h"
#include "chrome/browser/ui/webui/extensions/extension_settings_test_base.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/webui_url_constants.h"
#include "chrome/test/base/web_ui_mocha_browser_test.h"
#include "content/public/test/browser_test.h"

class ExtensionsBrowserTest : public WebUIMochaBrowserTest {};

CrExtensionsTest;

IN_PROC_BROWSER_TEST_F(CrExtensionsTest, ActivityLog) {}

IN_PROC_BROWSER_TEST_F(CrExtensionsTest, ActivityLogHistory) {}

IN_PROC_BROWSER_TEST_F(CrExtensionsTest, ActivityLogHistoryItem) {}

IN_PROC_BROWSER_TEST_F(CrExtensionsTest, ActivityLogStream) {}

IN_PROC_BROWSER_TEST_F(CrExtensionsTest, ActivityLogStreamItem) {}

IN_PROC_BROWSER_TEST_F(CrExtensionsTest, ToggleRow) {}

IN_PROC_BROWSER_TEST_F(CrExtensionsTest, RuntimeHostsDialog) {}

IN_PROC_BROWSER_TEST_F(CrExtensionsTest, RuntimeHostPermissions) {}

IN_PROC_BROWSER_TEST_F(CrExtensionsTest, HostPermissionsToggleList) {}

IN_PROC_BROWSER_TEST_F(CrExtensionsTest,
                       ExtensionsMV2DeprecationPanelWarningStage) {}

IN_PROC_BROWSER_TEST_F(CrExtensionsTest,
                       ExtensionsMV2DeprecationPanelDisabledStage) {}

IN_PROC_BROWSER_TEST_F(CrExtensionsTest, SafetyCheckReviewPanel) {}

IN_PROC_BROWSER_TEST_F(CrExtensionsTest, SitePermissions) {}

IN_PROC_BROWSER_TEST_F(CrExtensionsTest, SitePermissionsBySite) {}

IN_PROC_BROWSER_TEST_F(CrExtensionsTest, SitePermissionsEditUrlDialog) {}

IN_PROC_BROWSER_TEST_F(CrExtensionsTest, SitePermissionsList) {}

IN_PROC_BROWSER_TEST_F(CrExtensionsTest, UrlUtil) {}

IN_PROC_BROWSER_TEST_F(CrExtensionsTest, SitePermissionsEditPermissionsDialog) {}

IN_PROC_BROWSER_TEST_F(CrExtensionsTest, SitePermissionsSiteGroup) {}

////////////////////////////////////////////////////////////////////////////////
// Extension Sidebar Tests

class CrExtensionsSidebarTest : public ExtensionsBrowserTest {};

IN_PROC_BROWSER_TEST_F(CrExtensionsSidebarTest, HrefVerification) {}

IN_PROC_BROWSER_TEST_F(CrExtensionsSidebarTest, LayoutAndClickHandlers) {}

IN_PROC_BROWSER_TEST_F(CrExtensionsSidebarTest, SetSelected) {}

////////////////////////////////////////////////////////////////////////////////
// Extension Toolbar Tests

class CrExtensionsToolbarTest : public ExtensionsBrowserTest {};

IN_PROC_BROWSER_TEST_F(CrExtensionsToolbarTest, Layout) {}

IN_PROC_BROWSER_TEST_F(CrExtensionsToolbarTest, DevModeToggle) {}

IN_PROC_BROWSER_TEST_F(CrExtensionsToolbarTest, FailedUpdateFiresLoadError) {}

IN_PROC_BROWSER_TEST_F(CrExtensionsToolbarTest, NarrowModeShowsMenu) {}

// TODO(crbug.com/40592901) Disabled on other platforms but MacOS due to
// timeouts.
#if !BUILDFLAG(IS_MAC)
#define MAYBE_ClickHandlers
#else
#define MAYBE_ClickHandlers
#endif
IN_PROC_BROWSER_TEST_F(CrExtensionsToolbarTest, MAYBE_ClickHandlers) {}

////////////////////////////////////////////////////////////////////////////////
// Extension Item Tests

class CrExtensionsItemsTest : public ExtensionsBrowserTest {};

IN_PROC_BROWSER_TEST_F(CrExtensionsItemsTest, NormalState) {}

IN_PROC_BROWSER_TEST_F(CrExtensionsItemsTest, DeveloperState) {}

IN_PROC_BROWSER_TEST_F(CrExtensionsItemsTest, ClickableItems) {}

IN_PROC_BROWSER_TEST_F(CrExtensionsItemsTest, FailedReloadFiresLoadError) {}

IN_PROC_BROWSER_TEST_F(CrExtensionsItemsTest, Warnings) {}

IN_PROC_BROWSER_TEST_F(CrExtensionsItemsTest, SourceIndicator) {}

IN_PROC_BROWSER_TEST_F(CrExtensionsItemsTest, EnableToggle) {}

IN_PROC_BROWSER_TEST_F(CrExtensionsItemsTest, RemoveButton) {}

IN_PROC_BROWSER_TEST_F(CrExtensionsItemsTest, HtmlInName) {}

IN_PROC_BROWSER_TEST_F(CrExtensionsItemsTest, RepairButton) {}

IN_PROC_BROWSER_TEST_F(CrExtensionsItemsTest, InspectableViewSortOrder) {}

IN_PROC_BROWSER_TEST_F(CrExtensionsItemsTest, EnableExtensionToggleTooltips) {}

class CrExtensionsDetailViewTest : public ExtensionsBrowserTest {};

IN_PROC_BROWSER_TEST_F(CrExtensionsDetailViewTest, Layout) {}

IN_PROC_BROWSER_TEST_F(CrExtensionsDetailViewTest, LayoutSource) {}

IN_PROC_BROWSER_TEST_F(CrExtensionsDetailViewTest,
                       ElementVisibilityReloadButton) {}

IN_PROC_BROWSER_TEST_F(CrExtensionsDetailViewTest, FailedReloadFiresLoadError) {}

IN_PROC_BROWSER_TEST_F(CrExtensionsDetailViewTest,
                       SupervisedUserDisableReasons) {}

IN_PROC_BROWSER_TEST_F(CrExtensionsDetailViewTest, ClickableElements) {}

IN_PROC_BROWSER_TEST_F(CrExtensionsDetailViewTest, Indicator) {}

IN_PROC_BROWSER_TEST_F(CrExtensionsDetailViewTest, Warnings) {}

IN_PROC_BROWSER_TEST_F(CrExtensionsDetailViewTest,
                       NoSiteAccessWithEnhancedSiteControls) {}

IN_PROC_BROWSER_TEST_F(CrExtensionsDetailViewTest, InspectableViewSortOrder) {}

IN_PROC_BROWSER_TEST_F(CrExtensionsDetailViewTest,
                       ShowAccessRequestsInToolbar) {}

IN_PROC_BROWSER_TEST_F(CrExtensionsDetailViewTest, SafetyCheckWarning) {}

IN_PROC_BROWSER_TEST_F(CrExtensionsDetailViewTest, Mv2DeprecationMessage_None) {}

IN_PROC_BROWSER_TEST_F(CrExtensionsDetailViewTest,
                       Mv2DeprecationMessage_Warning) {}

IN_PROC_BROWSER_TEST_F(CrExtensionsDetailViewTest,
                       Mv2DeprecationMessage_DisableWithReEnable_Visbility) {}

IN_PROC_BROWSER_TEST_F(CrExtensionsDetailViewTest,
                       Mv2DeprecationMessage_DisableWithReEnable) {}

IN_PROC_BROWSER_TEST_F(CrExtensionsDetailViewTest, PinnedToToolbar) {}

////////////////////////////////////////////////////////////////////////////////
// Extension Item List Tests

class CrExtensionsItemListTest : public ExtensionsBrowserTest {};

IN_PROC_BROWSER_TEST_F(CrExtensionsItemListTest, Filtering) {}

IN_PROC_BROWSER_TEST_F(CrExtensionsItemListTest, NoItems) {}

IN_PROC_BROWSER_TEST_F(CrExtensionsItemListTest, NoSearchResults) {}

IN_PROC_BROWSER_TEST_F(CrExtensionsItemListTest, SectionsVisibility) {}

IN_PROC_BROWSER_TEST_F(CrExtensionsItemListTest, LoadTimeData) {}

IN_PROC_BROWSER_TEST_F(CrExtensionsItemListTest, SafetyCheckPanel_Disabled) {}

IN_PROC_BROWSER_TEST_F(CrExtensionsItemListTest,
                       SafetyCheckPanel_EnabledSafetyCheck) {}

IN_PROC_BROWSER_TEST_F(CrExtensionsItemListTest,
                       SafetyCheckPanel_EnabledSafetyHub) {}

IN_PROC_BROWSER_TEST_F(CrExtensionsItemListTest,
                       ManifestV2DeprecationPanel_None) {}

IN_PROC_BROWSER_TEST_F(CrExtensionsItemListTest,
                       ManifestV2DeprecationPanel_Warning) {}

IN_PROC_BROWSER_TEST_F(CrExtensionsItemListTest,
                       ManifestV2DeprecationPanel_DisableWithReEnable) {}

IN_PROC_BROWSER_TEST_F(CrExtensionsItemListTest,
                       ManifestV2DeprecationPanel_TitleVisibility) {}

////////////////////////////////////////////////////////////////////////////////
// Extension Load Error Tests

class CrExtensionsLoadErrorTest : public ExtensionsBrowserTest {};

IN_PROC_BROWSER_TEST_F(CrExtensionsLoadErrorTest, RetryError) {}

IN_PROC_BROWSER_TEST_F(CrExtensionsLoadErrorTest, RetrySuccess) {}

IN_PROC_BROWSER_TEST_F(CrExtensionsLoadErrorTest, CodeSection) {}

IN_PROC_BROWSER_TEST_F(CrExtensionsLoadErrorTest, PathWithoutSource) {}

IN_PROC_BROWSER_TEST_F(CrExtensionsLoadErrorTest, GenericError) {}

////////////////////////////////////////////////////////////////////////////////
// Extension Manager Tests

class CrExtensionsManagerUnitTest : public ExtensionsBrowserTest {};

IN_PROC_BROWSER_TEST_F(CrExtensionsManagerUnitTest, ItemOrder) {}

IN_PROC_BROWSER_TEST_F(CrExtensionsManagerUnitTest, SetItemData) {}

IN_PROC_BROWSER_TEST_F(CrExtensionsManagerUnitTest, UpdateItemData) {}

IN_PROC_BROWSER_TEST_F(CrExtensionsManagerUnitTest, ProfileSettings) {}

IN_PROC_BROWSER_TEST_F(CrExtensionsManagerUnitTest, Uninstall) {}

IN_PROC_BROWSER_TEST_F(CrExtensionsManagerUnitTest, UninstallFocus) {}

// Flaky since r621915: https://crbug.com/922490
IN_PROC_BROWSER_TEST_F(CrExtensionsManagerUnitTest,
                       DISABLED_UninstallFromDetails) {}

IN_PROC_BROWSER_TEST_F(CrExtensionsManagerUnitTest, ToggleIncognito) {}

IN_PROC_BROWSER_TEST_F(CrExtensionsManagerUnitTest, EnableAndDisable) {}

class CrExtensionsManagerTestWithMultipleExtensionTypesInstalled
    : public ExtensionSettingsTestBase {};

IN_PROC_BROWSER_TEST_F(
    CrExtensionsManagerTestWithMultipleExtensionTypesInstalled,
    ItemListVisibility) {}

IN_PROC_BROWSER_TEST_F(
    CrExtensionsManagerTestWithMultipleExtensionTypesInstalled,
    SplitItems) {}

IN_PROC_BROWSER_TEST_F(
    CrExtensionsManagerTestWithMultipleExtensionTypesInstalled,
    ChangePages) {}

IN_PROC_BROWSER_TEST_F(
    CrExtensionsManagerTestWithMultipleExtensionTypesInstalled,
    CloseDrawerOnNarrowModeExit) {}

IN_PROC_BROWSER_TEST_F(
    CrExtensionsManagerTestWithMultipleExtensionTypesInstalled,
    PageTitleUpdate) {}

IN_PROC_BROWSER_TEST_F(
    CrExtensionsManagerTestWithMultipleExtensionTypesInstalled,
    NavigateToSitePermissionsFail) {}

IN_PROC_BROWSER_TEST_F(
    CrExtensionsManagerTestWithMultipleExtensionTypesInstalled,
    NavigateToSitePermissionsSuccess) {}

class CrExtensionsManagerTestWithIdQueryParam
    : public ExtensionSettingsTestBase {};

IN_PROC_BROWSER_TEST_F(CrExtensionsManagerTestWithIdQueryParam,
                       UrlNavigationToDetails) {}

// Disabled as flaky. TODO(crbug.com/40719203): Enable this test.
IN_PROC_BROWSER_TEST_F(CrExtensionsManagerTestWithIdQueryParam,
                       DISABLED_UrlNavigationToActivityLogFail) {}

class CrExtensionsManagerUnitTestWithActivityLogFlag
    : public ExtensionsBrowserTest {};

IN_PROC_BROWSER_TEST_F(CrExtensionsManagerUnitTestWithActivityLogFlag, All) {}

class CrExtensionsManagerTestWithActivityLogFlag
    : public ExtensionsBrowserTest {};

IN_PROC_BROWSER_TEST_F(CrExtensionsManagerTestWithActivityLogFlag, All) {}

////////////////////////////////////////////////////////////////////////////////
// Extension Options Dialog Tests

class CrExtensionsOptionsDialogTest : public ExtensionSettingsTestBase {};

// TODO(crbug.com/40109111): Flaky on multiple platforms.
IN_PROC_BROWSER_TEST_F(CrExtensionsOptionsDialogTest, DISABLED_Layout) {}

////////////////////////////////////////////////////////////////////////////////
// Error Console tests

class CrExtensionsErrorConsoleTest : public ExtensionSettingsTestBase {};

IN_PROC_BROWSER_TEST_F(CrExtensionsErrorConsoleTest, TestUpDownErrors) {}

////////////////////////////////////////////////////////////////////////////////
// Extension Keyboard Shortcuts Tests

class CrExtensionsShortcutTest : public ExtensionsBrowserTest {};

IN_PROC_BROWSER_TEST_F(CrExtensionsShortcutTest, Layout) {}

IN_PROC_BROWSER_TEST_F(CrExtensionsShortcutTest, IsValidKeyCode) {}

IN_PROC_BROWSER_TEST_F(CrExtensionsShortcutTest, KeyStrokeToString) {}

IN_PROC_BROWSER_TEST_F(CrExtensionsShortcutTest, ScopeChange) {}

////////////////////////////////////////////////////////////////////////////////
// Extension Pack Dialog Tests

class CrExtensionsPackDialogTest : public ExtensionsBrowserTest {};

IN_PROC_BROWSER_TEST_F(CrExtensionsPackDialogTest, Interaction) {}

// Disabling on Windows due to flaky timeout on some build bots.
// http://crbug.com/832885
#if BUILDFLAG(IS_WIN)
#define MAYBE_PackSuccess
#else
#define MAYBE_PackSuccess
#endif
IN_PROC_BROWSER_TEST_F(CrExtensionsPackDialogTest, MAYBE_PackSuccess) {}

IN_PROC_BROWSER_TEST_F(CrExtensionsPackDialogTest, PackError) {}

// Temporarily disabling on Mac due to flakiness.
// http://crbug.com/877109
#if BUILDFLAG(IS_MAC)
#define MAYBE_PackWarning
#else
#define MAYBE_PackWarning
#endif
IN_PROC_BROWSER_TEST_F(CrExtensionsPackDialogTest, MAYBE_PackWarning) {}

////////////////////////////////////////////////////////////////////////////////
// Extension Error Page Tests

class CrExtensionsErrorPageTest : public ExtensionsBrowserTest {};

IN_PROC_BROWSER_TEST_F(CrExtensionsErrorPageTest, Layout) {}

IN_PROC_BROWSER_TEST_F(CrExtensionsErrorPageTest, CodeSection) {}

IN_PROC_BROWSER_TEST_F(CrExtensionsErrorPageTest, ErrorSelection) {}

IN_PROC_BROWSER_TEST_F(CrExtensionsErrorPageTest, InvalidUrl) {}

IN_PROC_BROWSER_TEST_F(CrExtensionsErrorPageTest, ReloadItem) {}

////////////////////////////////////////////////////////////////////////////////
// Extension Code Section Tests

class CrExtensionsCodeSectionTest : public ExtensionsBrowserTest {};

IN_PROC_BROWSER_TEST_F(CrExtensionsCodeSectionTest, Layout) {}

IN_PROC_BROWSER_TEST_F(CrExtensionsCodeSectionTest, LongSource) {}

////////////////////////////////////////////////////////////////////////////////
// Extension Navigation Helper Tests

class CrExtensionsNavigationHelperTest : public ExtensionsBrowserTest {};

IN_PROC_BROWSER_TEST_F(CrExtensionsNavigationHelperTest, Basic) {}

IN_PROC_BROWSER_TEST_F(CrExtensionsNavigationHelperTest, Conversions) {}

IN_PROC_BROWSER_TEST_F(CrExtensionsNavigationHelperTest, PushAndReplaceState) {}

IN_PROC_BROWSER_TEST_F(CrExtensionsNavigationHelperTest, SupportedRoutes) {}