#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;
enum class ResponseDelay { … };
base::TimeDelta GetResponseDelayDelta(ResponseDelay delay) { … }
}
class CpuProbeManagerTest : public ::testing::TestWithParam<ResponseDelay> { … };
CpuProbeManagerDeathTest;
CpuProbeManagerDelayedResponseTest;
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) { … }
}