#include "components/policy/core/browser/policy_pref_mapping_test.h"
#include <map>
#include <memory>
#include <optional>
#include <set>
#include <string>
#include <vector>
#include "base/command_line.h"
#include "base/containers/contains.h"
#include "base/containers/flat_set.h"
#include "base/files/file_enumerator.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/hash/hash.h"
#include "base/json/json_reader.h"
#include "base/logging.h"
#include "base/no_destructor.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
#include "base/threading/thread_restrictions.h"
#include "base/values.h"
#include "build/branding_buildflags.h"
#include "build/build_config.h"
#include "build/buildflag.h"
#include "build/chromeos_buildflags.h"
#include "components/policy/core/common/mock_configuration_policy_provider.h"
#include "components/policy/core/common/schema.h"
#include "components/policy/policy_constants.h"
#include "components/prefs/pref_service.h"
#include "printing/buildflags/buildflags.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
namespace policy {
namespace {
enum class PrefLocation { … };
PrefLocation GetPrefLocation(const base::Value::Dict& settings) { … }
PrefService* GetPrefServiceForLocation(PrefLocation location,
PrefService* local_state,
PrefService* user_prefs,
PrefService* signin_profile_prefs) { … }
void CheckPrefHasValue(const PrefService::Preference* pref,
const base::Value* expected_value) { … }
void CheckPrefHasDefaultValue(const PrefService::Preference* pref,
const base::Value* expected_value = nullptr) { … }
void CheckPrefHasRecommendedValue(const PrefService::Preference* pref,
const base::Value* expected_value) { … }
void CheckPrefHasMandatoryValue(const PrefService::Preference* pref,
const base::Value* expected_value) { … }
class PrefTestCase { … };
class PolicyPrefMappingTest { … };
class SimplePolicyPrefMappingTest { … };
bool CheckRequiredBuildFlagsSupported(const PolicyPrefMappingTest* test) { … }
class PolicyTestCase { … };
class PolicyTestCases { … };
struct PolicySettings { … };
PolicySettings GetPolicySettings(const std::string& policy,
const base::Value::Dict& policies_settings) { … }
void SetProviderPolicy(MockConfigurationPolicyProvider* provider,
const base::Value::Dict& policies,
const base::Value::Dict& policies_settings,
PolicyLevel level) { … }
std::optional<base::flat_set<std::string>> GetTestFilter() { … }
}
void VerifyAllPoliciesHaveATestCase(const base::FilePath& test_case_dir) { … }
void VerifyPolicyToPrefMappings(const base::FilePath& test_case_dir,
PrefService* local_state,
PrefService* user_prefs,
PrefService* signin_profile_prefs,
MockConfigurationPolicyProvider* provider,
PrefMappingChunkInfo* chunk_info) { … }
}