| 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/file_util.h" | 6 #include "base/file_util.h" |
| 7 #include "base/json/json_string_value_serializer.h" | 7 #include "base/json/json_string_value_serializer.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/scoped_temp_dir.h" | 9 #include "base/scoped_temp_dir.h" |
| 10 #include "base/string_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 TestHarness::~TestHarness() {} | 66 TestHarness::~TestHarness() {} |
| 67 | 67 |
| 68 void TestHarness::SetUp() { | 68 void TestHarness::SetUp() { |
| 69 ASSERT_TRUE(test_dir_.CreateUniqueTempDir()); | 69 ASSERT_TRUE(test_dir_.CreateUniqueTempDir()); |
| 70 } | 70 } |
| 71 | 71 |
| 72 ConfigurationPolicyProvider* TestHarness::CreateProvider( | 72 ConfigurationPolicyProvider* TestHarness::CreateProvider( |
| 73 const PolicyDefinitionList* policy_definition_list) { | 73 const PolicyDefinitionList* policy_definition_list) { |
| 74 scoped_ptr<AsyncPolicyLoader> loader( | 74 scoped_ptr<AsyncPolicyLoader> loader( |
| 75 new ConfigDirPolicyLoader(test_dir(), POLICY_SCOPE_MACHINE)); | 75 new ConfigDirPolicyLoader(test_dir(), POLICY_SCOPE_MACHINE)); |
| 76 return new AsyncPolicyProvider(policy_definition_list, loader.Pass()); | 76 return new AsyncPolicyProvider(loader.Pass()); |
| 77 } | 77 } |
| 78 | 78 |
| 79 void TestHarness::InstallEmptyPolicy() { | 79 void TestHarness::InstallEmptyPolicy() { |
| 80 base::DictionaryValue dict; | 80 base::DictionaryValue dict; |
| 81 WriteConfigFile(dict, "policy"); | 81 WriteConfigFile(dict, "policy"); |
| 82 } | 82 } |
| 83 | 83 |
| 84 void TestHarness::InstallStringPolicy(const std::string& policy_name, | 84 void TestHarness::InstallStringPolicy(const std::string& policy_name, |
| 85 const std::string& policy_value) { | 85 const std::string& policy_value) { |
| 86 base::DictionaryValue dict; | 86 base::DictionaryValue dict; |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 expected_bundle.Get(POLICY_DOMAIN_EXTENSIONS, | 238 expected_bundle.Get(POLICY_DOMAIN_EXTENSIONS, |
| 239 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") | 239 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") |
| 240 .CopyFrom(expected_policy); | 240 .CopyFrom(expected_policy); |
| 241 expected_bundle.Get(POLICY_DOMAIN_EXTENSIONS, | 241 expected_bundle.Get(POLICY_DOMAIN_EXTENSIONS, |
| 242 "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb") | 242 "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb") |
| 243 .CopyFrom(expected_policy); | 243 .CopyFrom(expected_policy); |
| 244 EXPECT_TRUE(bundle->Equals(expected_bundle)); | 244 EXPECT_TRUE(bundle->Equals(expected_bundle)); |
| 245 } | 245 } |
| 246 | 246 |
| 247 } // namespace policy | 247 } // namespace policy |
| OLD | NEW |