[WebDriver] Unify Cookie related Error types (#37339)

Remove `embedder/webdriver.rs::WebDriverCookieError` and use universal
`ErrorStatus` from webdriver crate. This is needed as we might need to
send back more universal error such as `NoSuchWindow`.

Testing: No behaviour change.

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
This commit is contained in:
Euclid Ye 2025-06-09 14:23:31 +08:00 committed by GitHub
parent 96b0973037
commit 4e9993128b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 30 additions and 40 deletions

View file

@ -94,7 +94,7 @@ pub enum WebDriverScriptCommand {
serialize_with = "::hyper_serde::serialize"
)]
Cookie<'static>,
IpcSender<Result<(), WebDriverCookieError>>,
IpcSender<Result<(), ErrorStatus>>,
),
DeleteCookies(IpcSender<Result<(), ErrorStatus>>),
DeleteCookie(String, IpcSender<Result<(), ErrorStatus>>),
@ -134,8 +134,11 @@ pub enum WebDriverScriptCommand {
ElementClick(String, IpcSender<Result<Option<String>, ErrorStatus>>),
GetActiveElement(IpcSender<Option<String>>),
GetComputedRole(String, IpcSender<Result<Option<String>, ErrorStatus>>),
GetCookie(String, IpcSender<Vec<Serde<Cookie<'static>>>>),
GetCookies(IpcSender<Vec<Serde<Cookie<'static>>>>),
GetCookie(
String,
IpcSender<Result<Vec<Serde<Cookie<'static>>>, ErrorStatus>>,
),
GetCookies(IpcSender<Result<Vec<Serde<Cookie<'static>>>, ErrorStatus>>),
GetElementAttribute(
String,
String,
@ -165,12 +168,6 @@ pub enum WebDriverScriptCommand {
WillSendKeys(String, String, bool, IpcSender<Result<bool, ErrorStatus>>),
}
#[derive(Debug, Deserialize, Serialize)]
pub enum WebDriverCookieError {
InvalidDomain,
UnableToSetCookie,
}
#[derive(Clone, Debug, Deserialize, Serialize)]
pub enum WebDriverJSValue {
Undefined,