| 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/cloud/user_cloud_policy_manager.h" | 5 #include "chrome/browser/policy/cloud/user_cloud_policy_manager.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/cloud/mock_user_cloud_policy_store.h" | 10 #include "chrome/browser/policy/cloud/mock_user_cloud_policy_store.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 EXPECT_CALL(*store_, Load()); | 47 EXPECT_CALL(*store_, Load()); |
| 48 manager_.reset( | 48 manager_.reset( |
| 49 new UserCloudPolicyManager(NULL, | 49 new UserCloudPolicyManager(NULL, |
| 50 scoped_ptr<UserCloudPolicyStore>(store_))); | 50 scoped_ptr<UserCloudPolicyStore>(store_))); |
| 51 manager_->Init(); | 51 manager_->Init(); |
| 52 manager_->AddObserver(&observer_); | 52 manager_->AddObserver(&observer_); |
| 53 Mock::VerifyAndClearExpectations(store_); | 53 Mock::VerifyAndClearExpectations(store_); |
| 54 } | 54 } |
| 55 | 55 |
| 56 // Required by the refresh scheduler that's created by the manager. | 56 // Required by the refresh scheduler that's created by the manager. |
| 57 MessageLoop loop_; | 57 base::MessageLoop loop_; |
| 58 | 58 |
| 59 // Convenience policy objects. | 59 // Convenience policy objects. |
| 60 PolicyMap policy_map_; | 60 PolicyMap policy_map_; |
| 61 PolicyBundle expected_bundle_; | 61 PolicyBundle expected_bundle_; |
| 62 | 62 |
| 63 // Policy infrastructure. | 63 // Policy infrastructure. |
| 64 MockConfigurationPolicyObserver observer_; | 64 MockConfigurationPolicyObserver observer_; |
| 65 MockUserCloudPolicyStore* store_; | 65 MockUserCloudPolicyStore* store_; |
| 66 scoped_ptr<UserCloudPolicyManager> manager_; | 66 scoped_ptr<UserCloudPolicyManager> manager_; |
| 67 | 67 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 78 store_->NotifyStoreLoaded(); | 78 store_->NotifyStoreLoaded(); |
| 79 EXPECT_TRUE(expected_bundle_.Equals(manager_->policies())); | 79 EXPECT_TRUE(expected_bundle_.Equals(manager_->policies())); |
| 80 EXPECT_TRUE(manager_->IsInitializationComplete(POLICY_DOMAIN_CHROME)); | 80 EXPECT_TRUE(manager_->IsInitializationComplete(POLICY_DOMAIN_CHROME)); |
| 81 EXPECT_CALL(*store_, Clear()); | 81 EXPECT_CALL(*store_, Clear()); |
| 82 manager_->DisconnectAndRemovePolicy(); | 82 manager_->DisconnectAndRemovePolicy(); |
| 83 EXPECT_FALSE(manager_->core()->service()); | 83 EXPECT_FALSE(manager_->core()->service()); |
| 84 } | 84 } |
| 85 | 85 |
| 86 } // namespace | 86 } // namespace |
| 87 } // namespace policy | 87 } // namespace policy |
| OLD | NEW |