OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef BASE_TEST_TEST_SIMPLE_TASK_RUNNER_H_ | 5 #ifndef BASE_TEST_TEST_SIMPLE_TASK_RUNNER_H_ |
6 #define BASE_TEST_TEST_SIMPLE_TASK_RUNNER_H_ | 6 #define BASE_TEST_TEST_SIMPLE_TASK_RUNNER_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 TestSimpleTaskRunner(); | 43 TestSimpleTaskRunner(); |
44 | 44 |
45 // SingleThreadTaskRunner implementation. | 45 // SingleThreadTaskRunner implementation. |
46 bool PostDelayedTask(const tracked_objects::Location& from_here, | 46 bool PostDelayedTask(const tracked_objects::Location& from_here, |
47 OnceClosure task, | 47 OnceClosure task, |
48 TimeDelta delay) override; | 48 TimeDelta delay) override; |
49 bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here, | 49 bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here, |
50 OnceClosure task, | 50 OnceClosure task, |
51 TimeDelta delay) override; | 51 TimeDelta delay) override; |
52 | 52 |
53 bool RunsTasksOnCurrentThread() const override; | 53 bool RunsTasksInCurrentSequence() const override; |
54 | 54 |
55 std::deque<TestPendingTask> TakePendingTasks(); | 55 std::deque<TestPendingTask> TakePendingTasks(); |
56 size_t NumPendingTasks() const; | 56 size_t NumPendingTasks() const; |
57 bool HasPendingTask() const; | 57 bool HasPendingTask() const; |
58 base::TimeDelta NextPendingTaskDelay() const; | 58 base::TimeDelta NextPendingTaskDelay() const; |
59 base::TimeDelta FinalPendingTaskDelay() const; | 59 base::TimeDelta FinalPendingTaskDelay() const; |
60 | 60 |
61 // Clears the queue of pending tasks without running them. | 61 // Clears the queue of pending tasks without running them. |
62 void ClearPendingTasks(); | 62 void ClearPendingTasks(); |
63 | 63 |
(...skipping 17 matching lines...) Expand all Loading... |
81 mutable Lock lock_; | 81 mutable Lock lock_; |
82 | 82 |
83 std::deque<TestPendingTask> pending_tasks_; | 83 std::deque<TestPendingTask> pending_tasks_; |
84 | 84 |
85 DISALLOW_COPY_AND_ASSIGN(TestSimpleTaskRunner); | 85 DISALLOW_COPY_AND_ASSIGN(TestSimpleTaskRunner); |
86 }; | 86 }; |
87 | 87 |
88 } // namespace base | 88 } // namespace base |
89 | 89 |
90 #endif // BASE_TEST_TEST_SIMPLE_TASK_RUNNER_H_ | 90 #endif // BASE_TEST_TEST_SIMPLE_TASK_RUNNER_H_ |
OLD | NEW |