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

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: no_ui_by_default 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..b0a6db328f7227555a5688ad8d5b85e83136c1a9 100644
--- a/base/test/scoped_task_environment.h
+++ b/base/test/scoped_task_environment.h
@@ -32,7 +32,17 @@ namespace test {
// https://docs.google.com/document/d/1QabRo8c7D9LsYY3cEcaPQbOCLo8Tu-6VLykYXyl3Pkk/edit
class ScopedTaskEnvironment {
public:
- ScopedTaskEnvironment();
+ enum class MainThreadType {
+ // The main thread doesn't pump messages.
gab 2017/04/27 14:22:59 s/doesn't pump messages/doesn't pump system messag
+ DEFAULT,
+ // The main thread pumps UI messages.
+ UI,
+ // The main thread pumps asynchronous IO messages.
+ IO,
+ };
+
+ ScopedTaskEnvironment(
+ MainThreadType main_thread_type = MainThreadType::DEFAULT);
// 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