chromium/services/device/compute_pressure/cpu_probe_manager_unittest.cc

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

#include "services/device/compute_pressure/cpu_probe_manager.h"

#include <cstddef>
#include <memory>
#include <optional>
#include <utility>

#include "base/check_op.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/functional/callback_helpers.h"
#include "base/sequence_checker.h"
#include "base/test/bind.h"
#include "base/test/gtest_util.h"
#include "base/test/task_environment.h"
#include "base/test/test_timeouts.h"
#include "base/thread_annotations.h"
#include "base/time/time.h"
#include "components/system_cpu/pressure_test_support.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace device {

namespace {

CpuSample;
FakeCpuProbe;
StreamingCpuProbe;

// Different amounts of delay to insert to test interactions between responses
// to subsequent RequestSample() calls.
enum class ResponseDelay {};

base::TimeDelta GetResponseDelayDelta(ResponseDelay delay) {}

}  // namespace

class CpuProbeManagerTest : public ::testing::TestWithParam<ResponseDelay> {};

CpuProbeManagerDeathTest;
CpuProbeManagerDelayedResponseTest;

// Most tests won't include a response delay.
INSTANTIATE_TEST_SUITE_P();

INSTANTIATE_TEST_SUITE_P();

INSTANTIATE_TEST_SUITE_P();

TEST_P(CpuProbeManagerTest, CreateCpuProbeExists) {}

TEST_P(CpuProbeManagerTest, EnsureStarted) {}

TEST_P(CpuProbeManagerTest, EnsureStartedSkipsFirstSample) {}

TEST_P(CpuProbeManagerDeathTest, CalculateStateValueTooLarge) {}

TEST_P(CpuProbeManagerTest, EnsureStartedCheckBreakCalibrationMitigation) {}

TEST_P(CpuProbeManagerTest, EnsureStartedCheckCalculateStateHysteresisUp) {}

TEST_P(CpuProbeManagerTest, EnsureStartedCheckCalculateStateHysteresisDown) {}

TEST_P(CpuProbeManagerTest,
       EnsureStartedCheckCalculateStateHysteresisDownByDelta) {}

TEST_P(CpuProbeManagerTest,
       EnsureStartedCheckCalculateStateHysteresisDownByDeltaTwoState) {}

TEST_P(CpuProbeManagerTest,
       EnsureStartedCheckCalculateStateHysteresisUpByDelta) {}

TEST_P(CpuProbeManagerDelayedResponseTest, StopDelayedEnsureStartedImmediate) {}

TEST_P(CpuProbeManagerDelayedResponseTest, StopDelayedEnsureStartedDelayed) {}

TEST_P(CpuProbeManagerDelayedResponseTest,
       StopImmediateEnsureStartedImmediate) {}

TEST_P(CpuProbeManagerDelayedResponseTest, StopImmediateEnsureStartedDelayed) {}

TEST_P(CpuProbeManagerDelayedResponseTest, StopEnsureStartedNoRace) {}

}  // namespace device