mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 11:49:44 +00:00
test-web: Wait longer before completing crash tests
Previously, a lot of imported WPT crash tests wouldn't wait long enough for a crash to occur.
This commit is contained in:
parent
eed47acb1f
commit
e1f0284fba
Notes:
github-actions[bot]
2025-07-14 17:06:40 +00:00
Author: https://github.com/tcl3
Commit: e1f0284fba
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5439
Reviewed-by: https://github.com/trflynn89
1 changed files with 21 additions and 2 deletions
|
@ -285,11 +285,30 @@ static void run_dump_test(TestWebView& view, Test& test, URL::URL const& url, in
|
|||
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) {
|
||||
view.on_load_finish = [on_test_complete, url, &view, &test](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();
|
||||
test.did_finish_loading = true;
|
||||
static String wait_for_crash_test_completion = R"(
|
||||
document.fonts.ready.then(() => {
|
||||
requestAnimationFrame(function() {
|
||||
requestAnimationFrame(function() {
|
||||
internals.signalTestIsDone("PASS");
|
||||
});
|
||||
});
|
||||
});
|
||||
)"_string;
|
||||
view.run_javascript(wait_for_crash_test_completion);
|
||||
if (test.did_finish_test)
|
||||
on_test_complete();
|
||||
};
|
||||
|
||||
view.on_test_finish = [&test, on_test_complete](auto const&) {
|
||||
test.did_finish_test = true;
|
||||
|
||||
if (test.did_finish_loading)
|
||||
on_test_complete();
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue