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 "chrome/browser/policy/policy_service_impl.h" | 5 #include "chrome/browser/policy/policy_service_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 } | 153 } |
154 | 154 |
155 protected: | 155 protected: |
156 MockConfigurationPolicyProvider provider0_; | 156 MockConfigurationPolicyProvider provider0_; |
157 MockConfigurationPolicyProvider provider1_; | 157 MockConfigurationPolicyProvider provider1_; |
158 MockConfigurationPolicyProvider provider2_; | 158 MockConfigurationPolicyProvider provider2_; |
159 PolicyMap policy0_; | 159 PolicyMap policy0_; |
160 PolicyMap policy1_; | 160 PolicyMap policy1_; |
161 PolicyMap policy2_; | 161 PolicyMap policy2_; |
162 scoped_ptr<PolicyServiceImpl> policy_service_; | 162 scoped_ptr<PolicyServiceImpl> policy_service_; |
163 MessageLoop loop_; | 163 base::MessageLoop loop_; |
164 | 164 |
165 private: | 165 private: |
166 DISALLOW_COPY_AND_ASSIGN(PolicyServiceTest); | 166 DISALLOW_COPY_AND_ASSIGN(PolicyServiceTest); |
167 }; | 167 }; |
168 | 168 |
169 TEST_F(PolicyServiceTest, LoadsPoliciesBeforeProvidersRefresh) { | 169 TEST_F(PolicyServiceTest, LoadsPoliciesBeforeProvidersRefresh) { |
170 PolicyMap expected; | 170 PolicyMap expected; |
171 expected.Set("pre", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, | 171 expected.Set("pre", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, |
172 base::Value::CreateIntegerValue(13)); | 172 base::Value::CreateIntegerValue(13)); |
173 EXPECT_TRUE(VerifyPolicies( | 173 EXPECT_TRUE(VerifyPolicies( |
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
667 scoped_refptr<PolicyDomainDescriptor> empty_extensions_descriptor = | 667 scoped_refptr<PolicyDomainDescriptor> empty_extensions_descriptor = |
668 new PolicyDomainDescriptor(POLICY_DOMAIN_EXTENSIONS); | 668 new PolicyDomainDescriptor(POLICY_DOMAIN_EXTENSIONS); |
669 EXPECT_CALL(provider0_, RegisterPolicyDomain( | 669 EXPECT_CALL(provider0_, RegisterPolicyDomain( |
670 scoped_refptr<const PolicyDomainDescriptor>( | 670 scoped_refptr<const PolicyDomainDescriptor>( |
671 empty_extensions_descriptor))); | 671 empty_extensions_descriptor))); |
672 policy_service_->RegisterPolicyDomain(empty_extensions_descriptor); | 672 policy_service_->RegisterPolicyDomain(empty_extensions_descriptor); |
673 Mock::VerifyAndClearExpectations(&provider0_); | 673 Mock::VerifyAndClearExpectations(&provider0_); |
674 } | 674 } |
675 | 675 |
676 } // namespace policy | 676 } // namespace policy |
OLD | NEW |