mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 15:07:45 +00:00
WebDriver: Add new WebDriver service
WebDriver aims to implement the WebDriver specification found at https://w3c.github.io/webdriver/webdriver-spec.html . It's an HTTP server that can create Browser sessions and control them. Co-authored-by: Florent Castelli <florent.castelli@gmail.com>
This commit is contained in:
parent
8c0f1da9f7
commit
80603f141a
12 changed files with 915 additions and 0 deletions
26
Userland/Services/WebDriver/BrowserConnection.cpp
Normal file
26
Userland/Services/WebDriver/BrowserConnection.cpp
Normal file
|
@ -0,0 +1,26 @@
|
|||
/*
|
||||
* Copyright (c) 2022, Florent Castelli <florent.castelli@gmail.com>
|
||||
* Copyright (c) 2022, Sam Atkins <atkinssj@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include "BrowserConnection.h"
|
||||
#include "Client.h"
|
||||
|
||||
namespace WebDriver {
|
||||
|
||||
BrowserConnection::BrowserConnection(NonnullOwnPtr<Core::Stream::LocalSocket> socket, NonnullRefPtr<Client> client, unsigned session_id)
|
||||
: IPC::ConnectionFromClient<WebDriverSessionClientEndpoint, WebDriverSessionServerEndpoint>(*this, move(socket), 1)
|
||||
, m_client(move(client))
|
||||
, m_session_id(session_id)
|
||||
{
|
||||
}
|
||||
|
||||
void BrowserConnection::die()
|
||||
{
|
||||
dbgln_if(WEBDRIVER_DEBUG, "Session {} was closed remotely. Shutting down...", m_session_id);
|
||||
m_client->close_session(m_session_id);
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue