#include "chrome/browser/extensions/extension_allowlist.h"
#include "base/memory/raw_ptr.h"
#include "chrome/browser/extensions/crx_installer.h"
#include "chrome/browser/extensions/extension_management_test_util.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/extension_service_test_base.h"
#include "chrome/browser/extensions/test_blocklist.h"
#include "chrome/test/base/testing_profile.h"
#include "components/safe_browsing/core/common/safe_browsing_prefs.h"
#include "components/sync_preferences/testing_pref_service_syncable.h"
#include "extensions/browser/allowlist_state.h"
#include "extensions/browser/blocklist_extension_prefs.h"
#include "extensions/common/extension_builder.h"
#include "extensions/common/extension_features.h"
#include "extensions/common/extension_id.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace extensions {
namespace {
constexpr char kExtensionId1[] = …;
constexpr char kExtensionId2[] = …;
constexpr char kExtensionId3[] = …;
constexpr char kInstalledCrx[] = …;
ManagementPrefUpdater;
}
class ExtensionAllowlistUnitTestBase : public ExtensionServiceTestBase { … };
class ExtensionAllowlistUnitTest : public ExtensionAllowlistUnitTestBase { … };
TEST_F(ExtensionAllowlistUnitTest, AllowlistEnforcement) { … }
TEST_F(ExtensionAllowlistUnitTest, DisabledReasonResetWhenBlocklisted) { … }
TEST_F(ExtensionAllowlistUnitTest, DisabledItemStaysDisabledWhenAllowlisted) { … }
TEST_F(ExtensionAllowlistUnitTest, EnforcementOnInit) { … }
TEST_F(ExtensionAllowlistUnitTest, EnhancedProtectionSettingChange) { … }
TEST_F(ExtensionAllowlistUnitTest, ExtensionsNotAllowlistedThenBlocklisted) { … }
TEST_F(ExtensionAllowlistUnitTest, ExtensionsBlocklistedThenNotAllowlisted) { … }
TEST_F(ExtensionAllowlistUnitTest, MissingAttributeAreIgnored) { … }
TEST_F(ExtensionAllowlistUnitTest, AcknowledgeNeededOnEnforcement) { … }
TEST_F(ExtensionAllowlistUnitTest, AcknowledgeNotNeededIfAlreadyDisabled) { … }
TEST_F(ExtensionAllowlistUnitTest,
AcknowledgeStateIsSetWhenExtensionIsReenabled) { … }
TEST_F(ExtensionAllowlistUnitTest, ReenabledExtensionsAreNotReenforced) { … }
TEST_F(ExtensionAllowlistUnitTest, TurnOffEnhancedProtection) { … }
TEST_F(ExtensionAllowlistUnitTest, BypassFrictionSetAckowledgeEnabledByUser) { … }
TEST_F(ExtensionAllowlistUnitTest, NoEnforcementOnPolicyForceInstall) { … }
class ExtensionAllowlistWithFeatureDisabledUnitTest
: public ExtensionAllowlistUnitTestBase { … };
TEST_F(ExtensionAllowlistWithFeatureDisabledUnitTest,
NoEnforcementWhenFeatureDisabled) { … }
TEST_F(ExtensionAllowlistWithFeatureDisabledUnitTest,
NoEnforcementOnPolicyRecommendedInstall) { … }
TEST_F(ExtensionAllowlistWithFeatureDisabledUnitTest,
NoEnforcementOnPolicyAllowedInstall) { … }
}