| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "components/policy/core/common/policy_bundle.h" | 5 #include "components/policy/core/common/policy_bundle.h" |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/values.h" | 9 #include "base/values.h" |
| 10 #include "components/policy/core/common/external_data_fetcher.h" | 10 #include "components/policy/core/common/external_data_fetcher.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 | 27 |
| 28 // Adds test policies to |policy|. | 28 // Adds test policies to |policy|. |
| 29 void AddTestPolicies(PolicyMap* policy) { | 29 void AddTestPolicies(PolicyMap* policy) { |
| 30 policy->Set("mandatory-user", | 30 policy->Set("mandatory-user", |
| 31 POLICY_LEVEL_MANDATORY, | 31 POLICY_LEVEL_MANDATORY, |
| 32 POLICY_SCOPE_USER, | 32 POLICY_SCOPE_USER, |
| 33 new base::FundamentalValue(123), | 33 new base::FundamentalValue(123), |
| 34 NULL); | 34 NULL); |
| 35 policy->Set("mandatory-machine", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE, | 35 policy->Set("mandatory-machine", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE, |
| 36 base::Value::CreateStringValue("omg"), NULL); | 36 base::Value::CreateStringValue("omg"), NULL); |
| 37 policy->Set("recommended-user", POLICY_LEVEL_RECOMMENDED, | 37 policy->Set("recommended-user", |
| 38 POLICY_SCOPE_USER, base::Value::CreateBooleanValue(true), NULL); | 38 POLICY_LEVEL_RECOMMENDED, |
| 39 POLICY_SCOPE_USER, |
| 40 new base::FundamentalValue(true), |
| 41 NULL); |
| 39 base::DictionaryValue* dict = new base::DictionaryValue(); | 42 base::DictionaryValue* dict = new base::DictionaryValue(); |
| 40 dict->SetBoolean("false", false); | 43 dict->SetBoolean("false", false); |
| 41 dict->SetInteger("int", 456); | 44 dict->SetInteger("int", 456); |
| 42 dict->SetString("str", "bbq"); | 45 dict->SetString("str", "bbq"); |
| 43 policy->Set("recommended-machine", POLICY_LEVEL_RECOMMENDED, | 46 policy->Set("recommended-machine", POLICY_LEVEL_RECOMMENDED, |
| 44 POLICY_SCOPE_MACHINE, dict, NULL); | 47 POLICY_SCOPE_MACHINE, dict, NULL); |
| 45 } | 48 } |
| 46 | 49 |
| 47 // Adds test policies to |policy| based on the parameters: | 50 // Adds test policies to |policy| based on the parameters: |
| 48 // - kPolicyClashing0 mapped to |value|, user mandatory | 51 // - kPolicyClashing0 mapped to |value|, user mandatory |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 EXPECT_TRUE(bundle.Equals(other)); | 281 EXPECT_TRUE(bundle.Equals(other)); |
| 279 policy_map.Set(kPolicy0, | 282 policy_map.Set(kPolicy0, |
| 280 POLICY_LEVEL_MANDATORY, | 283 POLICY_LEVEL_MANDATORY, |
| 281 POLICY_SCOPE_USER, | 284 POLICY_SCOPE_USER, |
| 282 new base::FundamentalValue(123), | 285 new base::FundamentalValue(123), |
| 283 NULL); | 286 NULL); |
| 284 EXPECT_FALSE(bundle.Equals(other)); | 287 EXPECT_FALSE(bundle.Equals(other)); |
| 285 } | 288 } |
| 286 | 289 |
| 287 } // namespace policy | 290 } // namespace policy |
| OLD | NEW |