mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-24 16:40:21 +00:00
UI: Set headless-browser width and height
This commit is contained in:
parent
1e54003cb1
commit
ce56bc29e2
Notes:
github-actions[bot]
2024-11-13 21:53:34 +00:00
Author: https://github.com/shlyakpavel Commit: https://github.com/LadybirdBrowser/ladybird/commit/ce56bc29e29 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2323 Reviewed-by: https://github.com/AtkinsSJ
3 changed files with 5 additions and 2 deletions
|
@ -46,6 +46,8 @@ void Application::create_platform_arguments(Core::ArgsParser& args_parser)
|
|||
args_parser.add_option(rebaseline, "Rebaseline any executed layout or text tests", "rebaseline");
|
||||
args_parser.add_option(per_test_timeout_in_seconds, "Per-test timeout (default: 30)", "per-test-timeout", 't', "seconds");
|
||||
args_parser.add_option(verbose, "Log extra information about test results", "verbose", 'v');
|
||||
args_parser.add_option(width, "Set viewport width in pixels (default: 800)", "width", 'W', "pixels");
|
||||
args_parser.add_option(height, "Set viewport height in pixels (default: 600)", "height", 'H', "pixels");
|
||||
}
|
||||
|
||||
void Application::create_platform_options(WebView::ChromeOptions& chrome_options, WebView::WebContentOptions& web_content_options)
|
||||
|
|
|
@ -66,6 +66,8 @@ public:
|
|||
bool rebaseline { false };
|
||||
bool verbose { false };
|
||||
int per_test_timeout_in_seconds { 30 };
|
||||
int width { 800 };
|
||||
int height { 600 };
|
||||
|
||||
private:
|
||||
RefPtr<Requests::RequestClient> m_request_client;
|
||||
|
|
|
@ -71,8 +71,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
auto theme_path = LexicalPath::join(app->resources_folder, "themes"sv, "Default.ini"sv);
|
||||
auto theme = TRY(Gfx::load_system_theme(theme_path.string()));
|
||||
|
||||
// FIXME: Allow passing the window size as an argument.
|
||||
static constexpr Web::DevicePixelSize window_size { 800, 600 };
|
||||
static Web::DevicePixelSize window_size { app->width, app->height };
|
||||
|
||||
if (!app->test_root_path.is_empty()) {
|
||||
app->test_root_path = LexicalPath::absolute_path(TRY(FileSystem::current_working_directory()), app->test_root_path);
|
||||
|
|
Loading…
Reference in a new issue