headless-browser: Call platform_init() for path of resources folder

For `AK_OS_SERENITY`, the root path of the resources folder is "/res";
but otherwise it should be the `s_serenity_resource_root` variable set
in `platform_init()`.

However, a path provided on the command line, will override the default
path in both of those cases.

This change also makes sure that `RequestServer` can find the
certificates file `serenity/Build/lagom/share/Lagom/ladybird/cacert.pem`
This commit is contained in:
ronak69 2024-04-22 14:32:02 +00:00 committed by Andreas Kling
parent 49e09507d7
commit b25d220a2c
Notes: sideshowbarker 2024-07-17 07:31:31 +09:00

View File

@ -675,6 +675,11 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
ByteString test_glob;
Vector<ByteString> certificates;
#if !defined(AK_OS_SERENITY)
platform_init();
resources_folder = s_serenity_resource_root;
#endif
Core::ArgsParser args_parser;
args_parser.set_general_help("This utility runs the Browser in headless mode.");
args_parser.add_option(screenshot_timeout, "Take a screenshot after [n] seconds (default: 1)", "screenshot", 's', "n");