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 14 matching lines...) Expand all Loading... |
25 const char kExtension2[] = "extension-2"; | 25 const char kExtension2[] = "extension-2"; |
26 const char kExtension3[] = "extension-3"; | 26 const char kExtension3[] = "extension-3"; |
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", |
36 base::Value::CreateStringValue("omg"), NULL); | 36 POLICY_LEVEL_MANDATORY, |
| 37 POLICY_SCOPE_MACHINE, |
| 38 new base::StringValue("omg"), |
| 39 NULL); |
37 policy->Set("recommended-user", | 40 policy->Set("recommended-user", |
38 POLICY_LEVEL_RECOMMENDED, | 41 POLICY_LEVEL_RECOMMENDED, |
39 POLICY_SCOPE_USER, | 42 POLICY_SCOPE_USER, |
40 new base::FundamentalValue(true), | 43 new base::FundamentalValue(true), |
41 NULL); | 44 NULL); |
42 base::DictionaryValue* dict = new base::DictionaryValue(); | 45 base::DictionaryValue* dict = new base::DictionaryValue(); |
43 dict->SetBoolean("false", false); | 46 dict->SetBoolean("false", false); |
44 dict->SetInteger("int", 456); | 47 dict->SetInteger("int", 456); |
45 dict->SetString("str", "bbq"); | 48 dict->SetString("str", "bbq"); |
46 policy->Set("recommended-machine", POLICY_LEVEL_RECOMMENDED, | 49 policy->Set("recommended-machine", POLICY_LEVEL_RECOMMENDED, |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 EXPECT_TRUE(bundle.Equals(other)); | 284 EXPECT_TRUE(bundle.Equals(other)); |
282 policy_map.Set(kPolicy0, | 285 policy_map.Set(kPolicy0, |
283 POLICY_LEVEL_MANDATORY, | 286 POLICY_LEVEL_MANDATORY, |
284 POLICY_SCOPE_USER, | 287 POLICY_SCOPE_USER, |
285 new base::FundamentalValue(123), | 288 new base::FundamentalValue(123), |
286 NULL); | 289 NULL); |
287 EXPECT_FALSE(bundle.Equals(other)); | 290 EXPECT_FALSE(bundle.Equals(other)); |
288 } | 291 } |
289 | 292 |
290 } // namespace policy | 293 } // namespace policy |
OLD | NEW |