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

Unified Diff: base/test/test_simple_task_runner.cc

Issue 2331423002: Replace TestSimpleTaskRunner::GetPendingTasks with TakePendingTasks (Closed)
Patch Set: split test Created 4 years, 3 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/test/test_simple_task_runner.h ('k') | cc/base/delayed_unique_notifier_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/test/test_simple_task_runner.cc
diff --git a/base/test/test_simple_task_runner.cc b/base/test/test_simple_task_runner.cc
index cabd83c56cfd53411c067ea343c90ae51bfc068f..94d8e4834a3b7641296522021cbca850c6a95404 100644
--- a/base/test/test_simple_task_runner.cc
+++ b/base/test/test_simple_task_runner.cc
@@ -38,9 +38,9 @@ bool TestSimpleTaskRunner::RunsTasksOnCurrentThread() const {
return thread_ref_ == PlatformThread::CurrentRef();
}
-std::deque<TestPendingTask> TestSimpleTaskRunner::GetPendingTasks() const {
+std::deque<TestPendingTask> TestSimpleTaskRunner::TakePendingTasks() {
AutoLock auto_lock(lock_);
- return pending_tasks_;
+ return std::move(pending_tasks_);
}
size_t TestSimpleTaskRunner::NumPendingTasks() const {
@@ -58,6 +58,11 @@ base::TimeDelta TestSimpleTaskRunner::NextPendingTaskDelay() const {
return pending_tasks_.front().GetTimeToRun() - base::TimeTicks();
}
+base::TimeDelta TestSimpleTaskRunner::FinalPendingTaskDelay() const {
+ AutoLock auto_lock(lock_);
+ return pending_tasks_.back().GetTimeToRun() - base::TimeTicks();
+}
+
void TestSimpleTaskRunner::ClearPendingTasks() {
AutoLock auto_lock(lock_);
pending_tasks_.clear();
« no previous file with comments | « base/test/test_simple_task_runner.h ('k') | cc/base/delayed_unique_notifier_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698