chromium/components/unexportable_keys/background_long_task_scheduler_unittest.cc

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

#include "components/unexportable_keys/background_long_task_scheduler.h"

#include "base/cancelable_callback.h"
#include "base/functional/callback.h"
#include "base/functional/callback_helpers.h"
#include "base/memory/scoped_refptr.h"
#include "base/task/sequenced_task_runner.h"
#include "base/task/thread_pool.h"
#include "base/test/bind.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/task_environment.h"
#include "base/test/test_future.h"
#include "base/time/time.h"
#include "components/unexportable_keys/background_task_impl.h"
#include "components/unexportable_keys/background_task_priority.h"
#include "components/unexportable_keys/background_task_type.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace unexportable_keys {

namespace {

// Data shared between all tasks on the background thread.
struct BackgroundThreadData {};

// FakeTask returns how many tasks has been executed on the background thread
// including the current one, at the moment of the task running.
class FakeTask : public internal::BackgroundTaskImpl<size_t> {};

// Shortcut functions for converting a task priority and a task type to a
// histogram suffix.
std::string ToString(BackgroundTaskPriority priority) {}
std::string ToString(BackgroundTaskType type) {}

}  // namespace

class BackgroundLongTaskSchedulerTest : public testing::Test {};

TEST_F(BackgroundLongTaskSchedulerTest, PostTask) {}

TEST_F(BackgroundLongTaskSchedulerTest, PostTwoTasks) {}

TEST_F(BackgroundLongTaskSchedulerTest, PostTwoTasks_Sequentially) {}

TEST_F(BackgroundLongTaskSchedulerTest, TaskPriority) {}

TEST_F(BackgroundLongTaskSchedulerTest, CancelPendingTask) {}

TEST_F(BackgroundLongTaskSchedulerTest, CancelRunningTask) {}

TEST_F(BackgroundLongTaskSchedulerTest, DurationHistogram) {}

TEST_F(BackgroundLongTaskSchedulerTest, DurationHistogramWithCanceledTasks) {}

TEST_F(BackgroundLongTaskSchedulerTest, QueueWaitAndRunDurationHistograms) {}

}  // namespace unexportable_keys