blob: 11fe5377e5573719ca62852637744e3540ed2279 [file] [log] [blame]
// Copyright 2020 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef DIAGNOSTICS_CROS_HEALTHD_FAKE_FAKE_ROUTINE_SERVICE_H_
#define DIAGNOSTICS_CROS_HEALTHD_FAKE_FAKE_ROUTINE_SERVICE_H_
#include <cstdint>
#include <string>
#include <base/optional.h>
#include "mojo/cros_healthd.mojom.h"
namespace diagnostics {
// Fake implementation of the CrosHealthdDiagnosticsService interface.
class FakeRoutineService final
: public chromeos::cros_healthd::mojom::CrosHealthdDiagnosticsService {
public:
using DiagnosticRoutineStatusEnum =
chromeos::cros_healthd::mojom::DiagnosticRoutineStatusEnum;
using RunRoutineResponse = chromeos::cros_healthd::mojom::RunRoutineResponse;
FakeRoutineService();
FakeRoutineService(const FakeRoutineService&) = delete;
FakeRoutineService& operator=(const FakeRoutineService&) = delete;
~FakeRoutineService() override;
// chromeos::cros_healthd::mojom::CrosHealthdDiagnosticsService overrides:
void GetAvailableRoutines(GetAvailableRoutinesCallback callback) override;
void GetRoutineUpdate(
int32_t id,
chromeos::cros_healthd::mojom::DiagnosticRoutineCommandEnum command,
bool include_output,
GetRoutineUpdateCallback callback) override;
void RunUrandomRoutine(uint32_t length_seconds,
RunUrandomRoutineCallback callback) override;
void RunBatteryCapacityRoutine(
uint32_t low_mah,
uint32_t high_mah,
RunBatteryCapacityRoutineCallback callback) override;
void RunBatteryHealthRoutine(
uint32_t maximum_cycle_count,
uint32_t percent_battery_wear_allowed,
RunBatteryHealthRoutineCallback callback) override;
void RunSmartctlCheckRoutine(
RunSmartctlCheckRoutineCallback callback) override;
void RunAcPowerRoutine(
chromeos::cros_healthd::mojom::AcPowerStatusEnum expected_status,
const base::Optional<std::string>& expected_power_type,
RunAcPowerRoutineCallback callback) override;
void RunCpuCacheRoutine(uint32_t length_seconds,
RunCpuCacheRoutineCallback callback) override;
void RunCpuStressRoutine(uint32_t length_seconds,
RunCpuStressRoutineCallback callback) override;
void RunFloatingPointAccuracyRoutine(
uint32_t length_seconds,
RunFloatingPointAccuracyRoutineCallback callback) override;
void RunNvmeWearLevelRoutine(
uint32_t wear_level_threshold,
RunNvmeWearLevelRoutineCallback callback) override;
void RunNvmeSelfTestRoutine(
chromeos::cros_healthd::mojom::NvmeSelfTestTypeEnum nvme_self_test_type,
RunNvmeSelfTestRoutineCallback callback) override;
void RunDiskReadRoutine(
chromeos::cros_healthd::mojom::DiskReadRoutineTypeEnum type,
uint32_t length_seconds,
uint32_t file_size_mb,
RunDiskReadRoutineCallback callback) override;
void RunPrimeSearchRoutine(uint32_t length_seconds,
uint64_t max_num,
RunPrimeSearchRoutineCallback callback) override;
void RunBatteryDischargeRoutine(
uint32_t length_seconds,
uint32_t maximum_discharge_percent_allowed,
RunBatteryDischargeRoutineCallback callback) override;
};
} // namespace diagnostics
#endif // DIAGNOSTICS_CROS_HEALTHD_FAKE_FAKE_ROUTINE_SERVICE_H_