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

Unified 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: Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: components/component_updater/test/test_configurator.cc
diff --git a/components/component_updater/test/test_configurator.cc b/components/component_updater/test/test_configurator.cc
index 4c2625e545eff18537ed387ecf950ec1488f87b0..d611f9ed0cc8731305a3ee1a190f9bd64b2c2bf1 100644
--- a/components/component_updater/test/test_configurator.cc
+++ b/components/component_updater/test/test_configurator.cc
@@ -8,20 +8,19 @@
#include "base/version.h"
#include "components/component_updater/component_patcher_operation.h"
#include "components/component_updater/test/test_configurator.h"
-#include "content/public/browser/browser_thread.h"
#include "url/gurl.h"
-using content::BrowserThread;
-
namespace component_updater {
-TestConfigurator::TestConfigurator()
- : initial_time_(0),
+TestConfigurator::TestConfigurator(
+ const scoped_refptr<base::SequencedTaskRunner>& worker_task_runner,
+ const scoped_refptr<base::SingleThreadTaskRunner>& network_task_runner)
+ : worker_task_runner_(worker_task_runner),
+ initial_time_(0),
times_(1),
recheck_time_(0),
ondemand_time_(0),
- context_(new net::TestURLRequestContextGetter(
- BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO))) {
+ context_(new net::TestURLRequestContextGetter(network_task_runner)) {
}
TestConfigurator::~TestConfigurator() {
@@ -133,16 +132,14 @@ void TestConfigurator::SetInitialDelay(int seconds) {
scoped_refptr<base::SequencedTaskRunner>
TestConfigurator::GetSequencedTaskRunner() const {
- return content::BrowserThread::GetBlockingPool()
- ->GetSequencedTaskRunnerWithShutdownBehavior(
- content::BrowserThread::GetBlockingPool()->GetSequenceToken(),
- base::SequencedWorkerPool::SKIP_ON_SHUTDOWN);
+ DCHECK(worker_task_runner_.get());
+ return worker_task_runner_;
}
scoped_refptr<base::SingleThreadTaskRunner>
TestConfigurator::GetSingleThreadTaskRunner() const {
- return content::BrowserThread::GetMessageLoopProxyForThread(
- content::BrowserThread::FILE);
+ // This is NULL because tests do not use the background downloader.
+ return NULL;
}
} // namespace component_updater

Powered by Google App Engine
This is Rietveld 408576698