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

Side by Side Diff: components/component_updater/component_updater_service_unittest.cc

Issue 2257793002: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 3 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "components/component_updater/component_updater_service.h" 5 #include "components/component_updater/component_updater_service.h"
6 6
7 #include <limits> 7 #include <limits>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 base::Bind(&OnDemandTester::OnDemandComplete, base::Unretained(this))); 162 base::Bind(&OnDemandTester::OnDemandComplete, base::Unretained(this)));
163 } 163 }
164 164
165 void OnDemandTester::OnDemandComplete(int error) { 165 void OnDemandTester::OnDemandComplete(int error) {
166 error_ = error; 166 error_ = error;
167 } 167 }
168 168
169 std::unique_ptr<ComponentUpdateService> TestComponentUpdateServiceFactory( 169 std::unique_ptr<ComponentUpdateService> TestComponentUpdateServiceFactory(
170 const scoped_refptr<Configurator>& config) { 170 const scoped_refptr<Configurator>& config) {
171 DCHECK(config); 171 DCHECK(config);
172 return base::WrapUnique(new CrxUpdateService(config, new MockUpdateClient())); 172 return base::MakeUnique<CrxUpdateService>(config, new MockUpdateClient());
173 } 173 }
174 174
175 ComponentUpdaterTest::ComponentUpdaterTest() 175 ComponentUpdaterTest::ComponentUpdaterTest()
176 : worker_pool_( 176 : worker_pool_(
177 new base::SequencedWorkerPoolOwner(kNumWorkerThreads_, "test")) { 177 new base::SequencedWorkerPoolOwner(kNumWorkerThreads_, "test")) {
178 quit_closure_ = runloop_.QuitClosure(); 178 quit_closure_ = runloop_.QuitClosure();
179 179
180 auto pool = worker_pool_->pool(); 180 auto pool = worker_pool_->pool();
181 config_ = new TestConfigurator( 181 config_ = new TestConfigurator(
182 pool->GetSequencedTaskRunner(pool->GetSequenceToken()), 182 pool->GetSequencedTaskRunner(pool->GetSequenceToken()),
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 base::Bind(&ComponentUpdaterTest::ReadyCallback)); 400 base::Bind(&ComponentUpdaterTest::ReadyCallback));
401 401
402 RunThreads(); 402 RunThreads();
403 403
404 ht.ExpectUniqueSample("ComponentUpdater.Calls", 0, 1); 404 ht.ExpectUniqueSample("ComponentUpdater.Calls", 0, 1);
405 ht.ExpectUniqueSample("ComponentUpdater.UpdateCompleteResult", 0, 1); 405 ht.ExpectUniqueSample("ComponentUpdater.UpdateCompleteResult", 0, 1);
406 ht.ExpectTotalCount("ComponentUpdater.UpdateCompleteTime", 1); 406 ht.ExpectTotalCount("ComponentUpdater.UpdateCompleteTime", 1);
407 } 407 }
408 408
409 } // namespace component_updater 409 } // namespace component_updater
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698