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

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

Issue 10449071: Enable user policy handling through the new cloud policy stack. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 8 years, 6 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) 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 <gtest/gtest.h> 5 #include <gtest/gtest.h>
6 #include <windows.h> 6 #include <windows.h>
7 7
8 #include "base/json/json_writer.h" 8 #include "base/json/json_writer.h"
9 #include "base/string16.h" 9 #include "base/string16.h"
10 #include "base/string_number_conversions.h" 10 #include "base/string_number_conversions.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 DISALLOW_COPY_AND_ASSIGN(ScopedGroupPolicyRegistrySandbox); 57 DISALLOW_COPY_AND_ASSIGN(ScopedGroupPolicyRegistrySandbox);
58 }; 58 };
59 59
60 class TestHarness : public PolicyProviderTestHarness { 60 class TestHarness : public PolicyProviderTestHarness {
61 public: 61 public:
62 explicit TestHarness(HKEY hive, PolicyScope scope); 62 explicit TestHarness(HKEY hive, PolicyScope scope);
63 virtual ~TestHarness(); 63 virtual ~TestHarness();
64 64
65 virtual void SetUp() OVERRIDE; 65 virtual void SetUp() OVERRIDE;
66 66
67 virtual AsynchronousPolicyProvider* CreateProvider( 67 virtual ConfigurationPolicyProvider* CreateProvider(
68 const PolicyDefinitionList* policy_definition_list) OVERRIDE; 68 const PolicyDefinitionList* policy_definition_list) OVERRIDE;
69 69
70 virtual void InstallEmptyPolicy() OVERRIDE; 70 virtual void InstallEmptyPolicy() OVERRIDE;
71 virtual void InstallStringPolicy(const std::string& policy_name, 71 virtual void InstallStringPolicy(const std::string& policy_name,
72 const std::string& policy_value) OVERRIDE; 72 const std::string& policy_value) OVERRIDE;
73 virtual void InstallIntegerPolicy(const std::string& policy_name, 73 virtual void InstallIntegerPolicy(const std::string& policy_name,
74 int policy_value) OVERRIDE; 74 int policy_value) OVERRIDE;
75 virtual void InstallBooleanPolicy(const std::string& policy_name, 75 virtual void InstallBooleanPolicy(const std::string& policy_name,
76 bool policy_value) OVERRIDE; 76 bool policy_value) OVERRIDE;
77 virtual void InstallStringListPolicy( 77 virtual void InstallStringListPolicy(
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 key.DeleteKey(L""); 132 key.DeleteKey(L"");
133 } 133 }
134 134
135 TestHarness::TestHarness(HKEY hive, PolicyScope scope) 135 TestHarness::TestHarness(HKEY hive, PolicyScope scope)
136 : PolicyProviderTestHarness(POLICY_LEVEL_MANDATORY, scope), hive_(hive) {} 136 : PolicyProviderTestHarness(POLICY_LEVEL_MANDATORY, scope), hive_(hive) {}
137 137
138 TestHarness::~TestHarness() {} 138 TestHarness::~TestHarness() {}
139 139
140 void TestHarness::SetUp() {} 140 void TestHarness::SetUp() {}
141 141
142 AsynchronousPolicyProvider* TestHarness::CreateProvider( 142 ConfigurationPolicyProvider* TestHarness::CreateProvider(
143 const PolicyDefinitionList* policy_definition_list) { 143 const PolicyDefinitionList* policy_definition_list) {
144 return new ConfigurationPolicyProviderWin(policy_definition_list, 144 return new ConfigurationPolicyProviderWin(policy_definition_list,
145 policy::kRegistryMandatorySubKey, 145 policy::kRegistryMandatorySubKey,
146 POLICY_LEVEL_MANDATORY); 146 POLICY_LEVEL_MANDATORY);
147 } 147 }
148 148
149 void TestHarness::InstallEmptyPolicy() {} 149 void TestHarness::InstallEmptyPolicy() {}
150 150
151 void TestHarness::InstallStringPolicy(const std::string& policy_name, 151 void TestHarness::InstallStringPolicy(const std::string& policy_name,
152 const std::string& policy_value) { 152 const std::string& policy_value) {
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 PolicyBundle expected_bundle; 247 PolicyBundle expected_bundle;
248 expected_bundle.Get(POLICY_DOMAIN_CHROME, "") 248 expected_bundle.Get(POLICY_DOMAIN_CHROME, "")
249 .Set(test_policy_definitions::kKeyString, 249 .Set(test_policy_definitions::kKeyString,
250 POLICY_LEVEL_MANDATORY, 250 POLICY_LEVEL_MANDATORY,
251 POLICY_SCOPE_MACHINE, 251 POLICY_SCOPE_MACHINE,
252 base::Value::CreateStringValue("hklm")); 252 base::Value::CreateStringValue("hklm"));
253 EXPECT_TRUE(provider_.policies().Equals(expected_bundle)); 253 EXPECT_TRUE(provider_.policies().Equals(expected_bundle));
254 } 254 }
255 255
256 } // namespace policy 256 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698