summaryrefslogtreecommitdiff
path: root/Userland/Services/WebDriver/Session.cpp
AgeCommit message (Collapse)Author
2023-04-24AK: Add new failable `JsonArray::{append/set}` functionsCameron Youell
Move all old usages to the more explicit `JsonArray:must_{append/set}`
2023-03-23WebDriver: Unlink server socket before binding to itAliaksandr Kalenik
Previously, the create_server function would fail with an "Address already in use" error if a file that used for socket address is already exists.
2023-03-21WebDriver: Activate the browser tab during the Switch To Window commandTimothy Flynn
2023-03-19WebDriver: Fix handling of disconnected WebContent processAliaksandr Kalenik
If WebContent process got disconnected it is only necessary to remove associated window instead of terminating the entire session.
2023-03-19WebDriver: Close all WebContent connections while destroying a sessionAliaksandr Kalenik
While closing a session, it is necessary to close all windows that may have been opened during that session.
2023-03-19WebDriver: Inline `Sesssion::stop()` in session destructorAliaksandr Kalenik
Previously it was possible to have following sequence of calls while destroying a session: 1. `WebContentConnection::die()` calls `Client::close_session()` 2. `Client::close_session()` removes a session from active sessions map which causes session destructor call. 3. Session destructor calls `Client::close_session()` to remove a session from active sessions. With `stop()` method inlined into destructor `close_session()` need to be called just once while destroying a session.
2023-03-16WebContent+WebDriver: Get window handle from WebContent processAliaksandr Kalenik
This change makes window handles on WebDriver process side be consistent with handles returned by /window/new.
2023-03-13LibCore+Userland: Make Promise's on_resolve falliblekleines Filmröllchen
This will be primarily necessary for BackgroundAction integration, but it already allows us to add proper error handling in LibIMAP :^)
2023-03-13LibCore+Userland: Allow canceling promiseskleines Filmröllchen
To make EventLoop cancel its managed Promises, we need the ability to cancel them in the first place.
2023-03-07WebDriver: Remove active sessions from the close-the-session AOTimothy Flynn
These steps now have more than one caller; specifically, they may be called from the Delete Session and Close Window endpoints. The session was only removed from the active session map for the former endpoint. Instead, let's more accurately handle removing the session where the spec tells us to, so that all callers properly perform this step.
2023-03-07WebDriver: Defer removing closed window handles until no longer neededTimothy Flynn
WebDriver::Session::close_window may invoke Session::stop, which needs the WebContent connection to still exist. Do not remove the window's handle (thus destroying the connection) until it is no longer needed.
2023-03-07WebDriver: Do not ignore the result of closing a sessionTimothy Flynn
2023-03-07WebDriver: Keep WebDriver socket listening until session endAliaksandr Kalenik
WebDriver socket should not be closed as soon as first client got connected becaused there might more than one WebContent process spawned by browser.
2023-03-07WebContent+WebDriver: Move window commands handling back to WebDriverAliaksandr Kalenik
With current architecture every window has its own WebContent process and there is one WebDriver process that is responsible for talking to all opened windows. It thus make sense to manage open windows from WebDriver process instead of WebContent process that is not supposed to know about all other opened WebContent processes. This mostly reverts 826d5f8f9ab0e28606a0d07847056bd6562ebc49 but also adds `web_content_connection` to window structure and window id generation (currently out of spec). With these changes `get_window_handles`, `switch_to_window` and `close_window` start to actually switch, close and returned handles of currently opened windows.
2023-02-13LibCore: Remove `Stream.h`Tim Schumacher
2022-12-15WebDriver: Remove the WebContent socket file when closing the sessionTimothy Flynn
Otherwise it is left on disk forever.
2022-12-15WebDriver: Specify callbacks for clients to launch browser windowsTimothy Flynn
This moves the actual launching of browser windows to the WebDriver main file. This will allow Ladybird to specify its own callback and re-use Serenity's Session class.
2022-12-15WebContent+WebDriver: Move WebDriver socket to the standard runtime pathTimothy Flynn
This will allow Ladybird to use local socket files rather than passing around a bunch of socket FDs.
2022-12-06AK+Everywhere: Rename String to DeprecatedStringLinus Groh
We have a new, improved string type coming up in AK (OOM aware, no null state), and while it's going to use UTF-8, the name UTF8String is a mouthful - so let's free up the String name by renaming the existing class. Making the old one have an annoying name will hopefully also help with quick adoption :^)
2022-11-24LibWeb+WebDriver: Support running headless WebDriver sessionsTimothy Flynn
This adds an "extension capability" for clients to indicate that a headless browser should be used for the session.
2022-11-19Everywhere: Remove unnecessary mutable attributes from lambdasMacDue
These lambdas were marked mutable as they captured a Ptr wrapper class by value, which then only returned const-qualified references to the value they point from the previous const pointer operators. Nothing is actually mutating in the lambdas state here, and now that the Ptr operators don't add extra const qualifiers these can be removed.
2022-11-14WebContent+WebDriver: Move Window commands to WebContentTimothy Flynn
This moves Get Window Handle, Close Window, and Get Window Handles over to WebContent so they may be implemented closer to the spec and be used by Ladybird.
2022-11-13WebDriver: Implement Close Window closer to the specTimothy Flynn
We are expected to return the list of open handles after closing the current handle. Also just return a WebDriver::Response instead of a wrapped Error variant.
2022-11-11WebContent+WebDriver: Move Get/Set Timeouts to WebContentTimothy Flynn
2022-11-11LibWeb+WebDriver: Move the timeouts configuration object to LibWebTimothy Flynn
2022-11-11Browser+WebDriver: Remove the connection between Browser and WebDriverTimothy Flynn
WebDriver now only has an IPC connection to WebContent. WebDriver still launches the browser, but now when the session ends, we simply send a SIGTERM signal to the browser.
2022-11-11Browser+WebDriver: Add missing header includesTimothy Flynn
These are currently being included transitively, and will cause an error when those intermediate includes are removed.
2022-11-11Browser+WebContent+WebDriver: Move Get Title to WebContentTimothy Flynn
2022-11-11Browser+WebContent+WebDriver: Move Back, Forward, Refresh to WebContentTimothy Flynn
2022-11-11Browser+WebContent+WebDriver: Move Delete All Cookies to WebContentTimothy Flynn
2022-11-11Browser+WebContent+WebDriver: Move Delete Cookie to WebContentTimothy Flynn
2022-11-11Browser+WebContent+WebDriver: Move Add Cookie to WebContentTimothy Flynn
The new implementation is made a bit simpler by way of TRY. It also implements setting the SameSite attribute.
2022-11-11Browser+WebContent+WebDriver: Move Get Named Cookie to WebContentTimothy Flynn
Instead of sending *all* cookies over IPC and filtering by name, we now filter by name from the cookie jar and send just the first matching cookie.
2022-11-11Browser+WebContent+WebDriver: Move Get All Cookies to WebContentTimothy Flynn
There are a couple changes here from the existing Get All Cookies implementation. 1. Previously, WebDriver actually returned *all* cookies in the cookie jar. The spec dictates that we only return cookies that match the document's URL. Specifically, it calls out that we must run just the first step of RFC 6265 section 5.4 to perform domain matching. This change adds a special mode to our implementation of that section to skip the remaining steps. 2. We now fill in the SameSite cookie attribute when serializing the cookie to JSON (this was a trival FIXME that didn't get picked up when SameSite was implemented).
2022-11-11Browser+WebContent+WebDriver: Move Execute Async Script to WebContentTimothy Flynn
With this, WebDriverEndpoints is unused and removed :^)
2022-11-11WebContent+WebDriver: Move Execute Script to WebContentTimothy Flynn
2022-11-11Browser+WebContent+WebDriver: Move Get Page Source to WebContentTimothy Flynn
2022-11-11Browser+WebContent+WebDriver: Move Take Element Screenshot to WebContentTimothy Flynn
2022-11-11Browser+WebContent+WebDriver: Move Take Screenshot to WebContentTimothy Flynn
2022-11-10Browser+WebContent+WebDriver: Move Is Element Enabled to WebContentTimothy Flynn
2022-11-10Browser+WebContent+WebDriver: Move Get Element Rect to WebContentTimothy Flynn
2022-11-10Browser+WebContent+WebDriver: Move Get Element Tag Name to WebContentTimothy Flynn
2022-11-10Browser+WebContent+WebDriver: Move Get Element Text to WebContentTimothy Flynn
2022-11-10Browser+WebContent+WebDriver: Move Get Element CSS Value to WebContentTimothy Flynn
2022-11-10Browser+WebContent+WebDriver: Move Get Element Property to WebContentTimothy Flynn
2022-11-10Browser+WebContent+WebDriver: Move Get Element Attribute to WebContentTimothy Flynn
In doing so, this also implements a FIXME to handle boolean attributes.
2022-11-10Browser+WebContent+WebDriver: Move Is Element Selected to WebContentTimothy Flynn
2022-11-10Browser+WebContent+WebDriver: Move Find Elements From Element to WCTimothy Flynn
This also lets us remove the element location strategy and some WebContent IPC from Browser/LibWebView now that they are unused.
2022-11-10WebContent+WebDriver: Move Find Element From Element to WebContentTimothy Flynn
2022-11-10WebContent+WebDriver: Move Find Elements to WebContentTimothy Flynn