mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Auto merge of #23951 - georgeroman:return_errorstatus_from_webdriverhandlers, r=jdm
Return ErrorStatus from webdriver_handlers <!-- Please describe your changes on the following line: --> With `webdriver 0.40`, `ErrorStatus` implements `Deserialize`. Now we can accommodate for multiple errors occuring in `webdriver_handlers`. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors <!-- Either: --> <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23951) <!-- Reviewable:end -->
This commit is contained in:
commit
00a9f30773
12 changed files with 482 additions and 438 deletions
|
@ -11,6 +11,7 @@ use ipc_channel::ipc::IpcSender;
|
|||
use msg::constellation_msg::BrowsingContextId;
|
||||
use servo_url::ServoUrl;
|
||||
use webdriver::common::WebElement;
|
||||
use webdriver::error::ErrorStatus;
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
pub enum WebDriverScriptCommand {
|
||||
|
@ -22,36 +23,65 @@ pub enum WebDriverScriptCommand {
|
|||
Cookie<'static>,
|
||||
IpcSender<Result<(), WebDriverCookieError>>,
|
||||
),
|
||||
DeleteCookies(IpcSender<Result<(), ()>>),
|
||||
DeleteCookies(IpcSender<Result<(), ErrorStatus>>),
|
||||
ExecuteScript(String, IpcSender<WebDriverJSResult>),
|
||||
ExecuteAsyncScript(String, IpcSender<WebDriverJSResult>),
|
||||
FindElementCSS(String, IpcSender<Result<Option<String>, ()>>),
|
||||
FindElementLinkText(String, bool, IpcSender<Result<Option<String>, ()>>),
|
||||
FindElementTagName(String, IpcSender<Result<Option<String>, ()>>),
|
||||
FindElementsCSS(String, IpcSender<Result<Vec<String>, ()>>),
|
||||
FindElementsLinkText(String, bool, IpcSender<Result<Vec<String>, ()>>),
|
||||
FindElementsTagName(String, IpcSender<Result<Vec<String>, ()>>),
|
||||
FindElementElementCSS(String, String, IpcSender<Result<Option<String>, ()>>),
|
||||
FindElementElementLinkText(String, String, bool, IpcSender<Result<Option<String>, ()>>),
|
||||
FindElementElementTagName(String, String, IpcSender<Result<Option<String>, ()>>),
|
||||
FindElementElementsCSS(String, String, IpcSender<Result<Vec<String>, ()>>),
|
||||
FindElementElementsLinkText(String, String, bool, IpcSender<Result<Vec<String>, ()>>),
|
||||
FindElementElementsTagName(String, String, IpcSender<Result<Vec<String>, ()>>),
|
||||
FocusElement(String, IpcSender<Result<(), ()>>),
|
||||
FindElementCSS(String, IpcSender<Result<Option<String>, ErrorStatus>>),
|
||||
FindElementLinkText(String, bool, IpcSender<Result<Option<String>, ErrorStatus>>),
|
||||
FindElementTagName(String, IpcSender<Result<Option<String>, ErrorStatus>>),
|
||||
FindElementsCSS(String, IpcSender<Result<Vec<String>, ErrorStatus>>),
|
||||
FindElementsLinkText(String, bool, IpcSender<Result<Vec<String>, ErrorStatus>>),
|
||||
FindElementsTagName(String, IpcSender<Result<Vec<String>, ErrorStatus>>),
|
||||
FindElementElementCSS(
|
||||
String,
|
||||
String,
|
||||
IpcSender<Result<Option<String>, ErrorStatus>>,
|
||||
),
|
||||
FindElementElementLinkText(
|
||||
String,
|
||||
String,
|
||||
bool,
|
||||
IpcSender<Result<Option<String>, ErrorStatus>>,
|
||||
),
|
||||
FindElementElementTagName(
|
||||
String,
|
||||
String,
|
||||
IpcSender<Result<Option<String>, ErrorStatus>>,
|
||||
),
|
||||
FindElementElementsCSS(String, String, IpcSender<Result<Vec<String>, ErrorStatus>>),
|
||||
FindElementElementsLinkText(
|
||||
String,
|
||||
String,
|
||||
bool,
|
||||
IpcSender<Result<Vec<String>, ErrorStatus>>,
|
||||
),
|
||||
FindElementElementsTagName(String, String, IpcSender<Result<Vec<String>, ErrorStatus>>),
|
||||
FocusElement(String, IpcSender<Result<(), ErrorStatus>>),
|
||||
GetActiveElement(IpcSender<Option<String>>),
|
||||
GetCookie(String, IpcSender<Vec<Serde<Cookie<'static>>>>),
|
||||
GetCookies(IpcSender<Vec<Serde<Cookie<'static>>>>),
|
||||
GetElementAttribute(String, String, IpcSender<Result<Option<String>, ()>>),
|
||||
GetElementProperty(String, String, IpcSender<Result<WebDriverJSValue, ()>>),
|
||||
GetElementCSS(String, String, IpcSender<Result<String, ()>>),
|
||||
GetElementRect(String, IpcSender<Result<Rect<f64>, ()>>),
|
||||
GetElementTagName(String, IpcSender<Result<String, ()>>),
|
||||
GetElementText(String, IpcSender<Result<String, ()>>),
|
||||
GetBrowsingContextId(WebDriverFrameId, IpcSender<Result<BrowsingContextId, ()>>),
|
||||
GetElementAttribute(
|
||||
String,
|
||||
String,
|
||||
IpcSender<Result<Option<String>, ErrorStatus>>,
|
||||
),
|
||||
GetElementProperty(
|
||||
String,
|
||||
String,
|
||||
IpcSender<Result<WebDriverJSValue, ErrorStatus>>,
|
||||
),
|
||||
GetElementCSS(String, String, IpcSender<Result<String, ErrorStatus>>),
|
||||
GetElementRect(String, IpcSender<Result<Rect<f64>, ErrorStatus>>),
|
||||
GetElementTagName(String, IpcSender<Result<String, ErrorStatus>>),
|
||||
GetElementText(String, IpcSender<Result<String, ErrorStatus>>),
|
||||
GetBrowsingContextId(
|
||||
WebDriverFrameId,
|
||||
IpcSender<Result<BrowsingContextId, ErrorStatus>>,
|
||||
),
|
||||
GetUrl(IpcSender<ServoUrl>),
|
||||
GetPageSource(IpcSender<Result<String, ()>>),
|
||||
IsEnabled(String, IpcSender<Result<bool, ()>>),
|
||||
IsSelected(String, IpcSender<Result<bool, ()>>),
|
||||
GetPageSource(IpcSender<Result<String, ErrorStatus>>),
|
||||
IsEnabled(String, IpcSender<Result<bool, ErrorStatus>>),
|
||||
IsSelected(String, IpcSender<Result<bool, ErrorStatus>>),
|
||||
GetTitle(IpcSender<String>),
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue