LibWeb+WebDriver: Convert WebDriver session flags to an enumeration

Rather than a list of strings, this will be easier to deal with as a
bitwise enumeration.
This commit is contained in:
Timothy Flynn 2025-02-07 11:09:28 -05:00 committed by Tim Flynn
commit de34351ba8
Notes: github-actions[bot] 2025-02-10 16:35:17 +00:00
5 changed files with 20 additions and 13 deletions

View file

@ -29,7 +29,7 @@ struct LaunchBrowserCallbacks;
class Session : public RefCounted<Session> {
public:
static ErrorOr<NonnullRefPtr<Session>> create(NonnullRefPtr<Client> client, JsonObject& capabilities, ReadonlySpan<StringView> flags);
static ErrorOr<NonnullRefPtr<Session>> create(NonnullRefPtr<Client> client, JsonObject& capabilities, Web::WebDriver::SessionFlags flags);
~Session();
enum class AllowInvalidWindowHandle {
@ -83,7 +83,7 @@ public:
}
private:
Session(NonnullRefPtr<Client> client, JsonObject const& capabilities, String session_id, bool http);
Session(NonnullRefPtr<Client> client, JsonObject const& capabilities, String session_id, Web::WebDriver::SessionFlags flags);
ErrorOr<void> start(LaunchBrowserCallbacks const&);
@ -94,7 +94,7 @@ private:
Web::WebDriver::LadybirdOptions m_options;
String m_session_id;
bool m_http { false };
Web::WebDriver::SessionFlags m_session_flags { Web::WebDriver::SessionFlags::Default };
HashMap<String, Window> m_windows;
String m_current_window_handle;