#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "chrome/browser/extensions/extension_prefs_unittest.h"
#include <memory>
#include <optional>
#include <utility>
#include "base/files/scoped_temp_dir.h"
#include "base/path_service.h"
#include "base/ranges/algorithm.h"
#include "base/run_loop.h"
#include "base/strings/string_number_conversions.h"
#include "base/task/single_thread_task_runner.h"
#include "base/time/time.h"
#include "base/values.h"
#include "chrome/browser/extensions/install_tracker.h"
#include "chrome/common/chrome_paths.h"
#include "components/content_settings/core/browser/content_settings_registry.h"
#include "components/content_settings/core/common/content_settings.h"
#include "components/pref_registry/pref_registry_syncable.h"
#include "components/prefs/mock_pref_change_callback.h"
#include "components/prefs/pref_change_registrar.h"
#include "components/prefs/scoped_user_pref_update.h"
#include "components/sync/model/string_ordinal.h"
#include "components/sync_preferences/pref_service_syncable.h"
#include "extensions/browser/blocklist_extension_prefs.h"
#include "extensions/browser/blocklist_state.h"
#include "extensions/browser/disable_reason.h"
#include "extensions/browser/extension_pref_value_map.h"
#include "extensions/browser/extension_prefs.h"
#include "extensions/browser/install_flag.h"
#include "extensions/browser/install_prefs_helper.h"
#include "extensions/browser/pref_names.h"
#include "extensions/browser/pref_types.h"
#include "extensions/common/extension.h"
#include "extensions/common/extension_builder.h"
#include "extensions/common/extension_id.h"
#include "extensions/common/manifest_constants.h"
#include "extensions/common/permissions/permission_set.h"
#include "extensions/common/permissions/permissions_info.h"
Time;
APIPermissionID;
ManifestLocation;
namespace extensions {
static void AddPattern(URLPatternSet* extent, const std::string& pattern) { … }
ExtensionPrefsTest::ExtensionPrefsTest()
: … { … }
ExtensionPrefsTest::~ExtensionPrefsTest() = default;
void ExtensionPrefsTest::RegisterPreferences(
user_prefs::PrefRegistrySyncable* registry) { … }
void ExtensionPrefsTest::SetUp() { … }
void ExtensionPrefsTest::TearDown() { … }
class ExtensionPrefsLastPingDay : public ExtensionPrefsTest { … };
TEST_F(ExtensionPrefsLastPingDay, LastPingDay) { … }
class ExtensionPrefsExtensionState : public ExtensionPrefsTest { … };
TEST_F(ExtensionPrefsExtensionState, ExtensionState) { … }
class ExtensionPrefsDeprecatedDisableReason : public ExtensionPrefsTest { … };
TEST_F(ExtensionPrefsDeprecatedDisableReason, MigrateExtensionState) { … }
class ExtensionPrefsEscalatePermissions : public ExtensionPrefsTest { … };
TEST_F(ExtensionPrefsEscalatePermissions, EscalatePermissions) { … }
class ExtensionPrefsGrantedPermissions : public ExtensionPrefsTest { … };
TEST_F(ExtensionPrefsGrantedPermissions, GrantedPermissions) { … }
class ExtensionPrefsActivePermissions : public ExtensionPrefsTest { … };
TEST_F(ExtensionPrefsActivePermissions, SetAndGetDesiredActivePermissions) { … }
class ExtensionPrefsVersionString : public ExtensionPrefsTest { … };
TEST_F(ExtensionPrefsVersionString, VersionString) { … }
class ExtensionPrefsAcknowledgment : public ExtensionPrefsTest { … };
TEST_F(ExtensionPrefsAcknowledgment, Acknowledgment) { … }
class ExtensionPrefsDelayedInstallInfo : public ExtensionPrefsTest { … };
TEST_F(ExtensionPrefsDelayedInstallInfo, DelayedInstallInfo) { … }
class ExtensionPrefsFinishDelayedInstallInfo : public ExtensionPrefsTest { … };
TEST_F(ExtensionPrefsFinishDelayedInstallInfo, FinishDelayedInstallInfo) { … }
class ExtensionPrefsOnExtensionInstalled : public ExtensionPrefsTest { … };
TEST_F(ExtensionPrefsOnExtensionInstalled, ExtensionPrefsOnExtensionInstalled) { … }
class ExtensionPrefsPopulatesInstallTimePrefs : public ExtensionPrefsTest { … };
TEST_F(ExtensionPrefsPopulatesInstallTimePrefs,
ExtensionPrefsPopulatesInstallTimePrefs) { … }
class ExtensionPrefsMigratesToLastUpdateTime : public ExtensionPrefsTest { … };
TEST_F(ExtensionPrefsMigratesToLastUpdateTime,
ExtensionPrefsMigratesToLastUpdateTime) { … }
class ExtensionPrefsBitMapPrefValueClearedIfEqualsDefaultValue
: public ExtensionPrefsTest { … };
TEST_F(ExtensionPrefsBitMapPrefValueClearedIfEqualsDefaultValue,
ExtensionPrefsBitMapPrefValueClearedIfEqualsDefaultValue) { … }
class ExtensionPrefsFlags : public ExtensionPrefsTest { … };
TEST_F(ExtensionPrefsFlags, ExtensionPrefsFlags) { … }
PrefsPrepopulatedTestBase::PrefsPrepopulatedTestBase() { … }
PrefsPrepopulatedTestBase::~PrefsPrepopulatedTestBase() = default;
class ExtensionPrefsClearLastLaunched : public ExtensionPrefsTest { … };
TEST_F(ExtensionPrefsClearLastLaunched, ExtensionPrefsClearLastLaunched) { … }
class ExtensionPrefsComponentExtension : public ExtensionPrefsTest { … };
TEST_F(ExtensionPrefsComponentExtension, ExtensionPrefsComponentExtension) { … }
class ExtensionPrefsRuntimeGrantedPermissions : public ExtensionPrefsTest { … };
TEST_F(ExtensionPrefsRuntimeGrantedPermissions,
ExtensionPrefsRuntimeGrantedPermissions) { … }
class ExtensionPrefsObsoletePrefRemoval : public ExtensionPrefsTest { … };
TEST_F(ExtensionPrefsObsoletePrefRemoval, ExtensionPrefsObsoletePrefRemoval) { … }
class ExtensionPrefsMigratedPref : public ExtensionPrefsTest { … };
TEST_F(ExtensionPrefsMigratedPref, ExtensionPrefsMigratedPref) { … }
class ExtensionPrefsIsExternalExtensionUninstalled : public ExtensionPrefsTest { … };
TEST_F(ExtensionPrefsIsExternalExtensionUninstalled,
ExtensionPrefsIsExternalExtensionUninstalled) { … }
ExtensionPrefsSimpleTest;
TEST_F(ExtensionPrefsSimpleTest, OldWithholdingPrefMigration) { … }
TEST_F(ExtensionPrefsSimpleTest, MigrateToNewExternalUninstallBits) { … }
TEST_F(ExtensionPrefsSimpleTest, ProfileExtensionPrefsMapTest) { … }
TEST_F(ExtensionPrefsSimpleTest, ExtensionSpecificPrefsMapTest) { … }
}