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/schema_map.h" | 5 #include "components/policy/core/common/schema_map.h" |
6 | 6 |
7 #include "base/memory/weak_ptr.h" | 7 #include "base/memory/weak_ptr.h" |
8 #include "base/values.h" | 8 #include "base/values.h" |
9 #include "components/policy/core/common/external_data_fetcher.h" | 9 #include "components/policy/core/common/external_data_fetcher.h" |
10 #include "components/policy/core/common/external_data_manager.h" | 10 #include "components/policy/core/common/external_data_manager.h" |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 POLICY_SCOPE_USER, | 167 POLICY_SCOPE_USER, |
168 new base::FundamentalValue(true), | 168 new base::FundamentalValue(true), |
169 NULL); | 169 NULL); |
170 map.Set("integer", | 170 map.Set("integer", |
171 POLICY_LEVEL_MANDATORY, | 171 POLICY_LEVEL_MANDATORY, |
172 POLICY_SCOPE_USER, | 172 POLICY_SCOPE_USER, |
173 new base::FundamentalValue(1), | 173 new base::FundamentalValue(1), |
174 NULL); | 174 NULL); |
175 map.Set("null", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, | 175 map.Set("null", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, |
176 base::Value::CreateNullValue(), NULL); | 176 base::Value::CreateNullValue(), NULL); |
177 map.Set("double", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, | 177 map.Set("double", |
178 base::Value::CreateDoubleValue(1.2), NULL); | 178 POLICY_LEVEL_MANDATORY, |
| 179 POLICY_SCOPE_USER, |
| 180 new base::FundamentalValue(1.2), |
| 181 NULL); |
179 base::DictionaryValue dict; | 182 base::DictionaryValue dict; |
180 dict.SetString("a", "b"); | 183 dict.SetString("a", "b"); |
181 dict.SetInteger("b", 2); | 184 dict.SetInteger("b", 2); |
182 map.Set("object", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, | 185 map.Set("object", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, |
183 dict.DeepCopy(), NULL); | 186 dict.DeepCopy(), NULL); |
184 map.Set("string", | 187 map.Set("string", |
185 POLICY_LEVEL_MANDATORY, | 188 POLICY_LEVEL_MANDATORY, |
186 POLICY_SCOPE_USER, | 189 POLICY_SCOPE_USER, |
187 new base::StringValue("value"), | 190 new base::StringValue("value"), |
188 NULL); | 191 NULL); |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 newer = new SchemaMap(map); | 333 newer = new SchemaMap(map); |
331 newer->GetChanges(older, &removed, &added); | 334 newer->GetChanges(older, &removed, &added); |
332 ASSERT_EQ(2u, removed.size()); | 335 ASSERT_EQ(2u, removed.size()); |
333 EXPECT_EQ(PolicyNamespace(POLICY_DOMAIN_CHROME, ""), removed[0]); | 336 EXPECT_EQ(PolicyNamespace(POLICY_DOMAIN_CHROME, ""), removed[0]); |
334 EXPECT_EQ(PolicyNamespace(POLICY_DOMAIN_EXTENSIONS, "xyz"), removed[1]); | 337 EXPECT_EQ(PolicyNamespace(POLICY_DOMAIN_EXTENSIONS, "xyz"), removed[1]); |
335 ASSERT_EQ(1u, added.size()); | 338 ASSERT_EQ(1u, added.size()); |
336 EXPECT_EQ(PolicyNamespace(POLICY_DOMAIN_EXTENSIONS, "abc"), added[0]); | 339 EXPECT_EQ(PolicyNamespace(POLICY_DOMAIN_EXTENSIONS, "abc"), added[0]); |
337 } | 340 } |
338 | 341 |
339 } // namespace policy | 342 } // namespace policy |
OLD | NEW |