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 <CoreFoundation/CoreFoundation.h> | 5 #include <CoreFoundation/CoreFoundation.h> |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/mac/scoped_cftyperef.h" | 10 #include "base/mac/scoped_cftyperef.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 | 22 |
23 using base::ScopedCFTypeRef; | 23 using base::ScopedCFTypeRef; |
24 | 24 |
25 namespace policy { | 25 namespace policy { |
26 | 26 |
27 namespace { | 27 namespace { |
28 | 28 |
29 class TestHarness : public PolicyProviderTestHarness { | 29 class TestHarness : public PolicyProviderTestHarness { |
30 public: | 30 public: |
31 TestHarness(); | 31 TestHarness(); |
32 virtual ~TestHarness(); | 32 ~TestHarness() override; |
33 | 33 |
34 virtual void SetUp() override; | 34 void SetUp() override; |
35 | 35 |
36 virtual ConfigurationPolicyProvider* CreateProvider( | 36 ConfigurationPolicyProvider* CreateProvider( |
37 SchemaRegistry* registry, | 37 SchemaRegistry* registry, |
38 scoped_refptr<base::SequencedTaskRunner> task_runner) override; | 38 scoped_refptr<base::SequencedTaskRunner> task_runner) override; |
39 | 39 |
40 virtual void InstallEmptyPolicy() override; | 40 void InstallEmptyPolicy() override; |
41 virtual void InstallStringPolicy(const std::string& policy_name, | 41 void InstallStringPolicy(const std::string& policy_name, |
42 const std::string& policy_value) override; | 42 const std::string& policy_value) override; |
43 virtual void InstallIntegerPolicy(const std::string& policy_name, | 43 void InstallIntegerPolicy(const std::string& policy_name, |
44 int policy_value) override; | 44 int policy_value) override; |
45 virtual void InstallBooleanPolicy(const std::string& policy_name, | 45 void InstallBooleanPolicy(const std::string& policy_name, |
46 bool policy_value) override; | 46 bool policy_value) override; |
47 virtual void InstallStringListPolicy( | 47 void InstallStringListPolicy(const std::string& policy_name, |
48 const std::string& policy_name, | 48 const base::ListValue* policy_value) override; |
49 const base::ListValue* policy_value) override; | 49 void InstallDictionaryPolicy( |
50 virtual void InstallDictionaryPolicy( | |
51 const std::string& policy_name, | 50 const std::string& policy_name, |
52 const base::DictionaryValue* policy_value) override; | 51 const base::DictionaryValue* policy_value) override; |
53 | 52 |
54 static PolicyProviderTestHarness* Create(); | 53 static PolicyProviderTestHarness* Create(); |
55 | 54 |
56 private: | 55 private: |
57 MockPreferences* prefs_; | 56 MockPreferences* prefs_; |
58 | 57 |
59 DISALLOW_COPY_AND_ASSIGN(TestHarness); | 58 DISALLOW_COPY_AND_ASSIGN(TestHarness); |
60 }; | 59 }; |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 expected_bundle.Get(PolicyNamespace(POLICY_DOMAIN_CHROME, std::string())) | 190 expected_bundle.Get(PolicyNamespace(POLICY_DOMAIN_CHROME, std::string())) |
192 .Set(test_keys::kKeyString, | 191 .Set(test_keys::kKeyString, |
193 POLICY_LEVEL_RECOMMENDED, | 192 POLICY_LEVEL_RECOMMENDED, |
194 POLICY_SCOPE_USER, | 193 POLICY_SCOPE_USER, |
195 new base::StringValue("string value"), | 194 new base::StringValue("string value"), |
196 NULL); | 195 NULL); |
197 EXPECT_TRUE(provider_->policies().Equals(expected_bundle)); | 196 EXPECT_TRUE(provider_->policies().Equals(expected_bundle)); |
198 } | 197 } |
199 | 198 |
200 } // namespace policy | 199 } // namespace policy |
OLD | NEW |