#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "base/task/sequence_manager/work_queue_sets.h"
#include <stddef.h>
#include <memory>
#include <optional>
#include "base/functional/bind.h"
#include "base/memory/ptr_util.h"
#include "base/task/sequence_manager/enqueue_order.h"
#include "base/task/sequence_manager/fence.h"
#include "base/task/sequence_manager/task_order.h"
#include "base/task/sequence_manager/task_queue.h"
#include "base/task/sequence_manager/work_queue.h"
#include "base/time/time.h"
#include "testing/gmock/include/gmock/gmock.h"
namespace base {
namespace sequence_manager {
class TimeDomain;
namespace internal {
namespace {
class MockObserver : public WorkQueueSets::Observer { … };
const TaskQueue::QueuePriority kHighestPriority = …;
const TaskQueue::QueuePriority kDefaultPriority = …;
const TaskQueue::QueuePriority kPriorityCount = …;
}
class WorkQueueSetsTest : public testing::Test { … };
TEST_F(WorkQueueSetsTest, ChangeSetIndex) { … }
TEST_F(WorkQueueSetsTest, GetOldestQueueAndTaskOrderInSet_QueueEmpty) { … }
TEST_F(WorkQueueSetsTest, OnTaskPushedToEmptyQueue) { … }
TEST_F(WorkQueueSetsTest, GetOldestQueueAndTaskOrderInSet_SingleTaskInSet) { … }
TEST_F(WorkQueueSetsTest, GetOldestQueueAndTaskOrderInSet_TaskOrder) { … }
TEST_F(WorkQueueSetsTest, GetOldestQueueAndTaskOrderInSet_MultipleAgesInSet) { … }
TEST_F(WorkQueueSetsTest, OnQueuesFrontTaskChanged) { … }
TEST_F(WorkQueueSetsTest, OnQueuesFrontTaskChanged_OldestQueueBecomesEmpty) { … }
TEST_F(WorkQueueSetsTest, OnQueuesFrontTaskChanged_YoungestQueueBecomesEmpty) { … }
TEST_F(WorkQueueSetsTest, OnPopMinQueueInSet) { … }
TEST_F(WorkQueueSetsTest, OnPopMinQueueInSet_QueueBecomesEmpty) { … }
TEST_F(WorkQueueSetsTest,
GetOldestQueueAndTaskOrderInSet_MultipleAgesInSetIntegerRollover) { … }
TEST_F(WorkQueueSetsTest,
GetOldestQueueAndTaskOrderInSet_MultipleAgesInSet_RemoveQueue) { … }
TEST_F(WorkQueueSetsTest, ChangeSetIndex_Complex) { … }
TEST_F(WorkQueueSetsTest, IsSetEmpty_NoWork) { … }
TEST_F(WorkQueueSetsTest, IsSetEmpty_Work) { … }
TEST_F(WorkQueueSetsTest, BlockQueuesByFence) { … }
TEST_F(WorkQueueSetsTest, PushNonNestableTaskToFront) { … }
TEST_F(WorkQueueSetsTest, CollectSkippedOverLowerPriorityTasks) { … }
TEST_F(WorkQueueSetsTest, CompareDelayedTasksWithSameEnqueueOrder) { … }
TEST_F(WorkQueueSetsTest, CompareDelayedTasksWithSameEnqueueOrderAndRunTime) { … }
TEST_F(WorkQueueSetsTest, CompareDelayedAndImmediateTasks) { … }
}
}
}