chromium/third_party/blink/renderer/core/scheduler/scripted_idle_task_controller_test.cc

// Copyright 2017 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/core/scheduler/scripted_idle_task_controller.h"

#include "base/task/single_thread_task_runner.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/mojom/frame/lifecycle.mojom-blink.h"
#include "third_party/blink/public/platform/scheduler/web_agent_group_scheduler.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_idle_request_callback.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_idle_request_options.h"
#include "third_party/blink/renderer/core/testing/null_execution_context.h"
#include "third_party/blink/renderer/platform/scheduler/public/dummy_schedulers.h"
#include "third_party/blink/renderer/platform/scheduler/public/frame_scheduler.h"
#include "third_party/blink/renderer/platform/scheduler/public/page_scheduler.h"
#include "third_party/blink/renderer/platform/scheduler/public/thread_scheduler.h"
#include "third_party/blink/renderer/platform/scheduler/public/web_scheduling_task_queue.h"
#include "third_party/blink/renderer/platform/scheduler/test/fake_task_runner.h"
#include "third_party/blink/renderer/platform/testing/scoped_scheduler_overrider.h"
#include "third_party/blink/renderer/platform/testing/task_environment.h"

namespace blink {
namespace {

ShouldYield;

// A facade to a real DelayedTaskHandle instance that hooks CancelTask() call.
class DelayedTaskHandleDelegateFacade
    : public base::DelayedTaskHandle::Delegate {};

// A variant of `FakeTaskRunner` that counts the number of cancelled tasks.
class TestTaskRunner : public scheduler::FakeTaskRunner {};
class MockScriptedIdleTaskControllerScheduler final : public ThreadScheduler {};

class IdleTaskControllerFrameScheduler : public FrameScheduler {};

class MockIdleTask : public IdleTask {};
}  // namespace

TEST(ScriptedIdleTaskControllerTest, RunCallback) {}

TEST(ScriptedIdleTaskControllerTest, DontRunCallbackWhenAskedToYield) {}

TEST(ScriptedIdleTaskControllerTest, RunCallbacksAsyncWhenUnpaused) {}

TEST(ScriptedIdleTaskControllerTest, LongTimeoutShouldBeRemoveFromQueue) {}

TEST(ScriptedIdleTaskControllerTest, RunAfterSchedulerWasDeleted) {}

}  // namespace blink