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

Unified Diff: base/test/scoped_task_environment.cc

Issue 2836963002: Allow ScopedTaskEnvironment to pump UI or IO messages on the main thread. (Closed)
Patch Set: self-review Created 3 years, 8 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
« base/test/scoped_task_environment.h ('K') | « base/test/scoped_task_environment.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/test/scoped_task_environment.cc
diff --git a/base/test/scoped_task_environment.cc b/base/test/scoped_task_environment.cc
index b18bf6a19d3a940ba0268f1dcb4409780d108cf5..9f4aed5c0c0f9b916157772d68344e91f12e143b 100644
--- a/base/test/scoped_task_environment.cc
+++ b/base/test/scoped_task_environment.cc
@@ -12,7 +12,10 @@
namespace base {
namespace test {
-ScopedTaskEnvironment::ScopedTaskEnvironment() {
+ScopedTaskEnvironment::ScopedTaskEnvironment(MainThreadType main_thread_type)
+ : message_loop_(main_thread_type == MainThreadType::UI
+ ? MessageLoop::TYPE_UI
+ : MessageLoop::TYPE_IO) {
DCHECK(!TaskScheduler::GetInstance());
// Instantiate a TaskScheduler with 1 thread in each of its 4 pools. Threads
« base/test/scoped_task_environment.h ('K') | « base/test/scoped_task_environment.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698