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/user_cloud_policy_manager_chromeos.h" | 5 #include "chrome/browser/policy/user_cloud_policy_manager_chromeos.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "chrome/browser/policy/mock_cloud_policy_store.h" | 10 #include "chrome/browser/policy/mock_cloud_policy_store.h" |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 | 81 |
82 // Required by the refresh scheduler that's created by the manager. | 82 // Required by the refresh scheduler that's created by the manager. |
83 MessageLoop loop_; | 83 MessageLoop loop_; |
84 | 84 |
85 // Convenience policy objects. | 85 // Convenience policy objects. |
86 em::DeviceManagementResponse policy_blob_; | 86 em::DeviceManagementResponse policy_blob_; |
87 PolicyMap policy_map_; | 87 PolicyMap policy_map_; |
88 PolicyBundle expected_bundle_; | 88 PolicyBundle expected_bundle_; |
89 | 89 |
90 // Policy infrastructure. | 90 // Policy infrastructure. |
91 TestingPrefService prefs_; | 91 TestingPrefServiceSimple prefs_; |
92 MockConfigurationPolicyObserver observer_; | 92 MockConfigurationPolicyObserver observer_; |
93 MockDeviceManagementService device_management_service_; | 93 MockDeviceManagementService device_management_service_; |
94 MockCloudPolicyStore* store_; | 94 MockCloudPolicyStore* store_; |
95 scoped_ptr<UserCloudPolicyManagerChromeOS> manager_; | 95 scoped_ptr<UserCloudPolicyManagerChromeOS> manager_; |
96 | 96 |
97 private: | 97 private: |
98 DISALLOW_COPY_AND_ASSIGN(UserCloudPolicyManagerChromeOSTest); | 98 DISALLOW_COPY_AND_ASSIGN(UserCloudPolicyManagerChromeOSTest); |
99 }; | 99 }; |
100 | 100 |
101 TEST_F(UserCloudPolicyManagerChromeOSTest, WaitForPolicyFetch) { | 101 TEST_F(UserCloudPolicyManagerChromeOSTest, WaitForPolicyFetch) { |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 | 153 |
154 // Cancelling the initial fetch should flip the flag. | 154 // Cancelling the initial fetch should flip the flag. |
155 EXPECT_CALL(observer_, OnUpdatePolicy(manager_.get())); | 155 EXPECT_CALL(observer_, OnUpdatePolicy(manager_.get())); |
156 manager_->CancelWaitForPolicyFetch(); | 156 manager_->CancelWaitForPolicyFetch(); |
157 EXPECT_TRUE(manager_->IsInitializationComplete()); | 157 EXPECT_TRUE(manager_->IsInitializationComplete()); |
158 Mock::VerifyAndClearExpectations(&observer_); | 158 Mock::VerifyAndClearExpectations(&observer_); |
159 } | 159 } |
160 | 160 |
161 } // namespace | 161 } // namespace |
162 } // namespace policy | 162 } // namespace policy |
OLD | NEW |