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

Unified Diff: components/component_updater/default_component_installer_unittest.cc

Issue 2882633003: Use TaskScheduler instead of SequencedWorkerPool in default_component_installer_unittest.cc. (Closed)
Patch Set: add-missing-include Created 3 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/component_updater/default_component_installer_unittest.cc
diff --git a/components/component_updater/default_component_installer_unittest.cc b/components/component_updater/default_component_installer_unittest.cc
index d9bb6d39d914ebb76477e9df44932ed54ed1971b..278e3aa36c2ae89c91b602eec65cea9346797d3b 100644
--- a/components/component_updater/default_component_installer_unittest.cc
+++ b/components/component_updater/default_component_installer_unittest.cc
@@ -10,9 +10,10 @@
#include "base/callback.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
-#include "base/message_loop/message_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 "components/component_updater/component_updater_service.h"
#include "components/component_updater/component_updater_service_internal.h"
@@ -136,28 +137,23 @@ class DefaultComponentInstallerTest : public testing::Test {
void RunThreads();
private:
- static const int kNumWorkerThreads_ = 2;
-
- base::MessageLoopForUI message_loop_;
+ base::test::ScopedTaskEnvironment scoped_task_environment_;
base::RunLoop runloop_;
base::Closure quit_closure_;
- std::unique_ptr<base::SequencedWorkerPoolOwner> worker_pool_;
-
scoped_refptr<TestConfigurator> config_;
scoped_refptr<MockUpdateClient> update_client_;
std::unique_ptr<ComponentUpdateService> component_updater_;
};
DefaultComponentInstallerTest::DefaultComponentInstallerTest()
- : worker_pool_(
- new base::SequencedWorkerPoolOwner(kNumWorkerThreads_, "test")) {
+ : scoped_task_environment_(
+ base::test::ScopedTaskEnvironment::MainThreadType::UI) {
quit_closure_ = runloop_.QuitClosure();
- auto pool = worker_pool_->pool();
config_ = new TestConfigurator(
- pool->GetSequencedTaskRunner(pool->GetSequenceToken()),
- message_loop_.task_runner());
+ base::CreateSequencedTaskRunnerWithTraits({base::MayBlock()}),
+ base::ThreadTaskRunnerHandle::Get());
update_client_ = new MockUpdateClient();
EXPECT_CALL(update_client(), AddObserver(_)).Times(1);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698