// Copyright Epic Games, Inc. All Rights Reserved. #pragma once #include "Installer/Verifier.h" #include "Common/StatsCollector.h" #if WITH_DEV_AUTOMATION_TESTS namespace BuildPatchServices { class FMockVerifierStat : public IVerifierStat { public: typedef TTuple FOnFileStarted; typedef TTuple FOnFileProgress; typedef TTuple FOnFileCompleted; typedef TTuple FOnFileRead; typedef TTuple FOnProcessedDataUpdated; typedef TTuple FOnTotalRequiredUpdated; public: virtual void OnFileStarted(const FString& Filename, int64 FileSize) override { RxOnFileStarted.Emplace(FStatsCollector::GetSeconds(), Filename, FileSize); } virtual void OnFileProgress(const FString& Filename, int64 TotalBytes) override { if (OnFileProgressFunc) { OnFileProgressFunc(Filename, TotalBytes); } RxOnFileProgress.Emplace(FStatsCollector::GetSeconds(), Filename, TotalBytes); } virtual void OnFileCompleted(const FString& Filename, EVerifyResult VerifyResult) override { if (OnFileCompletedFunc) { OnFileCompletedFunc(Filename, VerifyResult); } RxOnFileCompleted.Emplace(FStatsCollector::GetSeconds(), Filename, VerifyResult); } virtual void OnFileRead(const ISpeedRecorder::FRecord& Record) override { RxOnFileRead.Emplace(FStatsCollector::GetSeconds(), Record); } virtual void OnProcessedDataUpdated(int64 TotalBytes) override { RxOnProcessedDataUpdated.Emplace(FStatsCollector::GetSeconds(), TotalBytes); } virtual void OnTotalRequiredUpdated(int64 TotalBytes) override { RxOnTotalRequiredUpdated.Emplace(FStatsCollector::GetSeconds(), TotalBytes); } public: TArray RxOnFileStarted; TArray RxOnFileProgress; TArray RxOnFileCompleted; TArray RxOnFileRead; TArray RxOnProcessedDataUpdated; TArray RxOnTotalRequiredUpdated; TFunction OnFileProgressFunc; TFunction OnFileCompletedFunc; }; } #endif //WITH_DEV_AUTOMATION_TESTS