mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Use common cookie struct add cookie webdriver cmds
One cookie struct to rule them all. One struct to represent them. One cookie struct to bind them all, and through the IPC carry them.
This commit is contained in:
parent
7d978e7b3d
commit
246723114f
19 changed files with 214 additions and 23 deletions
|
@ -3,6 +3,7 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use constellation_msg::PipelineId;
|
||||
use cookie_rs::Cookie;
|
||||
use euclid::rect::Rect;
|
||||
use ipc_channel::ipc::IpcSender;
|
||||
use rustc_serialize::json::{Json, ToJson};
|
||||
|
@ -10,12 +11,15 @@ use url::Url;
|
|||
|
||||
#[derive(Deserialize, Serialize)]
|
||||
pub enum WebDriverScriptCommand {
|
||||
AddCookie(Cookie, IpcSender<Result<(), WebDriverCookieError>>),
|
||||
ExecuteScript(String, IpcSender<WebDriverJSResult>),
|
||||
ExecuteAsyncScript(String, IpcSender<WebDriverJSResult>),
|
||||
FindElementCSS(String, IpcSender<Result<Option<String>, ()>>),
|
||||
FindElementsCSS(String, IpcSender<Result<Vec<String>, ()>>),
|
||||
FocusElement(String, IpcSender<Result<(), ()>>),
|
||||
GetActiveElement(IpcSender<Option<String>>),
|
||||
GetCookie(String, IpcSender<Vec<Cookie>>),
|
||||
GetCookies(IpcSender<Vec<Cookie>>),
|
||||
GetElementAttribute(String, String, IpcSender<Result<Option<String>, ()>>),
|
||||
GetElementCSS(String, String, IpcSender<Result<String, ()>>),
|
||||
GetElementRect(String, IpcSender<Result<Rect<f64>, ()>>),
|
||||
|
@ -28,6 +32,12 @@ pub enum WebDriverScriptCommand {
|
|||
GetTitle(IpcSender<String>)
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize)]
|
||||
pub enum WebDriverCookieError {
|
||||
InvalidDomain,
|
||||
UnableToSetCookie
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize)]
|
||||
pub enum WebDriverJSValue {
|
||||
Undefined,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue