#ifndef CONTENT_PUBLIC_TEST_PRELOADING_TEST_UTIL_H_
#define CONTENT_PUBLIC_TEST_PRELOADING_TEST_UTIL_H_
#include <vector>
#include "base/memory/raw_ptr.h"
#include "components/ukm/test_ukm_recorder.h"
#include "content/public/browser/preloading.h"
#include "content/public/browser/preloading_data.h"
#include "services/metrics/public/cpp/ukm_source_id.h"
#include "third_party/blink/public/mojom/speculation_rules/speculation_rules.mojom-shared.h"
namespace content {
class PreloadingConfig;
namespace test {
extern const std::vector<std::string> kPreloadingAttemptUkmMetrics;
extern const std::vector<std::string> kPreloadingPredictionUkmMetrics;
class PreloadingAttemptUkmEntryBuilder { … };
class PreloadingPredictionUkmEntryBuilder { … };
void ExpectPreloadingAttemptUkm(
ukm::TestAutoSetUkmRecorder& ukm_recorder,
const std::vector<ukm::TestUkmRecorder::HumanReadableUkmEntry>&
expected_attempt_entries);
void ExpectPreloadingPredictionUkm(
ukm::TestAutoSetUkmRecorder& ukm_recorder,
const std::vector<ukm::TestUkmRecorder::HumanReadableUkmEntry>&
expected_prediction_entries);
std::string UkmEntryToString(
const ukm::TestUkmRecorder::HumanReadableUkmEntry& entry);
std::string ActualVsExpectedUkmEntryToString(
const ukm::TestUkmRecorder::HumanReadableUkmEntry& actual,
const ukm::TestUkmRecorder::HumanReadableUkmEntry& expected);
std::string ActualVsExpectedUkmEntriesToString(
const std::vector<ukm::TestUkmRecorder::HumanReadableUkmEntry>& actual,
const std::vector<ukm::TestUkmRecorder::HumanReadableUkmEntry>& expected);
class PreloadingAttemptAccessor { … };
class PreloadingConfigOverride { … };
void SetHasSpeculationRulesPrerender(PreloadingData* preloading_data);
}
}
#endif