Commit 0d82a5c1 authored by Rohit Rao's avatar Rohit Rao Committed by Commit Bot

Moves helpers for PolicyPrefsTest into a shared helper file.

These helpers are moved into //components/policy/core/common so that
they can be used on iOS as well.

BUG=1069528

Change-Id: I66adcf426e81ff5bdc430146e802745d276fd814
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2144266
Commit-Queue: Rohit Rao <rohitrao@chromium.org>
Reviewed-by: default avatarOwen Min <zmin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#759285}
parent 6099b264
...@@ -91,6 +91,13 @@ jumbo_static_library("test_support") { ...@@ -91,6 +91,13 @@ jumbo_static_library("test_support") {
"configuration_policy_pref_store_test.h", "configuration_policy_pref_store_test.h",
] ]
if (!is_android && !is_fuchsia) {
sources += [
"policy_pref_mapping_test.cc",
"policy_pref_mapping_test.h",
]
}
public_deps = [ public_deps = [
":browser", ":browser",
"//base", "//base",
...@@ -101,7 +108,12 @@ jumbo_static_library("test_support") { ...@@ -101,7 +108,12 @@ jumbo_static_library("test_support") {
"//components/policy:generated", "//components/policy:generated",
"//components/policy/core/common:test_support", "//components/policy/core/common:test_support",
] ]
deps = [ "//testing/gtest" ] deps = [
"//build:branding_buildflags",
"//components/prefs",
"//testing/gtest",
"//url",
]
} }
source_set("unit_tests") { source_set("unit_tests") {
......
This diff is collapsed.
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef COMPONENTS_POLICY_CORE_BROWSER_POLICY_PREF_MAPPING_TEST_H_
#define COMPONENTS_POLICY_CORE_BROWSER_POLICY_PREF_MAPPING_TEST_H_
#include <string>
namespace base {
class FilePath;
}
namespace policy {
class MockConfigurationPolicyProvider;
}
class PrefService;
namespace policy {
// Verifies that all of the policies have a test case listed in the JSON file at
// |test_case_path|.
void VerifyAllPoliciesHaveATestCase(const base::FilePath& test_case_path);
// Verifies that policies make their corresponding preferences become managed,
// and that the user can't override that setting. Loads test cases from the
// JSON file at |test_case_path| and updates policies using the given
// |provider|. Does not verify any prefs which start with
// |skipped_pref_prefix|, if non-empty.
void VerifyPolicyToPrefMappings(const base::FilePath& test_case_path,
PrefService* local_state,
PrefService* user_prefs,
MockConfigurationPolicyProvider* provider,
const std::string& skipped_pref_prefix);
} // namespace policy
#endif // COMPONENTS_POLICY_CORE_BROWSER_POLICY_PREF_MAPPING_TEST_H_
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment