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:
Sam Atkins 2024-12-19 14:16:05 +00:00
commit be6a9940ad
Notes: github-actions[bot] 2024-12-19 17:28:47 +00:00
11 changed files with 42 additions and 0 deletions

View file

@ -108,6 +108,7 @@ private:
virtual void did_request_select_dropdown(u64 page_id, Gfx::IntPoint content_position, i32 minimum_width, Vector<Web::HTML::SelectItem> const& items) override;
virtual void did_finish_handling_input_event(u64 page_id, Web::EventResult event_result) override;
virtual void did_finish_text_test(u64 page_id, String const& text) override;
virtual void did_set_test_timeout(u64 page_id, double milliseconds) override;
virtual void did_find_in_page(u64 page_id, size_t current_match_index, Optional<size_t> const& total_match_count) override;
virtual void did_change_theme_color(u64 page_id, Gfx::Color color) override;
virtual void did_insert_clipboard_entry(u64 page_id, String const& data, String const& presentation_style, String const& mime_type) override;