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

Side by Side Diff: components/component_updater/test/test_configurator.cc

Issue 514473002: Componentize component_updater: Break content/ dependency for rest of component_updater tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix lint issues. fix explicits. Created 6 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 <string> 5 #include <string>
6 6
7 #include "base/run_loop.h" 7 #include "base/run_loop.h"
8 #include "base/version.h" 8 #include "base/version.h"
9 #include "components/component_updater/component_patcher_operation.h" 9 #include "components/component_updater/component_patcher_operation.h"
10 #include "components/component_updater/test/test_configurator.h" 10 #include "components/component_updater/test/test_configurator.h"
11 #include "content/public/browser/browser_thread.h"
12 #include "url/gurl.h" 11 #include "url/gurl.h"
13 12
14 using content::BrowserThread;
15
16 namespace component_updater { 13 namespace component_updater {
17 14
18 TestConfigurator::TestConfigurator() 15 TestConfigurator::TestConfigurator(
19 : initial_time_(0), 16 const scoped_refptr<base::SequencedTaskRunner>& worker_task_runner,
17 const scoped_refptr<base::SingleThreadTaskRunner>& network_task_runner)
18 : worker_task_runner_(worker_task_runner),
19 initial_time_(0),
20 times_(1), 20 times_(1),
21 recheck_time_(0), 21 recheck_time_(0),
22 ondemand_time_(0), 22 ondemand_time_(0),
23 context_(new net::TestURLRequestContextGetter( 23 context_(new net::TestURLRequestContextGetter(network_task_runner)) {
24 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO))) {
25 } 24 }
26 25
27 TestConfigurator::~TestConfigurator() { 26 TestConfigurator::~TestConfigurator() {
28 } 27 }
29 28
30 int TestConfigurator::InitialDelay() const { 29 int TestConfigurator::InitialDelay() const {
31 return initial_time_; 30 return initial_time_;
32 } 31 }
33 32
34 int TestConfigurator::NextCheckDelay() { 33 int TestConfigurator::NextCheckDelay() {
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 void TestConfigurator::SetQuitClosure(const base::Closure& quit_closure) { 125 void TestConfigurator::SetQuitClosure(const base::Closure& quit_closure) {
127 quit_closure_ = quit_closure; 126 quit_closure_ = quit_closure;
128 } 127 }
129 128
130 void TestConfigurator::SetInitialDelay(int seconds) { 129 void TestConfigurator::SetInitialDelay(int seconds) {
131 initial_time_ = seconds; 130 initial_time_ = seconds;
132 } 131 }
133 132
134 scoped_refptr<base::SequencedTaskRunner> 133 scoped_refptr<base::SequencedTaskRunner>
135 TestConfigurator::GetSequencedTaskRunner() const { 134 TestConfigurator::GetSequencedTaskRunner() const {
136 return content::BrowserThread::GetBlockingPool() 135 DCHECK(worker_task_runner_.get());
137 ->GetSequencedTaskRunnerWithShutdownBehavior( 136 return worker_task_runner_;
138 content::BrowserThread::GetBlockingPool()->GetSequenceToken(),
139 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN);
140 } 137 }
141 138
142 scoped_refptr<base::SingleThreadTaskRunner> 139 scoped_refptr<base::SingleThreadTaskRunner>
143 TestConfigurator::GetSingleThreadTaskRunner() const { 140 TestConfigurator::GetSingleThreadTaskRunner() const {
144 return content::BrowserThread::GetMessageLoopProxyForThread( 141 // This is NULL because tests do not use the background downloader.
145 content::BrowserThread::FILE); 142 return NULL;
146 } 143 }
147 144
148 } // namespace component_updater 145 } // namespace component_updater
OLDNEW
« no previous file with comments | « components/component_updater/test/test_configurator.h ('k') | components/component_updater/test/update_checker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698