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

Unified Diff: base/test/scoped_task_environment.h

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
« no previous file with comments | « no previous file | base/test/scoped_task_environment.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/test/scoped_task_environment.h
diff --git a/base/test/scoped_task_environment.h b/base/test/scoped_task_environment.h
index 2887d0765bacf5753eb4037a8f79931e22e9c022..3efea57840a05bc6894d1618e361784a52cfe5b7 100644
--- a/base/test/scoped_task_environment.h
+++ b/base/test/scoped_task_environment.h
@@ -32,7 +32,14 @@ namespace test {
// https://docs.google.com/document/d/1QabRo8c7D9LsYY3cEcaPQbOCLo8Tu-6VLykYXyl3Pkk/edit
class ScopedTaskEnvironment {
public:
- ScopedTaskEnvironment();
+ enum class MainThreadType {
+ // The main thread pumps UI messages.
+ UI,
+ // The main thread pumps asynchronous IO messages.
+ IO,
+ };
+
+ ScopedTaskEnvironment(MainThreadType main_thread_type = MainThreadType::UI);
robliao 2017/04/24 22:42:31 The default message loop was used before (does not
// Runs pending (Thread|Sequenced)TaskRunnerHandle tasks and pending
// BLOCK_SHUTDOWN TaskScheduler tasks. Then, unregisters the TaskScheduler and
« no previous file with comments | « no previous file | base/test/scoped_task_environment.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698