OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/config_dir_policy_loader.h" | 5 #include "components/policy/core/common/config_dir_policy_loader.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 int policy_value) override; | 151 int policy_value) override; |
152 void InstallBooleanPolicy(const std::string& policy_name, | 152 void InstallBooleanPolicy(const std::string& policy_name, |
153 bool policy_value) override; | 153 bool policy_value) override; |
154 void InstallStringListPolicy(const std::string& policy_name, | 154 void InstallStringListPolicy(const std::string& policy_name, |
155 const base::ListValue* policy_value) override; | 155 const base::ListValue* policy_value) override; |
156 void InstallDictionaryPolicy( | 156 void InstallDictionaryPolicy( |
157 const std::string& policy_name, | 157 const std::string& policy_name, |
158 const base::DictionaryValue* policy_value) override; | 158 const base::DictionaryValue* policy_value) override; |
159 void Install3rdPartyPolicy(const base::DictionaryValue* policies) override; | 159 void Install3rdPartyPolicy(const base::DictionaryValue* policies) override; |
160 | 160 |
161 const base::FilePath& test_dir() { return test_dir_.path(); } | 161 const base::FilePath& test_dir() { return test_dir_.GetPath(); } |
162 | 162 |
163 // JSON-encode a dictionary and write it to a file. | 163 // JSON-encode a dictionary and write it to a file. |
164 void WriteConfigFile(const base::DictionaryValue& dict, | 164 void WriteConfigFile(const base::DictionaryValue& dict, |
165 const std::string& file_name); | 165 const std::string& file_name); |
166 | 166 |
167 // Returns a unique name for a policy file. Each subsequent call returns a new | 167 // Returns a unique name for a policy file. Each subsequent call returns a new |
168 // name that comes lexicographically after the previous one. | 168 // name that comes lexicographically after the previous one. |
169 std::string NextConfigFileName(); | 169 std::string NextConfigFileName(); |
170 | 170 |
171 static PolicyProviderTestHarness* Create(); | 171 static PolicyProviderTestHarness* Create(); |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
343 std::unique_ptr<PolicyBundle> bundle(loader.Load()); | 343 std::unique_ptr<PolicyBundle> bundle(loader.Load()); |
344 ASSERT_TRUE(bundle.get()); | 344 ASSERT_TRUE(bundle.get()); |
345 PolicyBundle expected_bundle; | 345 PolicyBundle expected_bundle; |
346 expected_bundle.Get(PolicyNamespace(POLICY_DOMAIN_CHROME, std::string())) | 346 expected_bundle.Get(PolicyNamespace(POLICY_DOMAIN_CHROME, std::string())) |
347 .LoadFrom(&test_dict_foo, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, | 347 .LoadFrom(&test_dict_foo, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, |
348 POLICY_SOURCE_PLATFORM); | 348 POLICY_SOURCE_PLATFORM); |
349 EXPECT_TRUE(bundle->Equals(expected_bundle)); | 349 EXPECT_TRUE(bundle->Equals(expected_bundle)); |
350 } | 350 } |
351 | 351 |
352 } // namespace policy | 352 } // namespace policy |
OLD | NEW |