From f3a0e06235d2d84bb0f3b5014da4370613886965 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Thu, 19 Dec 2024 16:17:16 -0800 Subject: [PATCH] Use WPT version of test harness for HTML core test conversion (#1859) When converting tests to HTML for use in WPT, use the path to the test harness in WPT's resources/ directory. This is also important because the WPT test runner users this path inclusion to discover the tests. There are several more things I want to simplify here but I'm starting with just this because it matches the sed transform that @past originally wrote in https://github.com/web-platform-tests/wpt/pull/49277 --- test/build.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/build.py b/test/build.py index 94e7304dbf..6c10578385 100755 --- a/test/build.py +++ b/test/build.py @@ -165,9 +165,10 @@ def build_html_from_js(tests, html_dir, use_sync): html_file = os.path.join(html_dir, subdir, html_filename) js_harness = "sync_index.js" if use_sync else "async_index.js" harness_dir = os.path.join(js_prefix, 'harness') + with open(html_file, 'w+') as f: content = HTML_HEADER.replace('{PREFIX}', harness_dir) \ - .replace('{WPT_PREFIX}', harness_dir) \ + .replace('{WPT_PREFIX}', '/resources') \ .replace('{JS_HARNESS}', js_harness) content += ' ' content += HTML_BOTTOM