Chromium Code Reviews| 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..18e68a70e422570806185c292331360c4286dc11 100644 |
| --- a/components/policy/core/common/configuration_policy_provider_test.cc |
| +++ b/components/policy/core/common/configuration_policy_provider_test.cc |
| @@ -146,8 +146,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 +160,10 @@ PolicyScope PolicyProviderTestHarness::policy_scope() const { |
| return scope_; |
| } |
| +PolicySource PolicyProviderTestHarness::policy_source() const { |
| + return source_; |
| +} |
| + |
| void PolicyProviderTestHarness::Install3rdPartyPolicy( |
| const base::DictionaryValue* policies) { |
| FAIL(); |
| @@ -221,11 +226,9 @@ void ConfigurationPolicyProviderTest::CheckValue( |
| loop_.RunUntilIdle(); |
| PolicyBundle expected_bundle; |
| expected_bundle.Get(PolicyNamespace(POLICY_DOMAIN_CHROME, std::string())) |
| - .Set(policy_name, |
| - test_harness_->policy_level(), |
| - test_harness_->policy_scope(), |
| - expected_value.DeepCopy(), |
| - NULL); |
| + .Set(policy_name, test_harness_->policy_level(), |
| + test_harness_->policy_scope(), expected_value.DeepCopy(), NULL, |
| + test_harness_->policy_source()); |
| EXPECT_TRUE(provider_->policies().Equals(expected_bundle)); |
| // TODO(joaodasilva): set the policy in the POLICY_DOMAIN_EXTENSIONS too, |
| // and extend the |expected_bundle|, once all providers are ready. |
| @@ -337,11 +340,9 @@ TEST_P(ConfigurationPolicyProviderTest, RefreshPolicies) { |
| Mock::VerifyAndClearExpectations(&observer); |
| bundle.Get(PolicyNamespace(POLICY_DOMAIN_CHROME, std::string())) |
| - .Set(test_keys::kKeyString, |
| - test_harness_->policy_level(), |
| - test_harness_->policy_scope(), |
| - new base::StringValue("value"), |
| - NULL); |
| + .Set(test_keys::kKeyString, test_harness_->policy_level(), |
|
Thiemo Nagel
2015/09/01 17:40:37
Don't reformat...
fhorschig
2015/09/04 06:53:54
Done.
|
| + test_harness_->policy_scope(), new base::StringValue("value"), NULL, |
| + test_harness_->policy_source()); |
| EXPECT_TRUE(provider_->policies().Equals(bundle)); |
| provider_->RemoveObserver(&observer); |
| } |
| @@ -389,18 +390,16 @@ TEST_P(Configuration3rdPartyPolicyProviderTest, Load3rdParty) { |
| loop_.RunUntilIdle(); |
| PolicyMap expected_policy; |
| - expected_policy.Set(test_keys::kKeyDictionary, |
| - test_harness_->policy_level(), |
| - test_harness_->policy_scope(), |
| - policy_dict.DeepCopy(), |
| - NULL); |
| + expected_policy.Set(test_keys::kKeyDictionary, test_harness_->policy_level(), |
| + test_harness_->policy_scope(), policy_dict.DeepCopy(), |
| + NULL, test_harness_->policy_source()); |
| PolicyBundle expected_bundle; |
| expected_bundle.Get(PolicyNamespace(POLICY_DOMAIN_CHROME, std::string())) |
| .CopyFrom(expected_policy); |
| expected_policy.Clear(); |
| - expected_policy.LoadFrom(&policy_dict, |
| - test_harness_->policy_level(), |
| - test_harness_->policy_scope()); |
| + expected_policy.LoadFrom(&policy_dict, test_harness_->policy_level(), |
| + test_harness_->policy_scope(), |
| + test_harness_->policy_source()); |
| expected_bundle.Get(PolicyNamespace(POLICY_DOMAIN_EXTENSIONS, |
| "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")) |
| .CopyFrom(expected_policy); |