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

Unified Diff: base/task_scheduler/utils_unittest.cc

Issue 1806473002: TaskScheduler [9] Delayed Task Manager (Closed) Base URL: https://luckyluke-private.googlesource.com/src@s_5_worker_thread
Patch Set: self review Created 4 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
« base/task_scheduler/utils.h ('K') | « base/task_scheduler/utils.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/task_scheduler/utils_unittest.cc
diff --git a/base/task_scheduler/utils_unittest.cc b/base/task_scheduler/utils_unittest.cc
index 6b3904b958d2e461d3d7e4ffac7b0f9ed70a1d54..ff37d0d15b5b3cb93c528cc55a103c56ed292e87 100644
--- a/base/task_scheduler/utils_unittest.cc
+++ b/base/task_scheduler/utils_unittest.cc
@@ -13,26 +13,23 @@
#include "base/task_scheduler/priority_queue.h"
#include "base/task_scheduler/sequence.h"
#include "base/task_scheduler/task.h"
-#include "base/task_scheduler/task_tracker.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace base {
namespace internal {
namespace {
-// Checks that when PostTaskHelper is called with an empty sequence, the task
+// Checks that when PostTaskNowHelper is called with an empty sequence, the task
// is added to the sequence and the sequence is added to the priority queue.
-TEST(TaskSchedulerPostTaskHelperTest, PostTaskInEmptySequence) {
+TEST(TaskSchedulerPostTaskNowHelperTest, PostTaskInEmptySequence) {
std::unique_ptr<Task> task(
new Task(FROM_HERE, Bind(&DoNothing), TaskTraits()));
const Task* task_raw = task.get();
scoped_refptr<Sequence> sequence(new Sequence);
PriorityQueue priority_queue(Bind(&DoNothing));
- TaskTracker task_tracker;
// Post |task|.
- EXPECT_TRUE(PostTaskHelper(std::move(task), sequence, &priority_queue,
- &task_tracker));
+ PostTaskNowHelper(std::move(task), sequence, &priority_queue);
// Expect to find the sequence in the priority queue.
EXPECT_EQ(sequence, priority_queue.BeginTransaction()->Peek().sequence);
@@ -43,24 +40,22 @@ TEST(TaskSchedulerPostTaskHelperTest, PostTaskInEmptySequence) {
EXPECT_EQ(nullptr, sequence->PeekTask());
}
-// Checks that when PostTaskHelper is called with a sequence that already
+// Checks that when PostTaskNowHelper is called with a sequence that already
// contains a task, the task is added to the sequence but the sequence is not
// added to the priority queue.
-TEST(TaskSchedulerPostTaskHelperTest, PostTaskInNonEmptySequence) {
+TEST(TaskSchedulerPostTaskNowHelperTest, PostTaskInNonEmptySequence) {
std::unique_ptr<Task> task(
new Task(FROM_HERE, Bind(&DoNothing), TaskTraits()));
const Task* task_raw = task.get();
scoped_refptr<Sequence> sequence(new Sequence);
PriorityQueue priority_queue(Bind(&DoNothing));
- TaskTracker task_tracker;
// Add an initial task in |sequence|.
sequence->PushTask(
WrapUnique(new Task(FROM_HERE, Bind(&DoNothing), TaskTraits())));
// Post |task|.
- EXPECT_TRUE(PostTaskHelper(std::move(task), sequence, &priority_queue,
- &task_tracker));
+ PostTaskNowHelper(std::move(task), sequence, &priority_queue);
// Expect to find the priority queue empty.
EXPECT_TRUE(priority_queue.BeginTransaction()->Peek().is_null());
« base/task_scheduler/utils.h ('K') | « base/task_scheduler/utils.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698