#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include <stddef.h>
#include <memory>
#include <string>
#include "base/memory/raw_ptr.h"
#include "base/values.h"
#include "chrome/browser/extensions/api/preference/preference_api.h"
#include "chrome/browser/extensions/extension_prefs_unittest.h"
#include "chrome/test/base/testing_profile.h"
#include "components/pref_registry/pref_registry_syncable.h"
#include "components/prefs/mock_pref_change_callback.h"
#include "extensions/browser/api/content_settings/content_settings_service.h"
#include "extensions/browser/extension_prefs.h"
#include "extensions/browser/extension_prefs_helper.h"
#include "extensions/common/api/types.h"
#include "extensions/common/extension.h"
#include "extensions/common/extension_id.h"
#include "testing/gtest/include/gtest/gtest.h"
Value;
ChromeSettingScope;
namespace extensions {
namespace {
const char kPref1[] = …;
const char kPref2[] = …;
const char kPref3[] = …;
const char kPref4[] = …;
const char kDefaultPref1[] = …;
const char kDefaultPref2[] = …;
const char kDefaultPref3[] = …;
const char kDefaultPref4[] = …;
}
class ExtensionControlledPrefsTest : public PrefsPrepopulatedTestBase { … };
ExtensionControlledPrefsTest::ExtensionControlledPrefsTest()
: … { … }
ExtensionControlledPrefsTest::~ExtensionControlledPrefsTest() { … }
void ExtensionControlledPrefsTest::RegisterPreferences(
user_prefs::PrefRegistrySyncable* registry) { … }
void ExtensionControlledPrefsTest::InstallExtensionControlledPref(
Extension* extension,
const std::string& key,
base::Value value) { … }
void ExtensionControlledPrefsTest::InstallExtensionControlledPrefIncognito(
Extension* extension,
const std::string& key,
base::Value value) { … }
void ExtensionControlledPrefsTest::
InstallExtensionControlledPrefIncognitoSessionOnly(Extension* extension,
const std::string& key,
base::Value value) { … }
void ExtensionControlledPrefsTest::InstallExtension(Extension* extension) { … }
void ExtensionControlledPrefsTest::UninstallExtension(
const ExtensionId& extension_id) { … }
void ExtensionControlledPrefsTest::EnsureExtensionInstalled(
Extension* extension) { … }
void ExtensionControlledPrefsTest::EnsureExtensionUninstalled(
const ExtensionId& extension_id) { … }
class ControlledPrefsInstallOneExtension
: public ExtensionControlledPrefsTest { … };
TEST_F(ControlledPrefsInstallOneExtension,
ControlledPrefsInstallOneExtension) { … }
class ControlledPrefsInstallIncognitoPersistent
: public ExtensionControlledPrefsTest { … };
TEST_F(ControlledPrefsInstallIncognitoPersistent,
ControlledPrefsInstallIncognitoPersistent) { … }
class ControlledPrefsInstallIncognitoSessionOnly
: public ExtensionControlledPrefsTest { … };
TEST_F(ControlledPrefsInstallIncognitoSessionOnly,
ControlledPrefsInstallIncognitoSessionOnly) { … }
class ControlledPrefsUninstallExtension : public ExtensionControlledPrefsTest { … };
TEST_F(ControlledPrefsUninstallExtension,
ControlledPrefsUninstallExtension) { … }
class ControlledPrefsNotifyWhenNeeded : public ExtensionControlledPrefsTest { … };
TEST_F(ControlledPrefsNotifyWhenNeeded,
ControlledPrefsNotifyWhenNeeded) { … }
class ControlledPrefsDisableExtension : public ExtensionControlledPrefsTest { … };
TEST_F(ControlledPrefsDisableExtension, ControlledPrefsDisableExtension) { … }
class ControlledPrefsReenableExtension : public ExtensionControlledPrefsTest { … };
TEST_F(ControlledPrefsDisableExtension, ControlledPrefsReenableExtension) { … }
class ControlledPrefsSetExtensionControlledPref
: public ExtensionControlledPrefsTest { … };
TEST_F(ControlledPrefsSetExtensionControlledPref,
ControlledPrefsSetExtensionControlledPref) { … }
class ControlledPrefsDisableExtensions : public ExtensionControlledPrefsTest { … };
TEST_F(ControlledPrefsDisableExtensions, ControlledPrefsDisableExtensions) { … }
}