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, |