Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(775)

Unified Diff: components/policy/core/common/configuration_policy_provider_test.cc

Issue 1304843004: Add source column to chrome://policy showing the origins of policies. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed another test. Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/policy/core/common/configuration_policy_provider_test.cc
diff --git a/components/policy/core/common/configuration_policy_provider_test.cc b/components/policy/core/common/configuration_policy_provider_test.cc
index 0f407e59f89445eb395c0507643cfff2413ee82f..a9d2ecb4c330bb200215ec804c33d621f0a25575 100644
--- a/components/policy/core/common/configuration_policy_provider_test.cc
+++ b/components/policy/core/common/configuration_policy_provider_test.cc
@@ -13,6 +13,7 @@
#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 "testing/gmock/include/gmock/gmock.h"
using ::testing::Mock;
@@ -146,8 +147,9 @@ bool PolicyTestBase::RegisterSchema(const PolicyNamespace& ns,
}
PolicyProviderTestHarness::PolicyProviderTestHarness(PolicyLevel level,
- PolicyScope scope)
- : level_(level), scope_(scope) {}
+ PolicyScope scope,
+ PolicySource source)
+ : level_(level), scope_(scope), source_(source) {}
PolicyProviderTestHarness::~PolicyProviderTestHarness() {}
@@ -159,6 +161,10 @@ PolicyScope PolicyProviderTestHarness::policy_scope() const {
return scope_;
}
+PolicySource PolicyProviderTestHarness::policy_source() const {
+ return source_;
+}
+
void PolicyProviderTestHarness::Install3rdPartyPolicy(
const base::DictionaryValue* policies) {
FAIL();
@@ -224,6 +230,7 @@ void ConfigurationPolicyProviderTest::CheckValue(
.Set(policy_name,
test_harness_->policy_level(),
test_harness_->policy_scope(),
+ test_harness_->policy_source(),
expected_value.DeepCopy(),
NULL);
EXPECT_TRUE(provider_->policies().Equals(expected_bundle));
@@ -340,6 +347,7 @@ TEST_P(ConfigurationPolicyProviderTest, RefreshPolicies) {
.Set(test_keys::kKeyString,
test_harness_->policy_level(),
test_harness_->policy_scope(),
+ test_harness_->policy_source(),
new base::StringValue("value"),
NULL);
EXPECT_TRUE(provider_->policies().Equals(bundle));
@@ -392,6 +400,7 @@ TEST_P(Configuration3rdPartyPolicyProviderTest, Load3rdParty) {
expected_policy.Set(test_keys::kKeyDictionary,
test_harness_->policy_level(),
test_harness_->policy_scope(),
+ test_harness_->policy_source(),
policy_dict.DeepCopy(),
NULL);
PolicyBundle expected_bundle;
@@ -400,7 +409,8 @@ TEST_P(Configuration3rdPartyPolicyProviderTest, Load3rdParty) {
expected_policy.Clear();
expected_policy.LoadFrom(&policy_dict,
test_harness_->policy_level(),
- test_harness_->policy_scope());
+ test_harness_->policy_scope(),
+ test_harness_->policy_source());
expected_bundle.Get(PolicyNamespace(POLICY_DOMAIN_EXTENSIONS,
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"))
.CopyFrom(expected_policy);

Powered by Google App Engine
This is Rietveld 408576698