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 "base/compiler_specific.h" | 5 #include "base/compiler_specific.h" |
6 #include "base/files/file_util.h" | 6 #include "base/files/file_util.h" |
7 #include "base/files/scoped_temp_dir.h" | 7 #include "base/files/scoped_temp_dir.h" |
8 #include "base/json/json_string_value_serializer.h" | 8 #include "base/json/json_string_value_serializer.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 | 166 |
167 // Instantiate abstract test case for 3rd party policy reading tests. | 167 // Instantiate abstract test case for 3rd party policy reading tests. |
168 INSTANTIATE_TEST_CASE_P( | 168 INSTANTIATE_TEST_CASE_P( |
169 ConfigDir3rdPartyPolicyLoaderTest, | 169 ConfigDir3rdPartyPolicyLoaderTest, |
170 Configuration3rdPartyPolicyProviderTest, | 170 Configuration3rdPartyPolicyProviderTest, |
171 testing::Values(TestHarness::Create)); | 171 testing::Values(TestHarness::Create)); |
172 | 172 |
173 // Some tests that exercise special functionality in ConfigDirPolicyLoader. | 173 // Some tests that exercise special functionality in ConfigDirPolicyLoader. |
174 class ConfigDirPolicyLoaderTest : public PolicyTestBase { | 174 class ConfigDirPolicyLoaderTest : public PolicyTestBase { |
175 protected: | 175 protected: |
176 virtual void SetUp() override { | 176 void SetUp() override { |
177 PolicyTestBase::SetUp(); | 177 PolicyTestBase::SetUp(); |
178 harness_.SetUp(); | 178 harness_.SetUp(); |
179 } | 179 } |
180 | 180 |
181 TestHarness harness_; | 181 TestHarness harness_; |
182 }; | 182 }; |
183 | 183 |
184 // The preferences dictionary is expected to be empty when there are no files to | 184 // The preferences dictionary is expected to be empty when there are no files to |
185 // load. | 185 // load. |
186 TEST_F(ConfigDirPolicyLoaderTest, ReadPrefsEmpty) { | 186 TEST_F(ConfigDirPolicyLoaderTest, ReadPrefsEmpty) { |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 loop_.message_loop_proxy(), harness_.test_dir(), POLICY_SCOPE_USER); | 225 loop_.message_loop_proxy(), harness_.test_dir(), POLICY_SCOPE_USER); |
226 scoped_ptr<PolicyBundle> bundle(loader.Load()); | 226 scoped_ptr<PolicyBundle> bundle(loader.Load()); |
227 ASSERT_TRUE(bundle.get()); | 227 ASSERT_TRUE(bundle.get()); |
228 PolicyBundle expected_bundle; | 228 PolicyBundle expected_bundle; |
229 expected_bundle.Get(PolicyNamespace(POLICY_DOMAIN_CHROME, std::string())) | 229 expected_bundle.Get(PolicyNamespace(POLICY_DOMAIN_CHROME, std::string())) |
230 .LoadFrom(&test_dict_foo, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER); | 230 .LoadFrom(&test_dict_foo, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER); |
231 EXPECT_TRUE(bundle->Equals(expected_bundle)); | 231 EXPECT_TRUE(bundle->Equals(expected_bundle)); |
232 } | 232 } |
233 | 233 |
234 } // namespace policy | 234 } // namespace policy |
OLD | NEW |