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/chromeos/policy/user_cloud_policy_manager_chromeos.h" | 5 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 manager_->RemoveObserver(&observer_); | 136 manager_->RemoveObserver(&observer_); |
137 manager_->Shutdown(); | 137 manager_->Shutdown(); |
138 } | 138 } |
139 signin_profile_->ResetRequestContext(); | 139 signin_profile_->ResetRequestContext(); |
140 } | 140 } |
141 | 141 |
142 void CreateManager(bool wait_for_fetch) { | 142 void CreateManager(bool wait_for_fetch) { |
143 store_ = new MockCloudPolicyStore(); | 143 store_ = new MockCloudPolicyStore(); |
144 EXPECT_CALL(*store_, Load()); | 144 EXPECT_CALL(*store_, Load()); |
145 manager_.reset(new UserCloudPolicyManagerChromeOS( | 145 manager_.reset(new UserCloudPolicyManagerChromeOS( |
| 146 profile_, |
146 scoped_ptr<CloudPolicyStore>(store_), | 147 scoped_ptr<CloudPolicyStore>(store_), |
147 scoped_ptr<ResourceCache>(), | 148 scoped_ptr<ResourceCache>(), |
148 wait_for_fetch)); | 149 wait_for_fetch)); |
149 manager_->Init(); | 150 manager_->Init(); |
150 manager_->AddObserver(&observer_); | 151 manager_->AddObserver(&observer_); |
151 manager_->Connect(&prefs_, &device_management_service_, NULL, | 152 manager_->Connect(&prefs_, &device_management_service_, NULL, |
152 USER_AFFILIATION_NONE); | 153 USER_AFFILIATION_NONE); |
153 Mock::VerifyAndClearExpectations(store_); | 154 Mock::VerifyAndClearExpectations(store_); |
154 EXPECT_FALSE(manager_->IsInitializationComplete(POLICY_DOMAIN_CHROME)); | 155 EXPECT_FALSE(manager_->IsInitializationComplete(POLICY_DOMAIN_CHROME)); |
155 EXPECT_FALSE(manager_->core()->service()->IsInitializationComplete()); | 156 EXPECT_FALSE(manager_->core()->service()->IsInitializationComplete()); |
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
511 | 512 |
512 // The refresh scheduler takes care of the initial fetch for unmanaged users. | 513 // The refresh scheduler takes care of the initial fetch for unmanaged users. |
513 // It posts a delayed task with 0ms delay in this case, so spinning the loop | 514 // It posts a delayed task with 0ms delay in this case, so spinning the loop |
514 // issues the initial fetch. | 515 // issues the initial fetch. |
515 base::RunLoop loop; | 516 base::RunLoop loop; |
516 FetchPolicy( | 517 FetchPolicy( |
517 base::Bind(&base::RunLoop::RunUntilIdle, base::Unretained(&loop))); | 518 base::Bind(&base::RunLoop::RunUntilIdle, base::Unretained(&loop))); |
518 } | 519 } |
519 | 520 |
520 } // namespace policy | 521 } // namespace policy |
OLD | NEW |