Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(46)

Side by Side Diff: chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos_unittest.cc

Issue 14113053: chrome: Use base::MessageLoop. (Part 3) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase again Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 // process, and initializes the manager. 254 // process, and initializes the manager.
255 EXPECT_CALL(observer_, OnUpdatePolicy(manager_.get())); 255 EXPECT_CALL(observer_, OnUpdatePolicy(manager_.get()));
256 store_->policy_map_.CopyFrom(policy_map_); 256 store_->policy_map_.CopyFrom(policy_map_);
257 store_->NotifyStoreLoaded(); 257 store_->NotifyStoreLoaded();
258 EXPECT_TRUE(manager_->IsInitializationComplete(POLICY_DOMAIN_CHROME)); 258 EXPECT_TRUE(manager_->IsInitializationComplete(POLICY_DOMAIN_CHROME));
259 Mock::VerifyAndClearExpectations(&observer_); 259 Mock::VerifyAndClearExpectations(&observer_);
260 EXPECT_TRUE(manager_->policies().Equals(expected_bundle_)); 260 EXPECT_TRUE(manager_->policies().Equals(expected_bundle_));
261 } 261 }
262 262
263 // Required by the refresh scheduler that's created by the manager. 263 // Required by the refresh scheduler that's created by the manager.
264 MessageLoop loop_; 264 base::MessageLoop loop_;
265 content::TestBrowserThread ui_thread_; 265 content::TestBrowserThread ui_thread_;
266 // Required to cleanup the URLRequestContextGetter of the |signin_profile_|. 266 // Required to cleanup the URLRequestContextGetter of the |signin_profile_|.
267 content::TestBrowserThread io_thread_; 267 content::TestBrowserThread io_thread_;
268 268
269 // Convenience policy objects. 269 // Convenience policy objects.
270 em::PolicyData policy_data_; 270 em::PolicyData policy_data_;
271 em::DeviceManagementResponse register_blob_; 271 em::DeviceManagementResponse register_blob_;
272 em::DeviceManagementResponse policy_blob_; 272 em::DeviceManagementResponse policy_blob_;
273 PolicyMap policy_map_; 273 PolicyMap policy_map_;
274 PolicyBundle expected_bundle_; 274 PolicyBundle expected_bundle_;
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
506 506
507 // The refresh scheduler takes care of the initial fetch for unmanaged users. 507 // The refresh scheduler takes care of the initial fetch for unmanaged users.
508 // It posts a delayed task with 0ms delay in this case, so spinning the loop 508 // It posts a delayed task with 0ms delay in this case, so spinning the loop
509 // issues the initial fetch. 509 // issues the initial fetch.
510 base::RunLoop loop; 510 base::RunLoop loop;
511 FetchPolicy( 511 FetchPolicy(
512 base::Bind(&base::RunLoop::RunUntilIdle, base::Unretained(&loop))); 512 base::Bind(&base::RunLoop::RunUntilIdle, base::Unretained(&loop)));
513 } 513 }
514 514
515 } // namespace policy 515 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698