chromium/base/task/sequence_manager/task_queue_unittest.cc

// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "base/task/sequence_manager/task_queue.h"

#include "base/message_loop/message_pump.h"
#include "base/message_loop/message_pump_type.h"
#include "base/task/sequence_manager/sequence_manager.h"
#include "base/task/sequence_manager/test/sequence_manager_for_test.h"
#include "base/task/single_thread_task_runner.h"
#include "base/task/task_features.h"
#include "base/test/bind.h"
#include "base/test/scoped_feature_list.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace base {
namespace sequence_manager {
namespace internal {
// To avoid symbol collisions in jumbo builds.
namespace task_queue_unittest {
namespace {

TEST(TaskQueueTest, TaskQueueVoters) {}

TEST(TaskQueueTest, ShutdownQueueBeforeEnabledVoterDeleted) {}

TEST(TaskQueueTest, ShutdownQueueBeforeDisabledVoterDeleted) {}

TEST(TaskQueueTest, CanceledTaskRemoved) {}

// Tests that a task posted through `PostCancelableDelayedTask()` is not
// considered canceled once it has reached the |delayed_work_queue| and is
// therefore not removed.
//
// This is a regression test for a bug in `Task::IsCanceled()` (see
// https://crbug.com/1288882). Note that this function is only called on tasks
// inside the |delayed_work_queue|, and not for tasks in the
// |delayed_incoming_queue|. This is because a task posted through
// `PostCancelableDelayedTask()` is always valid while it is in the
// |delayed_incoming_queue|, since canceling it would remove it from the queue.
TEST(TaskQueueTest, ValidCancelableTaskIsNotCanceled) {}

}  // namespace
}  // namespace task_queue_unittest
}  // namespace internal
}  // namespace sequence_manager
}  // namespace base