1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:38:11 +00:00

Ladybird/WebDriver: Support running headless WebDriver sessions

This adds a dependency from WebDriver to Lagom's headless-browser to be
used if the client's required capabilities indicate to do so.
This commit is contained in:
Timothy Flynn 2022-11-22 08:09:55 -05:00 committed by Andrew Kaster
parent 69cd0d6599
commit a1e380cc38
5 changed files with 46 additions and 11 deletions

View file

@ -29,6 +29,7 @@
#include <QSocketNotifier>
#include <QTimer>
#include <WebContent/ConnectionFromClient.h>
#include <WebContent/PageHost.h>
#include <WebContent/WebDriverConnection.h>
static ErrorOr<void> load_content_filters();
@ -103,7 +104,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
QSocketNotifier webdriver_notifier(QSocketNotifier::Type::Read);
RefPtr<WebContent::WebDriverConnection> webdriver_client;
if (webdriver_fd_passing_socket >= 0)
webdriver_client = TRY(create_connection_from_passed_socket<WebContent::WebDriverConnection>(webdriver_fd_passing_socket, "WebDriver"sv, webdriver_notifier, *webcontent_client, webcontent_client->page_host()));
webdriver_client = TRY(create_connection_from_passed_socket<WebContent::WebDriverConnection>(webdriver_fd_passing_socket, "WebDriver"sv, webdriver_notifier, webcontent_client->page_host()));
return app.exec();
}