1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 10:37:34 +00:00

LibWeb: Add --layout-test-mode flag to HeadlessBrowser

The `layout-test-mode` flag changes the font to be SerenitySans as this
is the font used for layout tests for cross-platform compatibility of
tests.
This commit is contained in:
martinfalisse 2023-05-06 12:46:14 +02:00 committed by Andreas Kling
parent af26b76e0a
commit c719a542c5
6 changed files with 27 additions and 8 deletions

View file

@ -63,14 +63,16 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
Web::FrameLoader::set_default_favicon_path(DeprecatedString::formatted("{}/res/icons/16x16/app-browser.png", s_serenity_resource_root));
int webcontent_fd_passing_socket { -1 };
bool is_layout_test_mode = false;
Core::ArgsParser args_parser;
args_parser.add_option(webcontent_fd_passing_socket, "File descriptor of the passing socket for the WebContent connection", "webcontent-fd-passing-socket", 'c', "webcontent_fd_passing_socket");
args_parser.add_option(is_layout_test_mode, "Is layout test mode", "layout-test-mode", 0);
args_parser.parse(arguments);
VERIFY(webcontent_fd_passing_socket >= 0);
Web::Platform::FontPlugin::install(*new Ladybird::FontPluginQt);
Web::Platform::FontPlugin::install(*new Ladybird::FontPluginQt(is_layout_test_mode));
Web::FrameLoader::set_error_page_url(DeprecatedString::formatted("file://{}/res/html/error.html", s_serenity_resource_root));