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

Side by Side Diff: chrome/browser/policy/cloud/component_cloud_policy_service_unittest.cc

Issue 14113053: chrome: Use base::MessageLoop. (Part 3) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/component_cloud_policy_service.h" 5 #include "chrome/browser/policy/cloud/component_cloud_policy_service.h"
6 6
7 #include "base/files/scoped_temp_dir.h" 7 #include "base/files/scoped_temp_dir.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/pickle.h" 9 #include "base/pickle.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 scoped_ptr<em::PolicyFetchResponse> CreateResponse() { 169 scoped_ptr<em::PolicyFetchResponse> CreateResponse() {
170 builder_.Build(); 170 builder_.Build();
171 return make_scoped_ptr(new em::PolicyFetchResponse(builder_.policy())); 171 return make_scoped_ptr(new em::PolicyFetchResponse(builder_.policy()));
172 } 172 }
173 173
174 std::string CreateSerializedResponse() { 174 std::string CreateSerializedResponse() {
175 builder_.Build(); 175 builder_.Build();
176 return builder_.GetBlob(); 176 return builder_.GetBlob();
177 } 177 }
178 178
179 MessageLoop loop_; 179 base::MessageLoop loop_;
180 content::TestBrowserThread ui_thread_; 180 content::TestBrowserThread ui_thread_;
181 content::TestBrowserThread file_thread_; 181 content::TestBrowserThread file_thread_;
182 base::ScopedTempDir temp_dir_; 182 base::ScopedTempDir temp_dir_;
183 scoped_refptr<TestURLRequestContextGetter> request_context_; 183 scoped_refptr<TestURLRequestContextGetter> request_context_;
184 net::TestURLFetcherFactory fetcher_factory_; 184 net::TestURLFetcherFactory fetcher_factory_;
185 MockComponentCloudPolicyDelegate delegate_; 185 MockComponentCloudPolicyDelegate delegate_;
186 // |cache_| is owned by the |service_| and is invalid once the |service_| 186 // |cache_| is owned by the |service_| and is invalid once the |service_|
187 // is destroyed. 187 // is destroyed.
188 ResourceCache* cache_; 188 ResourceCache* cache_;
189 MockCloudPolicyClient client_; 189 MockCloudPolicyClient client_;
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
482 Mock::VerifyAndClearExpectations(&delegate_); 482 Mock::VerifyAndClearExpectations(&delegate_);
483 483
484 // The policy is now being served. 484 // The policy is now being served.
485 PolicyNamespace ns(POLICY_DOMAIN_EXTENSIONS, kTestExtension); 485 PolicyNamespace ns(POLICY_DOMAIN_EXTENSIONS, kTestExtension);
486 PolicyBundle expected_bundle; 486 PolicyBundle expected_bundle;
487 expected_bundle.Get(ns).CopyFrom(expected_policy_); 487 expected_bundle.Get(ns).CopyFrom(expected_policy_);
488 EXPECT_TRUE(service_->policy().Equals(expected_bundle)); 488 EXPECT_TRUE(service_->policy().Equals(expected_bundle));
489 } 489 }
490 490
491 } // namespace policy 491 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698