From c55d40e84bdf966b903abba04977268ee990bebe Mon Sep 17 00:00:00 2001 From: Tim Ledbetter Date: Sun, 29 Dec 2024 00:29:26 +0000 Subject: [PATCH] UI/Headless: Ignore more WPT support files We now ignore files imported from WPT, if they are in the root `common` directory, or any directory named `resources`. This matches the behavior of the WPT test harness. --- UI/Headless/Test.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/UI/Headless/Test.cpp b/UI/Headless/Test.cpp index ef25bee5807..9aef450735f 100644 --- a/UI/Headless/Test.cpp +++ b/UI/Headless/Test.cpp @@ -428,7 +428,12 @@ ErrorOr run_tests(Core::AnonymousBuffer const& theme, Web::DevicePixelSize #endif tests.remove_all_matching([&](auto const& test) { - bool is_support_file = test.input_path.matches("*/wpt-import/*/support/*"sv); + static constexpr Array support_file_patterns { + "*/wpt-import/*/support/*"sv, + "*/wpt-import/*/resources/*"sv, + "*/wpt-import/common/*"sv, + }; + bool is_support_file = any_of(support_file_patterns, [&](auto pattern) { return test.input_path.matches(pattern); }); bool match_glob = test.input_path.matches(test_glob, CaseSensitivity::CaseSensitive); return is_support_file || !match_glob; });