mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +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:
@@ -366,6 +366,11 @@ void PageClient::page_did_finish_text_test(String const& text)
|
||||
client().async_did_finish_text_test(m_id, text);
|
||||
}
|
||||
|
||||
void PageClient::page_did_set_test_timeout(double milliseconds)
|
||||
{
|
||||
client().async_did_set_test_timeout(m_id, milliseconds);
|
||||
}
|
||||
|
||||
void PageClient::page_did_request_context_menu(Web::CSSPixelPoint content_position)
|
||||
{
|
||||
client().async_did_request_context_menu(m_id, page().css_to_device_point(content_position).to_type<int>());
|
||||
|
||||
@@ -158,6 +158,7 @@ private:
|
||||
virtual void page_did_request_file_picker(Web::HTML::FileFilter accepted_file_types, Web::HTML::AllowMultipleFiles) override;
|
||||
virtual void page_did_request_select_dropdown(Web::CSSPixelPoint content_position, Web::CSSPixels minimum_width, Vector<Web::HTML::SelectItem> items) override;
|
||||
virtual void page_did_finish_text_test(String const& text) override;
|
||||
virtual void page_did_set_test_timeout(double milliseconds) override;
|
||||
virtual void page_did_change_theme_color(Gfx::Color color) override;
|
||||
virtual void page_did_insert_clipboard_entry(String data, String presentation_style, String mime_type) override;
|
||||
virtual void page_did_change_audio_play_state(Web::HTML::AudioPlayState) override;
|
||||
|
||||
@@ -95,6 +95,7 @@ endpoint WebContentClient
|
||||
did_get_js_console_messages(u64 page_id, i32 start_index, Vector<ByteString> message_types, Vector<ByteString> messages) =|
|
||||
|
||||
did_finish_text_test(u64 page_id, String text) =|
|
||||
did_set_test_timeout(u64 page_id, double milliseconds) =|
|
||||
|
||||
did_find_in_page(u64 page_id, size_t current_match_index, Optional<size_t> total_match_count) =|
|
||||
|
||||
|
||||
Reference in New Issue
Block a user