Tests: Report view's test path instead of URL in test-web
Some checks are pending
CI / macOS, arm64, Sanitizer, Clang (push) Waiting to run
CI / Linux, x86_64, Fuzzers, Clang (push) Waiting to run
CI / Linux, x86_64, Sanitizer, GNU (push) Waiting to run
CI / Linux, x86_64, Sanitizer, Clang (push) Waiting to run
Package the js repl as a binary artifact / Linux, arm64 (push) Waiting to run
Package the js repl as a binary artifact / macOS, arm64 (push) Waiting to run
Package the js repl as a binary artifact / Linux, x86_64 (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run

When a test is active in a test-web view, show the relative path to the
test instead of the view's URL. This gives a better starting point for
debugging than whatever the last loaded URL happened to be.

If no test is active, we still show the view's URL.
This commit is contained in:
Jelle Raaijmakers 2025-08-26 23:10:12 +02:00 committed by Tim Flynn
commit f9888b0641
Notes: github-actions[bot] 2025-08-26 23:38:40 +00:00

View file

@ -803,14 +803,14 @@ static void handle_signal(int signal)
auto now = UnixDateTime::now(); auto now = UnixDateTime::now();
WebView::ViewImplementation::for_each_view([&](WebView::ViewImplementation const& view) { WebView::ViewImplementation::for_each_view([&](WebView::ViewImplementation const& view) {
dbg("- View {}: {} ", view.view_id(), view.url()); dbg("- View {}: ", view.view_id());
auto maybe_test = s_test_by_view.get(&view); auto maybe_test = s_test_by_view.get(&view);
if (maybe_test.has_value()) { if (maybe_test.has_value()) {
auto const& test = *maybe_test.release_value(); auto const& test = *maybe_test.release_value();
dbgln("(duration: {})", human_readable_time(now - test.start_time)); dbgln("{} (duration: {})", test.relative_path, human_readable_time(now - test.start_time));
} else { } else {
dbgln("(no active test)"); dbgln("{} (no active test)", view.url());
} }
return IterationDecision::Continue; return IterationDecision::Continue;