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

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: 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..118990a633a023192aabd046c04edbf1c850b1ad 100644
--- a/components/component_updater/default_component_installer_unittest.cc
+++ b/components/component_updater/default_component_installer_unittest.cc
@@ -10,9 +10,9 @@
#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/version.h"
#include "components/component_updater/component_updater_service.h"
#include "components/component_updater/component_updater_service_internal.h"
@@ -136,9 +136,7 @@ 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_;
@@ -150,14 +148,13 @@ class DefaultComponentInstallerTest : public testing::Test {
};
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