#include "chrome/browser/extensions/manifest_v2_experiment_manager.h"
#include "base/one_shot_event.h"
#include "base/strings/stringprintf.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_feature_list.h"
#include "chrome/browser/extensions/extension_browsertest.h"
#include "chrome/browser/extensions/extension_management_internal.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/mv2_experiment_stage.h"
#include "chrome/browser/profiles/profile.h"
#include "components/policy/core/browser/browser_policy_connector.h"
#include "components/policy/core/common/mock_configuration_policy_provider.h"
#include "components/policy/core/common/policy_map.h"
#include "components/policy/core/common/policy_types.h"
#include "components/policy/policy_constants.h"
#include "components/ukm/test_ukm_recorder.h"
#include "content/public/test/browser_test.h"
#include "extensions/browser/extension_prefs.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/browser/mock_external_provider.h"
#include "extensions/browser/pref_names.h"
#include "extensions/browser/test_extension_registry_observer.h"
#include "extensions/common/extension.h"
#include "extensions/common/extension_features.h"
#include "extensions/common/feature_switch.h"
#include "extensions/common/mojom/manifest.mojom.h"
#include "extensions/test/test_extension_dir.h"
#include "services/metrics/public/cpp/ukm_builders.h"
#include "services/metrics/public/cpp/ukm_recorder.h"
namespace extensions {
namespace {
const Extension* GetExtensionByName(std::string_view name,
const ExtensionSet& extensions) { … }
MV2ExperimentStage GetExperimentStageForTest(std::string_view test_name) { … }
enum class MV2PolicyLevel { … };
MV2PolicyLevel GetPolicyLevelForTest(std::string_view test_name) { … }
}
class ManifestV2ExperimentManagerBrowserTest : public ExtensionBrowserTest { … };
IN_PROC_BROWSER_TEST_F(ManifestV2ExperimentManagerBrowserTest,
PRE_PRE_ExtensionsAreDisabledOnStartup) { … }
IN_PROC_BROWSER_TEST_F(ManifestV2ExperimentManagerBrowserTest,
PRE_ExtensionsAreDisabledOnStartup) { … }
IN_PROC_BROWSER_TEST_F(ManifestV2ExperimentManagerBrowserTest,
ExtensionsAreDisabledOnStartup) { … }
IN_PROC_BROWSER_TEST_F(ManifestV2ExperimentManagerBrowserTest,
PRE_PRE_ExtensionsCanBeReEnabledByUsers) { … }
IN_PROC_BROWSER_TEST_F(ManifestV2ExperimentManagerBrowserTest,
PRE_ExtensionsCanBeReEnabledByUsers) { … }
IN_PROC_BROWSER_TEST_F(ManifestV2ExperimentManagerBrowserTest,
ExtensionsCanBeReEnabledByUsers) { … }
IN_PROC_BROWSER_TEST_F(ManifestV2ExperimentManagerBrowserTest,
ExtensionsAreReEnabledWhenUpdatedToMV3) { … }
IN_PROC_BROWSER_TEST_F(ManifestV2ExperimentManagerBrowserTest,
PRE_MarkingNoticeAsAcknowledged) { … }
IN_PROC_BROWSER_TEST_F(ManifestV2ExperimentManagerBrowserTest,
MarkingNoticeAsAcknowledged) { … }
IN_PROC_BROWSER_TEST_F(ManifestV2ExperimentManagerBrowserTest,
PRE_MarkingGlobalNoticeAsAcknowledged) { … }
IN_PROC_BROWSER_TEST_F(ManifestV2ExperimentManagerBrowserTest,
MarkingGlobalNoticeAsAcknowledged) { … }
IN_PROC_BROWSER_TEST_F(ManifestV2ExperimentManagerBrowserTest,
PRE_PRE_ExtensionsAreReEnabledIfPolicyChangesOnStartup) { … }
IN_PROC_BROWSER_TEST_F(ManifestV2ExperimentManagerBrowserTest,
PRE_ExtensionsAreReEnabledIfPolicyChangesOnStartup) { … }
IN_PROC_BROWSER_TEST_F(ManifestV2ExperimentManagerBrowserTest,
ExtensionsAreReEnabledIfPolicyChangesOnStartup) { … }
IN_PROC_BROWSER_TEST_F(ManifestV2ExperimentManagerBrowserTest,
PRE_PRE_ExtensionsAreReEnabledIfExperimentDisabled) { … }
IN_PROC_BROWSER_TEST_F(ManifestV2ExperimentManagerBrowserTest,
PRE_ExtensionsAreReEnabledIfExperimentDisabled) { … }
IN_PROC_BROWSER_TEST_F(ManifestV2ExperimentManagerBrowserTest,
ExtensionsAreReEnabledIfExperimentDisabled) { … }
IN_PROC_BROWSER_TEST_F(ManifestV2ExperimentManagerBrowserTest,
ExternalExtensionsCanBeInstalledButAreAlsoDisabled) { … }
IN_PROC_BROWSER_TEST_F(ManifestV2ExperimentManagerBrowserTest,
UkmIsEmittedForExtensionWhenUninstalled) { … }
IN_PROC_BROWSER_TEST_F(ManifestV2ExperimentManagerBrowserTest,
UkmIsNotEmittedForOtherUninstallations) { … }
}