chromium/third_party/blink/renderer/platform/scheduler/worker/worker_thread_scheduler_unittest.cc

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

#include "third_party/blink/renderer/platform/scheduler/worker/worker_thread_scheduler.h"

#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/memory/raw_ptr.h"
#include "base/task/sequence_manager/test/fake_task.h"
#include "base/task/sequence_manager/test/sequence_manager_for_test.h"
#include "base/task/single_thread_task_runner.h"
#include "base/test/task_environment.h"
#include "base/time/time.h"
#include "components/ukm/test_ukm_recorder.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/renderer/platform/scheduler/common/process_state.h"
#include "third_party/blink/renderer/platform/scheduler/common/task_priority.h"
#include "third_party/blink/renderer/platform/scheduler/test/fake_frame_scheduler.h"
#include "third_party/blink/renderer/platform/scheduler/test/recording_task_time_observer.h"

ElementsAreArray;

namespace blink {
namespace scheduler {
// To avoid symbol collisions in jumbo builds.
namespace worker_thread_scheduler_unittest {

namespace {

void NopTask() {}

// Instantiated at the beginning of each test. |timeline_start_ticks_| can be
// used to offset the original Now() against future timings to helper
// readability of the test cases.
class ScopedSaveStartTicks {};

// static
base::TimeTicks ScopedSaveStartTicks::timeline_start_ticks_;

int TimeTicksToIntMs(const base::TimeTicks& time) {}

void RecordTimelineTask(Vector<String>* timeline,
                        const base::TickClock* clock) {}

void AppendToVectorTestTask(Vector<String>* vector, String value) {}

void AppendToVectorIdleTestTask(Vector<String>* vector,
                                String value,
                                base::TimeTicks deadline) {}

void TimelineIdleTestTask(Vector<String>* timeline, base::TimeTicks deadline) {}

class WorkerThreadSchedulerForTest : public WorkerThreadScheduler {};

class WorkerThreadSchedulerTest : public testing::Test {};

}  // namespace

TEST_F(WorkerThreadSchedulerTest, TestPostDefaultTask) {}

TEST_F(WorkerThreadSchedulerTest, TestPostIdleTask) {}

TEST_F(WorkerThreadSchedulerTest, TestPostDefaultAndIdleTasks) {}

TEST_F(WorkerThreadSchedulerTest, TestPostDefaultDelayedAndIdleTasks) {}

TEST_F(WorkerThreadSchedulerTest, TestIdleTaskWhenIsNotQuiescent) {}

TEST_F(WorkerThreadSchedulerTest, TestIdleDeadlineWithPendingDelayedTask) {}

TEST_F(WorkerThreadSchedulerTest,
       TestIdleDeadlineWithPendingDelayedTaskFarInTheFuture) {}

TEST_F(WorkerThreadSchedulerTest, TestPostIdleTaskAfterRunningUntilIdle) {}

void PostIdleTask(Vector<String>* timeline,
                  const base::TickClock* clock,
                  SingleThreadIdleTaskRunner* idle_task_runner) {}

TEST_F(WorkerThreadSchedulerTest, TestLongIdlePeriodTimeline) {}

TEST_F(WorkerThreadSchedulerTest, TestMicrotaskCheckpointTiming) {}

namespace {

class FrameSchedulerDelegateWithUkmSourceId : public FrameScheduler::Delegate {};

}  // namespace

class WorkerThreadSchedulerWithProxyTest : public testing::Test {};

TEST_F(WorkerThreadSchedulerWithProxyTest, UkmTaskRecording) {}

}  // namespace worker_thread_scheduler_unittest
}  // namespace scheduler
}  // namespace blink