| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_MOCK_TIME_TASK_RUNNER_H_ | 5 #ifndef BASE_TEST_TEST_MOCK_TIME_TASK_RUNNER_H_ |
| 6 #define BASE_TEST_TEST_MOCK_TIME_TASK_RUNNER_H_ | 6 #define BASE_TEST_TEST_MOCK_TIME_TASK_RUNNER_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <deque> | 10 #include <deque> |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 // Returns a TickClock that uses the virtual time ticks of |this| as its tick | 132 // Returns a TickClock that uses the virtual time ticks of |this| as its tick |
| 133 // source. The returned TickClock will hold a reference to |this|. | 133 // source. The returned TickClock will hold a reference to |this|. |
| 134 std::unique_ptr<TickClock> GetMockTickClock() const; | 134 std::unique_ptr<TickClock> GetMockTickClock() const; |
| 135 | 135 |
| 136 std::deque<TestPendingTask> TakePendingTasks(); | 136 std::deque<TestPendingTask> TakePendingTasks(); |
| 137 bool HasPendingTask() const; | 137 bool HasPendingTask() const; |
| 138 size_t GetPendingTaskCount() const; | 138 size_t GetPendingTaskCount() const; |
| 139 TimeDelta NextPendingTaskDelay() const; | 139 TimeDelta NextPendingTaskDelay() const; |
| 140 | 140 |
| 141 // SingleThreadTaskRunner: | 141 // SingleThreadTaskRunner: |
| 142 bool RunsTasksOnCurrentThread() const override; | 142 bool RunsTasksInCurrentSequence() const override; |
| 143 bool PostDelayedTask(const tracked_objects::Location& from_here, | 143 bool PostDelayedTask(const tracked_objects::Location& from_here, |
| 144 OnceClosure task, | 144 OnceClosure task, |
| 145 TimeDelta delay) override; | 145 TimeDelta delay) override; |
| 146 bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here, | 146 bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here, |
| 147 OnceClosure task, | 147 OnceClosure task, |
| 148 TimeDelta delay) override; | 148 TimeDelta delay) override; |
| 149 | 149 |
| 150 protected: | 150 protected: |
| 151 ~TestMockTimeTaskRunner() override; | 151 ~TestMockTimeTaskRunner() override; |
| 152 | 152 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 size_t next_task_ordinal_; | 215 size_t next_task_ordinal_; |
| 216 | 216 |
| 217 Lock tasks_lock_; | 217 Lock tasks_lock_; |
| 218 | 218 |
| 219 DISALLOW_COPY_AND_ASSIGN(TestMockTimeTaskRunner); | 219 DISALLOW_COPY_AND_ASSIGN(TestMockTimeTaskRunner); |
| 220 }; | 220 }; |
| 221 | 221 |
| 222 } // namespace base | 222 } // namespace base |
| 223 | 223 |
| 224 #endif // BASE_TEST_TEST_MOCK_TIME_TASK_RUNNER_H_ | 224 #endif // BASE_TEST_TEST_MOCK_TIME_TASK_RUNNER_H_ |
| OLD | NEW |