Commit b26583c7 authored by fdoray's avatar fdoray Committed by Commit bot

Use TaskScheduler instead of SequencedWorkerPool in default_component_installer_unittest.cc.

SequencedWorkerPool is being deprecated in favor of TaskScheduler.

BUG=667892
R=waffles@chromium.org

Review-Url: https://codereview.chromium.org/2882633003
Cr-Commit-Position: refs/heads/master@{#472175}
parent df49c6da
...@@ -10,9 +10,10 @@ ...@@ -10,9 +10,10 @@
#include "base/callback.h" #include "base/callback.h"
#include "base/macros.h" #include "base/macros.h"
#include "base/memory/ref_counted.h" #include "base/memory/ref_counted.h"
#include "base/message_loop/message_loop.h"
#include "base/run_loop.h" #include "base/run_loop.h"
#include "base/test/sequenced_worker_pool_owner.h" #include "base/task_scheduler/post_task.h"
#include "base/test/scoped_task_environment.h"
#include "base/threading/thread_task_runner_handle.h"
#include "base/version.h" #include "base/version.h"
#include "components/component_updater/component_updater_service.h" #include "components/component_updater/component_updater_service.h"
#include "components/component_updater/component_updater_service_internal.h" #include "components/component_updater/component_updater_service_internal.h"
...@@ -136,28 +137,23 @@ class DefaultComponentInstallerTest : public testing::Test { ...@@ -136,28 +137,23 @@ class DefaultComponentInstallerTest : public testing::Test {
void RunThreads(); void RunThreads();
private: private:
static const int kNumWorkerThreads_ = 2; base::test::ScopedTaskEnvironment scoped_task_environment_;
base::MessageLoopForUI message_loop_;
base::RunLoop runloop_; base::RunLoop runloop_;
base::Closure quit_closure_; base::Closure quit_closure_;
std::unique_ptr<base::SequencedWorkerPoolOwner> worker_pool_;
scoped_refptr<TestConfigurator> config_; scoped_refptr<TestConfigurator> config_;
scoped_refptr<MockUpdateClient> update_client_; scoped_refptr<MockUpdateClient> update_client_;
std::unique_ptr<ComponentUpdateService> component_updater_; std::unique_ptr<ComponentUpdateService> component_updater_;
}; };
DefaultComponentInstallerTest::DefaultComponentInstallerTest() DefaultComponentInstallerTest::DefaultComponentInstallerTest()
: worker_pool_( : scoped_task_environment_(
new base::SequencedWorkerPoolOwner(kNumWorkerThreads_, "test")) { base::test::ScopedTaskEnvironment::MainThreadType::UI) {
quit_closure_ = runloop_.QuitClosure(); quit_closure_ = runloop_.QuitClosure();
auto pool = worker_pool_->pool();
config_ = new TestConfigurator( config_ = new TestConfigurator(
pool->GetSequencedTaskRunner(pool->GetSequenceToken()), base::CreateSequencedTaskRunnerWithTraits({base::MayBlock()}),
message_loop_.task_runner()); base::ThreadTaskRunnerHandle::Get());
update_client_ = new MockUpdateClient(); update_client_ = new MockUpdateClient();
EXPECT_CALL(update_client(), AddObserver(_)).Times(1); EXPECT_CALL(update_client(), AddObserver(_)).Times(1);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment