mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-21 18:00:16 +00:00
LibWeb+WebContent+WebDriver: Bring session start and close up to spec
Lots of editorial spec bugs here, but these changes largely affect how the unhandledPromptBehavior capability is handled. We also now set an additional capability for the default User Agent string.
This commit is contained in:
parent
2583996e18
commit
ee649fc13b
Notes:
github-actions[bot]
2025-02-06 14:02:15 +00:00
Author: https://github.com/trflynn89
Commit: ee649fc13b
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3471
Reviewed-by: https://github.com/AtkinsSJ
9 changed files with 290 additions and 131 deletions
|
@ -29,11 +29,9 @@ struct LaunchBrowserCallbacks;
|
|||
|
||||
class Session : public RefCounted<Session> {
|
||||
public:
|
||||
Session(String session_id, NonnullRefPtr<Client> client, Web::WebDriver::LadybirdOptions options);
|
||||
static ErrorOr<NonnullRefPtr<Session>> create(NonnullRefPtr<Client> client, JsonObject& capabilities, ReadonlySpan<StringView> flags);
|
||||
~Session();
|
||||
|
||||
void initialize_from_capabilities(JsonObject&);
|
||||
|
||||
String session_id() const { return m_id; }
|
||||
|
||||
struct Window {
|
||||
|
@ -56,8 +54,6 @@ public:
|
|||
|
||||
bool has_window_handle(StringView handle) const { return m_windows.contains(handle); }
|
||||
|
||||
ErrorOr<void> start(LaunchBrowserCallbacks const&);
|
||||
|
||||
Web::WebDriver::Response set_timeouts(JsonValue);
|
||||
Web::WebDriver::Response close_window();
|
||||
Web::WebDriver::Response switch_to_window(StringView);
|
||||
|
@ -83,6 +79,10 @@ public:
|
|||
}
|
||||
|
||||
private:
|
||||
Session(NonnullRefPtr<Client> client, JsonObject const& capabilities, String session_id, bool http);
|
||||
|
||||
ErrorOr<void> start(LaunchBrowserCallbacks const&);
|
||||
|
||||
using ServerPromise = Core::Promise<ErrorOr<void>>;
|
||||
ErrorOr<NonnullRefPtr<Core::LocalServer>> create_server(NonnullRefPtr<ServerPromise> promise);
|
||||
|
||||
|
@ -90,7 +90,9 @@ private:
|
|||
Web::WebDriver::LadybirdOptions m_options;
|
||||
|
||||
bool m_started { false };
|
||||
|
||||
String m_id;
|
||||
bool m_http { false };
|
||||
|
||||
HashMap<String, Window> m_windows;
|
||||
String m_current_window_handle;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue