#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "chrome/browser/extensions/extension_service.h"
#include <stddef.h>
#include <stdint.h>
#include <map>
#include <memory>
#include <optional>
#include <set>
#include <string>
#include <utility>
#include <vector>
#include "base/command_line.h"
#include "base/containers/contains.h"
#include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h"
#include "base/functional/bind.h"
#include "base/json/json_file_value_serializer.h"
#include "base/json/json_reader.h"
#include "base/json/json_string_value_serializer.h"
#include "base/location.h"
#include "base/memory/ptr_util.h"
#include "base/one_shot_event.h"
#include "base/path_service.h"
#include "base/ranges/algorithm.h"
#include "base/run_loop.h"
#include "base/strings/pattern.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "base/task/single_thread_task_runner.h"
#include "base/test/bind.h"
#include "base/test/gmock_expected_support.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/test_future.h"
#include "base/time/time.h"
#include "base/values.h"
#include "base/version.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "chrome/browser/background/background_contents_service.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/enterprise/browser_management/management_service_factory.h"
#include "chrome/browser/extensions/blocklist.h"
#include "chrome/browser/extensions/chrome_app_sorting.h"
#include "chrome/browser/extensions/chrome_extension_cookies.h"
#include "chrome/browser/extensions/chrome_test_extension_loader.h"
#include "chrome/browser/extensions/chrome_zipfile_installer.h"
#include "chrome/browser/extensions/component_loader.h"
#include "chrome/browser/extensions/crx_installer.h"
#include "chrome/browser/extensions/extension_error_ui.h"
#include "chrome/browser/extensions/extension_management_test_util.h"
#include "chrome/browser/extensions/extension_service_test_base.h"
#include "chrome/browser/extensions/extension_service_test_with_install.h"
#include "chrome/browser/extensions/extension_special_storage_policy.h"
#include "chrome/browser/extensions/extension_util.h"
#include "chrome/browser/extensions/external_install_error.h"
#include "chrome/browser/extensions/external_install_manager.h"
#include "chrome/browser/extensions/external_policy_loader.h"
#include "chrome/browser/extensions/external_pref_loader.h"
#include "chrome/browser/extensions/external_provider_impl.h"
#include "chrome/browser/extensions/external_testing_loader.h"
#include "chrome/browser/extensions/fake_safe_browsing_database_manager.h"
#include "chrome/browser/extensions/installed_loader.h"
#include "chrome/browser/extensions/load_error_reporter.h"
#include "chrome/browser/extensions/pack_extension_job.h"
#include "chrome/browser/extensions/pending_extension_info.h"
#include "chrome/browser/extensions/pending_extension_manager.h"
#include "chrome/browser/extensions/permissions/permissions_test_util.h"
#include "chrome/browser/extensions/permissions/permissions_updater.h"
#include "chrome/browser/extensions/plugin_manager.h"
#include "chrome/browser/extensions/preinstalled_apps.h"
#include "chrome/browser/extensions/scoped_database_manager_for_test.h"
#include "chrome/browser/extensions/test_blocklist.h"
#include "chrome/browser/extensions/test_extension_system.h"
#include "chrome/browser/extensions/unpacked_installer.h"
#include "chrome/browser/extensions/updater/extension_updater.h"
#include "chrome/browser/notifications/notification_display_service_tester.h"
#include "chrome/browser/policy/policy_test_utils.h"
#include "chrome/browser/policy/profile_policy_connector.h"
#include "chrome/browser/themes/theme_service.h"
#include "chrome/browser/ui/global_error/global_error.h"
#include "chrome/browser/ui/global_error/global_error_service.h"
#include "chrome/browser/ui/global_error/global_error_service_factory.h"
#include "chrome/browser/ui/global_error/global_error_waiter.h"
#include "chrome/browser/web_applications/preinstalled_app_install_features.h"
#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/extensions/manifest_handlers/app_launch_info.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
#include "chrome/grit/browser_resources.h"
#include "chrome/grit/generated_resources.h"
#include "chrome/test/base/scoped_browser_locale.h"
#include "chrome/test/base/testing_profile.h"
#include "components/crx_file/id_util.h"
#include "components/policy/core/common/management/scoped_management_service_override_for_testing.h"
#include "components/policy/core/common/policy_pref_names.h"
#include "components/pref_registry/pref_registry_syncable.h"
#include "components/prefs/scoped_user_pref_update.h"
#include "components/safe_browsing/buildflags.h"
#include "components/services/storage/privileged/mojom/indexed_db_control.mojom.h"
#include "components/services/storage/privileged/mojom/indexed_db_control_test.mojom.h"
#include "components/services/storage/public/mojom/local_storage_control.mojom.h"
#include "components/services/storage/public/mojom/storage_usage_info.mojom.h"
#include "components/sync/model/string_ordinal.h"
#include "components/sync_preferences/pref_service_syncable.h"
#include "components/sync_preferences/testing_pref_service_syncable.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/dom_storage_context.h"
#include "content/public/browser/gpu_data_manager.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/storage_partition.h"
#include "content/public/common/content_constants.h"
#include "content/public/test/browser_task_environment.h"
#include "extensions/browser/blocklist_extension_prefs.h"
#include "extensions/browser/blocklist_state.h"
#include "extensions/browser/disable_reason.h"
#include "extensions/browser/extension_creator.h"
#include "extensions/browser/extension_file_task_runner.h"
#include "extensions/browser/extension_prefs.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/browser/extension_system.h"
#include "extensions/browser/extension_util.h"
#include "extensions/browser/external_install_info.h"
#include "extensions/browser/external_provider_interface.h"
#include "extensions/browser/install_flag.h"
#include "extensions/browser/management_policy.h"
#include "extensions/browser/mock_external_provider.h"
#include "extensions/browser/pref_names.h"
#include "extensions/browser/test_extension_registry_observer.h"
#include "extensions/browser/test_management_policy.h"
#include "extensions/browser/uninstall_reason.h"
#include "extensions/browser/updater/extension_downloader_test_helper.h"
#include "extensions/browser/updater/null_extension_cache.h"
#include "extensions/browser/zipfile_installer.h"
#include "extensions/common/extension.h"
#include "extensions/common/extension_builder.h"
#include "extensions/common/extension_features.h"
#include "extensions/common/extension_l10n_util.h"
#include "extensions/common/extension_resource.h"
#include "extensions/common/extension_urls.h"
#include "extensions/common/file_util.h"
#include "extensions/common/manifest_constants.h"
#include "extensions/common/manifest_handlers/background_info.h"
#include "extensions/common/manifest_handlers/content_scripts_handler.h"
#include "extensions/common/manifest_handlers/permissions_parser.h"
#include "extensions/common/manifest_url_handlers.h"
#include "extensions/common/permissions/permission_set.h"
#include "extensions/common/permissions/permissions_data.h"
#include "extensions/common/switches.h"
#include "extensions/common/url_pattern.h"
#include "extensions/common/verifier_formats.h"
#include "extensions/test/test_extension_dir.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "net/cookies/canonical_cookie.h"
#include "net/cookies/cookie_access_result.h"
#include "net/cookies/cookie_options.h"
#include "net/cookies/cookie_store.h"
#include "net/cookies/cookie_util.h"
#include "ppapi/buildflags/buildflags.h"
#include "services/network/public/mojom/cookie_manager.mojom.h"
#include "services/network/public/mojom/network_context.mojom.h"
#include "services/network/public/mojom/network_service.mojom.h"
#include "storage/browser/quota/quota_manager.h"
#include "storage/browser/quota/quota_manager_proxy.h"
#include "storage/common/database/database_identifier.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/platform_test.h"
#include "third_party/blink/public/common/storage_key/storage_key.h"
#include "third_party/blink/public/mojom/dom_storage/storage_area.mojom.h"
#include "ui/base/l10n/l10n_util.h"
#include "url/gurl.h"
#include "url/origin.h"
#if BUILDFLAG(ENABLE_PLUGINS)
#include "content/public/browser/plugin_service.h"
#endif
#if BUILDFLAG(SAFE_BROWSING_DB_LOCAL)
#define ENABLE_BLOCKLIST_TESTS
#endif
ScopedObservation;
BrowserContext;
BrowserThread;
DOMStorageContext;
APIPermissionID;
ManifestLocation;
namespace extensions {
keys;
namespace {
const char good0[] = …;
const char good1[] = …;
const char good2[] = …;
const char all_zero[] = …;
const char good2048[] = …;
const char good_crx[] = …;
const char minimal_platform_app_crx[] = …;
const char hosted_app[] = …;
const char page_action[] = …;
const char theme_crx[] = …;
const char theme2_crx[] = …;
const char permissions_crx[] = …;
const char updates_from_webstore[] = …;
const char updates_from_webstore2[] = …;
const char updates_from_webstore3[] = …;
const char permissions_blocklist[] = …;
const char video_player_app[] = …;
const char kPrefBlocklistState[] = …;
static constexpr int kBlocklistedMalwareInteger = …;
struct BubbleErrorsTestData { … };
static void AddPattern(URLPatternSet* extent, const std::string& pattern) { … }
base::FilePath GetTemporaryFile() { … }
bool HasExternalInstallErrors(ExtensionService* service) { … }
bool HasExternalInstallBubble(ExtensionService* service) { … }
size_t GetExternalInstallBubbleCount(ExtensionService* service) { … }
scoped_refptr<const Extension> CreateExtension(const std::string& name,
const base::FilePath& path,
ManifestLocation location) { … }
std::unique_ptr<ExternalInstallInfoFile> CreateExternalExtension(
const ExtensionId& extension_id,
const std::string& version_str,
const base::FilePath& path,
ManifestLocation location,
Extension::InitFromValueFlags flags) { … }
void PersistExtensionWithPaths(
const base::FilePath& extension_dir,
const std::vector<base::FilePath>& directory_paths,
const std::vector<base::FilePath>& file_paths) { … }
}
class MockProviderVisitor : public ExternalProviderInterface::VisitorInterface { … };
class MockUpdateProviderVisitor : public MockProviderVisitor { … };
struct MockExtensionRegistryObserver : public ExtensionRegistryObserver { … };
class ExtensionLoadedObserver : public ExtensionRegistryObserver { … };
class PendingRemovalObserver : public PendingExtensionManager::Observer { … };
class ExtensionServiceTest : public ExtensionServiceTestWithInstall { … };
class PackExtensionTestClient : public PackExtensionJob::Client { … };
PackExtensionTestClient::PackExtensionTestClient(
const base::FilePath& expected_crx_path,
const base::FilePath& expected_private_key_path,
base::OnceClosure quit_closure)
: … { … }
void PackExtensionTestClient::OnPackSuccess(
const base::FilePath& crx_path,
const base::FilePath& private_key_path) { … }
void PackExtensionTestClient::OnPackFailure(const std::string& error_message,
ExtensionCreator::ErrorType type) { … }
TEST_F(ExtensionServiceTest, LoadAllExtensionsFromDirectorySuccess) { … }
TEST_F(ExtensionServiceTest, LoadAllExtensionsFromDirectoryFail) { … }
TEST_F(ExtensionServiceTest, PendingImports) { … }
TEST_F(ExtensionServiceTest, ReloadExtensionWithPendingImports) { … }
TEST_F(ExtensionServiceTest, InstallExtensionsWithExtensionsDisabled) { … }
TEST_F(ExtensionServiceTest, InstallExtension) { … }
TEST_F(ExtensionServiceTest, InstallExtension_EmitUserHistograms) { … }
TEST_F(ExtensionServiceTest, InstallExtension_NonUserEmitHistograms) { … }
TEST_F(ExtensionServiceTest, InstallObserverNotified) { … }
TEST_F(ExtensionServiceTest, UninstallingExternalExtensions) { … }
TEST_F(ExtensionServiceTest, UninstallExternalExtensionAndReinstallAsUser) { … }
TEST_F(ExtensionServiceTest,
UninstallExternalExtensionAndReinstallAsUserWithLowerVersion) { … }
TEST_F(ExtensionServiceTest, UninstallingNotLoadedExtension) { … }
TEST_F(ExtensionServiceTest, DISABLED_FailOnWrongId) { … }
TEST_F(ExtensionServiceTest, FailOnWrongVersion) { … }
TEST_F(ExtensionServiceTest, InstallUserScript) { … }
TEST_F(ExtensionServiceTest, InstallExtensionDuringShutdown) { … }
TEST_F(ExtensionServiceTest, GrantedPermissions) { … }
TEST_F(ExtensionServiceTest,
GrantedPermissionsIgnoreInternalPermissionsFromManifest) { … }
TEST_F(ExtensionServiceTest, GrantedPermissionsOnUpdate) { … }
TEST_F(ExtensionServiceTest, ReenableWithAllPermissionsGranted) { … }
TEST_F(ExtensionServiceTest, ReenableWithAllPermissionsGrantedOnStartup) { … }
TEST_F(ExtensionServiceTest,
DontReenableWithAllPermissionsGrantedButOtherReason) { … }
TEST_F(ExtensionServiceTest,
DontReenableWithAllPermissionsGrantedOnStartupButOtherReason) { … }
TEST_F(ExtensionServiceTest,
ReaddingOldPermissionInUpdateDoesntDisableExtension) { … }
TEST_F(ExtensionServiceTest, UpdateIncognitoMode) { … }
#if !BUILDFLAG(IS_CHROMEOS_ASH)
TEST_F(ExtensionServiceTest, PreinstalledAppsGrantedPermissions) { … }
#endif
TEST_F(ExtensionServiceTest, GrantedAPIAndHostPermissions) { … }
TEST_F(ExtensionServiceTest, PackExtension) { … }
TEST_F(ExtensionServiceTest, PackPunctuatedExtension) { … }
TEST_F(ExtensionServiceTest, PackExtensionContainingKeyFails) { … }
TEST_F(ExtensionServiceTest, PackExtensionOpenSSLKey) { … }
TEST_F(ExtensionServiceTest, TestInstallThemeWithExtensionsDisabled) { … }
#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
#define MAYBE_InstallTheme …
#else
#define MAYBE_InstallTheme …
#endif
TEST_F(ExtensionServiceTest, MAYBE_InstallTheme) { … }
TEST_F(ExtensionServiceTest, LoadLocalizedTheme) { … }
#if BUILDFLAG(IS_POSIX)
TEST_F(ExtensionServiceTest, UnpackedExtensionMayContainSymlinkedFiles) { … }
#endif
TEST_F(ExtensionServiceTest, UnpackedExtensionWithEmptyMetadataFolder) { … }
TEST_F(ExtensionServiceTest, UnpackedExtensionWithReservedMetadataFiles) { … }
TEST_F(ExtensionServiceTest, UnpackedExtensionWithUserMetadataFiles) { … }
TEST_F(ExtensionServiceTest,
UnpackedExtensionWithEmptyMetadataAndUnderscoreFolders) { … }
TEST_F(ExtensionServiceTest, UnpackedExtensionMayNotHaveUnderscore) { … }
TEST_F(ExtensionServiceTest,
ReloadExtensionWithMalformedManifestAndCorrectManifest) { … }
TEST_F(ExtensionServiceTest, InstallLocalizedTheme) { … }
TEST_F(ExtensionServiceTest, InstallApps) { … }
TEST_F(ExtensionServiceTest, DefaultPackedFileAccess) { … }
TEST_F(ExtensionServiceTest, DefaultUnpackedFileAccess) { … }
TEST_F(ExtensionServiceTest, DefaultPackedFileAccessWithCreationFlag) { … }
TEST_F(ExtensionServiceTest, FileAccessFlagAndPrefMismatch) { … }
TEST_F(ExtensionServiceTest, UpdateApps) { … }
TEST_F(ExtensionServiceTest, UpdateAppsRetainOrdinals) { … }
TEST_F(ExtensionServiceTest, EnsureCWSOrdinalsInitialized) { … }
TEST_F(ExtensionServiceTest, InstallAppsWithUnlimitedStorage) { … }
TEST_F(ExtensionServiceTest, InstallAppsAndCheckStorageProtection) { … }
TEST_F(ExtensionServiceTest, Reinstall) { … }
TEST_F(ExtensionServiceTest, FromWebStore) { … }
TEST_F(ExtensionServiceTest, UpgradeSignedGood) { … }
TEST_F(ExtensionServiceTest, UpgradeSignedBad) { … }
TEST_F(ExtensionServiceTest, UpdateExtension) { … }
TEST_F(ExtensionServiceTest, UpdateExtensionDuringShutdown) { … }
TEST_F(ExtensionServiceTest, UpdateNotInstalledExtension) { … }
TEST_F(ExtensionServiceTest, UpdateWillNotDowngrade) { … }
TEST_F(ExtensionServiceTest, UpdateToSameVersionIsNoop) { … }
TEST_F(ExtensionServiceTest, UpdateExtensionPreservesState) { … }
TEST_F(ExtensionServiceTest, UpdateExtensionPreservesLocation) { … }
TEST_F(ExtensionServiceTest, LoadExtensionsCanDowngrade) { … }
namespace {
bool IsExtension(const Extension* extension, content::BrowserContext* context) { … }
#if defined(ENABLE_BLOCKLIST_TESTS)
std::set<std::string> StringSet(const std::string& s) { … }
std::set<std::string> StringSet(const std::string& s1, const std::string& s2) { … }
#endif
}
TEST_F(ExtensionServiceTest, AddPendingExtensionFromSync) { … }
namespace {
const char kGoodId[] = …;
const char kGoodUpdateURL[] = …;
const char kGoodVersion[] = …;
const bool kGoodIsFromSync = …;
const bool kGoodRemoteInstall = …;
}
TEST_F(ExtensionServiceTest, UpdatePendingExtension) { … }
TEST_F(ExtensionServiceTest, UpdatePendingExtensionWrongVersion) { … }
namespace {
bool IsTheme(const Extension* extension, content::BrowserContext* context) { … }
}
TEST_F(ExtensionServiceTest, UpdatePendingTheme) { … }
TEST_F(ExtensionServiceTest, UpdatePendingExternalCrx) { … }
TEST_F(ExtensionServiceTest, UpdatePendingExternalCrxWinsOverSync) { … }
TEST_F(ExtensionServiceTest, UpdatePendingCrxThemeMismatch) { … }
TEST_F(ExtensionServiceTest, UpdatePendingExtensionFailedShouldInstallTest) { … }
TEST_F(ExtensionServiceTest, UpdatePendingExtensionNotPending) { … }
TEST_F(ExtensionServiceTest, UpdatePendingExtensionAlreadyInstalled) { … }
#if defined(ENABLE_BLOCKLIST_TESTS)
TEST_F(ExtensionServiceTest, SetUnsetBlocklistInPrefs) { … }
TEST_F(ExtensionServiceTest, NoUnsetBlocklistInPrefs) { … }
#endif
#if defined(ENABLE_BLOCKLIST_TESTS)
TEST_F(ExtensionServiceTest, BlocklistedExtensionWillNotInstall) { … }
#endif
#if defined(ENABLE_BLOCKLIST_TESTS)
TEST_F(ExtensionServiceTest, RemoveExtensionFromBlocklist) { … }
#endif
#if defined(ENABLE_BLOCKLIST_TESTS)
TEST_F(ExtensionServiceTest, UnloadBlocklistedExtensionPolicy) { … }
#endif
#if defined(ENABLE_BLOCKLIST_TESTS)
TEST_F(ExtensionServiceTest, WillNotLoadBlocklistedExtensionsFromDirectory) { … }
#endif
#if defined(ENABLE_BLOCKLIST_TESTS)
TEST_F(ExtensionServiceTest, BlocklistedInPrefsFromStartup) { … }
#endif
#if defined(ENABLE_BLOCKLIST_TESTS)
TEST_F(ExtensionServiceTest, ReloadBlocklistedExtension) { … }
#endif
TEST_F(ExtensionServiceTest, BlockAndUnblockEnabledExtension) { … }
TEST_F(ExtensionServiceTest, BlockAndUnblockDisabledExtension) { … }
TEST_F(ExtensionServiceTest, BlockAndUnblockTerminatedExtension) { … }
TEST_F(ExtensionServiceTest, BlockAndUnblockPolicyExtension) { … }
#if defined(ENABLE_BLOCKLIST_TESTS)
TEST_F(ExtensionServiceTest, BlockAndUnblockBlocklistedExtension) { … }
#endif
TEST_F(ExtensionServiceTest, BlockAndUnblockEnabledComponentExtension) { … }
TEST_F(ExtensionServiceTest, BlockAndUnblockTheme) { … }
TEST_F(ExtensionServiceTest, WillNotLoadExtensionsWhenBlocked) { … }
TEST_F(ExtensionServiceTest, IsEnabledExtensionBlockedAndNotInstalled) { … }
TEST_F(ExtensionServiceTest, BlocklistedByPolicyWillNotInstall) { … }
TEST_F(ExtensionServiceTest, BlocklistedByPolicyRemovedIfRunning) { … }
TEST_F(ExtensionServiceTest, ComponentExtensionAllowlisted) { … }
TEST_F(ExtensionServiceTest, ComponentExtensionAllowlistedPermission) { … }
TEST_F(ExtensionServiceTest, PolicyInstalledExtensionsAllowlisted) { … }
TEST_F(ExtensionServiceTest, ManagementPolicyProhibitsInstall) { … }
TEST_F(ExtensionServiceTest, ManagementPolicyProhibitsLoadFromPrefs) { … }
TEST_F(ExtensionServiceTest, ManagementPolicyProhibitsDisable) { … }
TEST_F(ExtensionServiceTest, ManagementPolicyProhibitsUninstall) { … }
TEST_F(ExtensionServiceTest, ManagementPolicyUnloadsAllProhibited) { … }
TEST_F(ExtensionServiceTest, ManagementPolicyRequiresEnable) { … }
TEST_F(ExtensionServiceTest, ManagementPolicyProhibitsEnableOnInstalled) { … }
TEST_F(ExtensionServiceTest, PolicyBlockedPermissionNewExtensionInstall) { … }
TEST_F(ExtensionServiceTest, PolicyBlockedPermissionConflictsWithForceInstall) { … }
TEST_F(ExtensionServiceTest, PolicyBlockedPermissionExtensionUpdate) { … }
TEST_F(ExtensionServiceTest, PolicyBlockedPermissionPolicyUpdate) { … }
#if BUILDFLAG(IS_WIN)
#define MAYBE_ExternalExtensionAutoAcknowledgement …
#else
#define MAYBE_ExternalExtensionAutoAcknowledgement …
#endif
TEST_F(ExtensionServiceTest, MAYBE_ExternalExtensionAutoAcknowledgement) { … }
TEST_F(ExtensionServiceTest, ExternalExtensionDisabledOnInstallation) { … }
TEST_F(ExtensionServiceTest, ExternalExtensionIsNotDisabledOnUpdate) { … }
TEST_F(ExtensionServiceTest, ExternalExtensionRemainsDisabledIfIgnored) { … }
TEST_F(ExtensionServiceTest, ExternalExtensionBecomesEnabledIfForceInstalled) { … }
#if !BUILDFLAG(IS_CHROMEOS_ASH)
TEST_F(ExtensionServiceTest, PreinstalledAppsInstall) { … }
#endif
TEST_F(ExtensionServiceTest, DisableExtension) { … }
TEST_F(ExtensionServiceTest, DisableRemotelyForMalware) { … }
TEST_F(ExtensionServiceTest, NoEnableRemotelyDisabledExtension) { … }
TEST_F(ExtensionServiceTest, CanAddDisableReasonToBlocklistedExtension) { … }
TEST_F(ExtensionServiceTest,
DisableRemotelyForMalwareFromExtensionTelemetryServiceVerdict) { … }
TEST_F(ExtensionServiceTest, TerminateExtension) { … }
TEST_F(ExtensionServiceTest, DisableTerminatedExtension) { … }
TEST_F(ExtensionServiceTest, PRE_DisableAllExtensions) { … }
TEST_F(ExtensionServiceTest, DisableAllExtensions) { … }
TEST_F(ExtensionServiceTest, ReloadExtensions) { … }
TEST_F(ExtensionServiceTest, ReloadExtension) { … }
class ExtensionServiceWithEmptyServiceTest : public ExtensionServiceTest { … };
TEST_F(ExtensionServiceWithEmptyServiceTest, UninstallExtensionFromWebstore) { … }
TEST_F(ExtensionServiceWithEmptyServiceTest, UninstallExtensionFromCrx) { … }
TEST_F(ExtensionServiceWithEmptyServiceTest,
UninstallExtensionFromUnpackedFolder_DoNotDeleteExtensionFolder) { … }
class ExtensionServiceZipUninstallProfileFeatureTest
: public ExtensionServiceWithEmptyServiceTest,
public testing::WithParamInterface<bool> { … };
INSTANTIATE_TEST_SUITE_P(…);
TEST_P(ExtensionServiceZipUninstallProfileFeatureTest,
UninstallExtensionFromZip) { … }
TEST_F(ExtensionServiceWithEmptyServiceTest, UninstallTerminatedExtension) { … }
TEST_F(ExtensionServiceWithEmptyServiceTest, UninstallBlockedExtension) { … }
TEST_F(ExtensionServiceTest, UpgradingRequirementsEnabled) { … }
TEST_F(ExtensionServiceTest, UpgradingRequirementsDisabled) { … }
TEST_F(ExtensionServiceTest, UpgradingRequirementsPermissions) { … }
TEST_F(ExtensionServiceTest, UnpackedRequirements) { … }
class ExtensionCookieCallback { … };
TEST_F(ExtensionServiceTest, ClearExtensionData) { … }
std::vector<net::CanonicalCookie> IncludedCookies(
const net::CookieAccessResultList& result,
const net::CookieAccessResultList& excluded) { … }
TEST_F(ExtensionServiceTest, ClearAppData) { … }
TEST_F(ExtensionServiceTest, LoadExtension) { … }
TEST_F(ExtensionServiceTest, WillNotLoadFromCommandLineForESBUsers) { … }
TEST_F(ExtensionServiceTest, LoadsFromCommandLineForNonESBUsers) { … }
TEST_F(ExtensionServiceTest,
WillNotLoadFromCommandLineForUsersWithPolicyFalse) { … }
TEST_F(ExtensionServiceTest, LoadsFromCommandLineForUsersWithoutPolicy) { … }
TEST_F(ExtensionServiceTest, GenerateID) { … }
TEST_F(ExtensionServiceTest, UnpackedValidatesLocales) { … }
void ExtensionServiceTest::TestExternalProvider(MockExternalProvider* provider,
ManifestLocation location) { … }
#if BUILDFLAG(IS_WIN)
TEST_F(ExtensionServiceTest, ExternalInstallRegistry) {
InitializeExtensionServiceWithExtensionsDisabled();
MockExternalProvider* reg_provider =
AddMockExternalProvider(ManifestLocation::kExternalRegistry);
TestExternalProvider(reg_provider, ManifestLocation::kExternalRegistry);
}
#endif
TEST_F(ExtensionServiceTest, ExternalInstallPref) { … }
TEST_F(ExtensionServiceTest, ExternalInstallPrefUpdateUrl) { … }
TEST_F(ExtensionServiceTest, ExternalInstallPolicyUpdateUrl) { … }
TEST_F(ExtensionServiceTest, ExternalUninstall) { … }
TEST_F(ExtensionServiceTest, MultipleExternalUpdateCheck) { … }
TEST_F(ExtensionServiceTest, ExternalPrefProvider) { … }
TEST_F(ExtensionServiceTest, ReinstallProviderExtensions) { … }
TEST_F(ExtensionServiceTest, DoNotInstallForEnterprise) { … }
TEST_F(ExtensionServiceTest, IncrementalUpdateThroughRegistry) { … }
TEST_F(ExtensionServiceTest, LoadAndRelocalizeExtensions) { … }
class ExtensionServiceTestSimple : public testing::Test { … };
TEST_F(ExtensionServiceTestSimple, Enabledness) { … }
TEST_F(ExtensionServiceTest, StorageQuota) { … }
TEST_F(ExtensionServiceTest, ComponentExtensions) { … }
TEST_F(ExtensionServiceTest, InstallPriorityExternalUpdateUrl) { … }
TEST_F(ExtensionServiceTest, FailedLocalFileInstallIsNotPending) { … }
TEST_F(ExtensionServiceTest, InstallPriorityExternalLocalFile) { … }
TEST_F(ExtensionServiceTest, ConcurrentExternalLocalFile) { … }
TEST_F(ExtensionServiceTest, InstallAllowlistedExtension) { … }
class ExtensionSourcePriorityTest : public ExtensionServiceTest { … };
TEST_F(ExtensionSourcePriorityTest, PendingExternalFileOverSync) { … }
TEST_F(ExtensionSourcePriorityTest, PendingExternalUrlOverSync) { … }
TEST_F(ExtensionSourcePriorityTest, InstallExternalBlocksSyncRequest) { … }
TEST_F(ExtensionServiceTest, BlockedExternalExtension) { … }
TEST_F(ExtensionServiceTest, ExternalInstallGlobalError) { … }
TEST_F(ExtensionServiceTest, ExternalInstallInitiallyDisabled) { … }
TEST_F(ExtensionServiceTest, DisablingComponentExtensions) { … }
#if BUILDFLAG(IS_WIN) || defined(THREAD_SANITIZER)
#define MAYBE_ExternalInstallMultiple …
#else
#define MAYBE_ExternalInstallMultiple …
#endif
TEST_F(ExtensionServiceTest, MAYBE_ExternalInstallMultiple) { … }
TEST_F(ExtensionServiceTest, MultipleExternalInstallErrors) { … }
TEST_F(ExtensionServiceTest, InstallPromptAborted) { … }
TEST_F(ExtensionServiceTest, MultipleExternalInstallBubbleErrors) { … }
TEST_F(ExtensionServiceTest, BubbleAlertDoesNotHideAnotherAlertFromMenu) { … }
TEST_F(ExtensionServiceTest, ExternalInstallUpdatesFromWebstoreOldProfile) { … }
TEST_F(ExtensionServiceTest, ExternalInstallUpdatesFromWebstoreNewProfile) { … }
TEST_F(ExtensionServiceTest, ExternalInstallClickToRemove) { … }
TEST_F(ExtensionServiceTest, ExternalInstallClickToKeep) { … }
TEST_F(ExtensionServiceTest,
ExternalInstallBubbleDoesntShowForEnabledExtensions) { … }
TEST_F(ExtensionServiceTest, InstallBlocklistedExtension) { … }
TEST_F(ExtensionServiceTest, CannotEnableBlocklistedExtension) { … }
TEST_F(ExtensionServiceTest, CannotDisableSharedModules) { … }
TEST_F(ExtensionServiceTest, UninstallBlocklistedExtension) { … }
TEST_F(ExtensionServiceTest, DestroyingProfileClearsExtensions) { … }
TEST_F(ExtensionServiceTest, CorruptExtensionUpdate) { … }
TEST_F(ExtensionServiceTest, ReloadAndReEnableExtension) { … }
TEST_F(ExtensionServiceTest, ReloadSharedModule) { … }
TEST_F(ExtensionServiceTest, UninstallMigratedComponentExtensions) { … }
TEST_F(ExtensionServiceTest, UninstallMigratedExtensionsKeepsGoodComponents) { … }
TEST_F(ExtensionServiceTest, UninstallMigratedExtensionsMultipleCalls) { … }
TEST_F(ExtensionServiceTest, UserInstalledExtensionThenRequiredByPolicy) { … }
TEST_F(ExtensionServiceTest,
UserInstalledExtensionThenRequiredByPolicyOnRestart) { … }
TEST_F(ExtensionServiceTest, InstallingUnacknowledgedExternalExtension) { … }
TEST_F(ExtensionServiceTest, ReloadingExtensionFromNotification) { … }
#if BUILDFLAG(ENABLE_PLUGINS)
TEST_F(ExtensionServiceTest, PluginManagerCrash) { … }
#endif
TEST_F(ExtensionServiceTest, BlockDisabledExtensionNotification) { … }
class ExternalExtensionPriorityTest
: public ExtensionServiceTest,
public testing::WithParamInterface<ManifestLocation> { … };
TEST_P(ExternalExtensionPriorityTest, PolicyForegroundFetch) { … }
INSTANTIATE_TEST_SUITE_P(…);
}