Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(333)

Side by Side Diff: chrome/browser/policy/config_dir_policy_provider_unittest.cc

Issue 9111022: Removed ConfigurationPolicyType and extended PolicyMap. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 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_value_serializer.h" 7 #include "base/json/json_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"
11 #include "base/values.h" 11 #include "base/values.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 TestHarness::TestHarness() {} 53 TestHarness::TestHarness() {}
54 54
55 TestHarness::~TestHarness() {} 55 TestHarness::~TestHarness() {}
56 56
57 void TestHarness::SetUp() { 57 void TestHarness::SetUp() {
58 ASSERT_TRUE(test_dir_.CreateUniqueTempDir()); 58 ASSERT_TRUE(test_dir_.CreateUniqueTempDir());
59 } 59 }
60 60
61 AsynchronousPolicyProvider* TestHarness::CreateProvider( 61 AsynchronousPolicyProvider* TestHarness::CreateProvider(
62 const PolicyDefinitionList* policy_definition_list) { 62 const PolicyDefinitionList* policy_definition_list) {
63 return new ConfigDirPolicyProvider(policy_definition_list, test_dir()); 63 return new ConfigDirPolicyProvider(policy_definition_list,
64 POLICY_LEVEL_MANDATORY,
65 test_dir());
64 } 66 }
65 67
66 void TestHarness::InstallEmptyPolicy() { 68 void TestHarness::InstallEmptyPolicy() {
67 DictionaryValue dict; 69 DictionaryValue dict;
68 WriteConfigFile(dict, "policy"); 70 WriteConfigFile(dict, "policy");
69 } 71 }
70 72
71 void TestHarness::InstallStringPolicy(const std::string& policy_name, 73 void TestHarness::InstallStringPolicy(const std::string& policy_name,
72 const std::string& policy_value) { 74 const std::string& policy_value) {
73 DictionaryValue dict; 75 DictionaryValue dict;
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 for (unsigned int i = 5; i <= 8; ++i) 166 for (unsigned int i = 5; i <= 8; ++i)
165 harness_.WriteConfigFile(test_dict_bar, base::IntToString(i)); 167 harness_.WriteConfigFile(test_dict_bar, base::IntToString(i));
166 168
167 ConfigDirPolicyProviderDelegate loader(harness_.test_dir()); 169 ConfigDirPolicyProviderDelegate loader(harness_.test_dir());
168 scoped_ptr<base::DictionaryValue> policy(loader.Load()); 170 scoped_ptr<base::DictionaryValue> policy(loader.Load());
169 EXPECT_TRUE(policy.get()); 171 EXPECT_TRUE(policy.get());
170 EXPECT_TRUE(policy->Equals(&test_dict_foo)); 172 EXPECT_TRUE(policy->Equals(&test_dict_foo));
171 } 173 }
172 174
173 } // namespace policy 175 } // namespace policy
OLDNEW
« no previous file with comments | « chrome/browser/policy/config_dir_policy_provider.cc ('k') | chrome/browser/policy/configuration_policy_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698