| 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/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "base/message_loop/message_loop_proxy.h" | 9 #include "base/message_loop/message_loop_proxy.h" |
| 10 #include "base/sequenced_task_runner.h" | 10 #include "base/sequenced_task_runner.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 manager_->Shutdown(); | 45 manager_->Shutdown(); |
| 46 } | 46 } |
| 47 } | 47 } |
| 48 | 48 |
| 49 void CreateManager() { | 49 void CreateManager() { |
| 50 store_ = new MockUserCloudPolicyStore(); | 50 store_ = new MockUserCloudPolicyStore(); |
| 51 EXPECT_CALL(*store_, Load()); | 51 EXPECT_CALL(*store_, Load()); |
| 52 manager_.reset(new UserCloudPolicyManager( | 52 manager_.reset(new UserCloudPolicyManager( |
| 53 NULL, | 53 NULL, |
| 54 scoped_ptr<UserCloudPolicyStore>(store_), | 54 scoped_ptr<UserCloudPolicyStore>(store_), |
| 55 base::FilePath(), |
| 55 scoped_ptr<CloudExternalDataManager>(), | 56 scoped_ptr<CloudExternalDataManager>(), |
| 57 loop_.message_loop_proxy(), |
| 58 loop_.message_loop_proxy(), |
| 56 loop_.message_loop_proxy())); | 59 loop_.message_loop_proxy())); |
| 57 manager_->Init(&schema_registry_); | 60 manager_->Init(&schema_registry_); |
| 58 manager_->AddObserver(&observer_); | 61 manager_->AddObserver(&observer_); |
| 59 Mock::VerifyAndClearExpectations(store_); | 62 Mock::VerifyAndClearExpectations(store_); |
| 60 } | 63 } |
| 61 | 64 |
| 62 // Required by the refresh scheduler that's created by the manager. | 65 // Required by the refresh scheduler that's created by the manager. |
| 63 base::MessageLoop loop_; | 66 base::MessageLoop loop_; |
| 64 | 67 |
| 65 // Convenience policy objects. | 68 // Convenience policy objects. |
| (...skipping 19 matching lines...) Expand all Loading... |
| 85 store_->NotifyStoreLoaded(); | 88 store_->NotifyStoreLoaded(); |
| 86 EXPECT_TRUE(expected_bundle_.Equals(manager_->policies())); | 89 EXPECT_TRUE(expected_bundle_.Equals(manager_->policies())); |
| 87 EXPECT_TRUE(manager_->IsInitializationComplete(POLICY_DOMAIN_CHROME)); | 90 EXPECT_TRUE(manager_->IsInitializationComplete(POLICY_DOMAIN_CHROME)); |
| 88 EXPECT_CALL(*store_, Clear()); | 91 EXPECT_CALL(*store_, Clear()); |
| 89 manager_->DisconnectAndRemovePolicy(); | 92 manager_->DisconnectAndRemovePolicy(); |
| 90 EXPECT_FALSE(manager_->core()->service()); | 93 EXPECT_FALSE(manager_->core()->service()); |
| 91 } | 94 } |
| 92 | 95 |
| 93 } // namespace | 96 } // namespace |
| 94 } // namespace policy | 97 } // namespace policy |
| OLD | NEW |