#include <utility>
#include "base/functional/bind.h"
#include "base/json/json_writer.h"
#include "base/memory/ref_counted.h"
#include "base/run_loop.h"
#include "base/values.h"
#include "build/build_config.h"
#include "chrome/browser/extensions/api/storage/settings_sync_util.h"
#include "chrome/browser/extensions/extension_apitest.h"
#include "chrome/browser/extensions/extension_system_factory.h"
#include "chrome/browser/policy/schema_registry_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.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_bundle.h"
#include "components/policy/core/common/policy_map.h"
#include "components/policy/core/common/policy_namespace.h"
#include "components/policy/core/common/policy_types.h"
#include "components/policy/core/common/schema.h"
#include "components/policy/core/common/schema_map.h"
#include "components/policy/core/common/schema_registry.h"
#include "components/sync/model/sync_change.h"
#include "components/sync/model/sync_change_processor.h"
#include "components/sync/model/syncable_service.h"
#include "components/sync/test/fake_sync_change_processor.h"
#include "components/sync/test/sync_change_processor_wrapper_for_test.h"
#include "components/version_info/channel.h"
#include "content/public/test/browser_test.h"
#include "extensions/browser/api/storage/backend_task_runner.h"
#include "extensions/browser/api/storage/settings_namespace.h"
#include "extensions/browser/api/storage/storage_area_namespace.h"
#include "extensions/browser/api/storage/storage_frontend.h"
#include "extensions/browser/extension_system.h"
#include "extensions/common/extension_id.h"
#include "extensions/common/features/feature_channel.h"
#include "extensions/test/extension_test_message_listener.h"
#include "extensions/test/result_catcher.h"
#include "extensions/test/test_extension_dir.h"
#include "testing/gmock/include/gmock/gmock.h"
namespace extensions {
NiceMock;
namespace {
const syncer::DataType kDataType = …;
const char kManagedStorageExtensionId[] = …;
class TestSchemaRegistryObserver : public policy::SchemaRegistry::Observer { … };
}
class ExtensionSettingsApiTest : public ExtensionApiTest { … };
IN_PROC_BROWSER_TEST_F(ExtensionSettingsApiTest,
SessionInUnsupportedExtension) { … }
IN_PROC_BROWSER_TEST_F(ExtensionSettingsApiTest, SimpleTest) { … }
IN_PROC_BROWSER_TEST_F(ExtensionSettingsApiTest, SplitModeIncognito) { … }
IN_PROC_BROWSER_TEST_F(ExtensionSettingsApiTest,
OnChangedNotificationsBetweenBackgroundPages) { … }
IN_PROC_BROWSER_TEST_F(ExtensionSettingsApiTest,
SyncLocalAndSessionAreasAreSeparate) { … }
IN_PROC_BROWSER_TEST_F(ExtensionSettingsApiTest,
OnChangedNotificationsFromSync) { … }
IN_PROC_BROWSER_TEST_F(ExtensionSettingsApiTest,
OnChangedNotificationsFromSyncNotSentToLocal) { … }
IN_PROC_BROWSER_TEST_F(ExtensionSettingsApiTest, IsStorageEnabled) { … }
ContextType;
class ExtensionSettingsManagedStorageApiTest
: public ExtensionSettingsApiTest,
public testing::WithParamInterface<ContextType> { … };
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
IN_PROC_BROWSER_TEST_P(ExtensionSettingsManagedStorageApiTest,
ExtensionsSchemas) { … }
IN_PROC_BROWSER_TEST_P(ExtensionSettingsManagedStorageApiTest, ManagedStorage) { … }
IN_PROC_BROWSER_TEST_P(ExtensionSettingsManagedStorageApiTest,
PRE_ManagedStorageEvents) { … }
IN_PROC_BROWSER_TEST_P(ExtensionSettingsManagedStorageApiTest,
ManagedStorageEvents) { … }
IN_PROC_BROWSER_TEST_P(ExtensionSettingsManagedStorageApiTest,
ManagedStorageDisabled) { … }
IN_PROC_BROWSER_TEST_F(ExtensionSettingsApiTest, StorageAreaOnChanged) { … }
}