mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-25 19:04:58 +00:00
headless-browser: Let tests set their own timeout duration
Some tests take longer than others, and so may want to set a custom timeout so that they pass, without increasing the timeout for all other tests. For example, this is done in WPT. Add an `internals.setTestTimeout(milliseconds)` method that overrides the test runner's default timeout for the currently-run test.
This commit is contained in:
@@ -93,6 +93,14 @@ void WebContentClient::did_finish_text_test(u64 page_id, String const& text)
|
||||
}
|
||||
}
|
||||
|
||||
void WebContentClient::did_set_test_timeout(u64 page_id, double milliseconds)
|
||||
{
|
||||
if (auto view = view_for_page_id(page_id); view.has_value()) {
|
||||
if (view->on_set_test_timeout)
|
||||
view->on_set_test_timeout(milliseconds);
|
||||
}
|
||||
}
|
||||
|
||||
void WebContentClient::did_find_in_page(u64 page_id, size_t current_match_index, Optional<size_t> const& total_match_count)
|
||||
{
|
||||
if (auto view = view_for_page_id(page_id); view.has_value()) {
|
||||
|
||||
Reference in New Issue
Block a user