/* * Copyright (c) 2024-2025, Tim Flynn * Copyright (c) 2025, Jelle Raaijmakers * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include "Fuzzy.h" #include #include #include #include #include #include #include namespace TestWeb { enum class TestMode { Layout, Text, Ref, Crash, }; enum class TestResult { Pass, Fail, Skipped, Timeout, Crashed, }; enum class RefTestExpectationType { Match, Mismatch, }; struct Test { TestMode mode; ByteString input_path {}; ByteString expectation_path {}; ByteString relative_path {}; UnixDateTime start_time {}; UnixDateTime end_time {}; size_t index { 0 }; String text {}; bool did_finish_test { false }; bool did_finish_loading { false }; Optional ref_test_expectation_type {}; Vector fuzzy_matches {}; RefPtr actual_screenshot {}; RefPtr expectation_screenshot {}; }; struct TestCompletion { Test& test; TestResult result; }; using TestPromise = Core::Promise; }