mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-11 18:50:50 +00:00
headless-browser: Do not log the inner text of crash tests
This re-implements 533c8e910a
without
breaking the ability to dump layout trees.
This commit is contained in:
parent
1aa009b0cf
commit
cf523137ad
Notes:
github-actions[bot]
2025-03-02 16:50:40 +00:00
Author: https://github.com/trflynn89
Commit: cf523137ad
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3769
1 changed files with 10 additions and 2 deletions
|
@ -147,7 +147,8 @@ void run_dump_test(HeadlessWebView& view, Test& test, URL::URL const& url, int t
|
|||
|
||||
auto handle_completed_test = [&test, url]() -> ErrorOr<TestResult> {
|
||||
if (test.expectation_path.is_empty()) {
|
||||
outln("{}", test.text);
|
||||
if (test.mode != TestMode::Crash)
|
||||
outln("{}", test.text);
|
||||
return TestResult::Pass;
|
||||
}
|
||||
|
||||
|
@ -234,7 +235,7 @@ void run_dump_test(HeadlessWebView& view, Test& test, URL::URL const& url, int t
|
|||
});
|
||||
});
|
||||
};
|
||||
} else if (test.mode == TestMode::Text || test.mode == TestMode::Crash) {
|
||||
} else if (test.mode == TestMode::Text) {
|
||||
view.on_load_finish = [&view, &test, on_test_complete, url](auto const& loaded_url) {
|
||||
// We don't want subframe loads to trigger the test finish.
|
||||
if (!url.equals(loaded_url, URL::ExcludeFragment::Yes))
|
||||
|
@ -261,6 +262,13 @@ void run_dump_test(HeadlessWebView& view, Test& test, URL::URL const& url, int t
|
|||
if (test.did_finish_loading)
|
||||
on_test_complete();
|
||||
};
|
||||
} else if (test.mode == TestMode::Crash) {
|
||||
view.on_load_finish = [on_test_complete = move(on_test_complete), url](auto const& loaded_url) {
|
||||
// We don't want subframe loads to trigger the test finish.
|
||||
if (!url.equals(loaded_url, URL::ExcludeFragment::Yes))
|
||||
return;
|
||||
on_test_complete();
|
||||
};
|
||||
}
|
||||
|
||||
view.on_set_test_timeout = [timer, timeout_in_milliseconds](double milliseconds) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue