OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |