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

Unified Diff: base/test/scoped_task_scheduler.cc

Issue 2834063002: Separate the create and start phases in TaskSchedulerImpl. (Closed)
Patch Set: CR-robliao-25-grammar 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 | « base/task_scheduler/task_scheduler_impl_unittest.cc ('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_scheduler.cc
diff --git a/base/test/scoped_task_scheduler.cc b/base/test/scoped_task_scheduler.cc
index 3c5b0e2fc7807a6b14ecddd640109a46c26aa417..ba19f628f3f882f1bfb74850c4d6a39c585ccc1c 100644
--- a/base/test/scoped_task_scheduler.cc
+++ b/base/test/scoped_task_scheduler.cc
@@ -38,6 +38,9 @@ namespace {
enum class ExecutionMode { PARALLEL, SEQUENCED, SINGLE_THREADED };
+// ScopedTaskScheduler intentionally breaks the TaskScheduler contract of not
+// running tasks before Start(). This avoid having to call Start() with dummy
+// parameters.
class TestTaskScheduler : public TaskScheduler {
public:
// |external_message_loop| is an externally provided MessageLoop on which to
@@ -47,6 +50,7 @@ class TestTaskScheduler : public TaskScheduler {
~TestTaskScheduler() override;
// TaskScheduler:
+ void Start(const TaskScheduler::InitParams& init_params) override;
void PostDelayedTaskWithTraits(const tracked_objects::Location& from_here,
const TaskTraits& traits,
OnceClosure task,
@@ -164,6 +168,10 @@ TestTaskScheduler::~TestTaskScheduler() {
Shutdown();
}
+void TestTaskScheduler::Start(const TaskScheduler::InitParams&) {
+ NOTREACHED();
+}
+
void TestTaskScheduler::PostDelayedTaskWithTraits(
const tracked_objects::Location& from_here,
const TaskTraits& traits,
« no previous file with comments | « base/task_scheduler/task_scheduler_impl_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698