aboutsummaryrefslogtreecommitdiffstats
path: root/components/msg
diff options
context:
space:
mode:
authorDan Robertson <drobertson@tripwire.com>2016-06-25 20:06:17 +0000
committerDan Robertson <drobertson@tripwire.com>2016-06-25 22:24:35 +0000
commit246723114fa54f82643bad827393cf58f1fdeea9 (patch)
tree31630771bcea6e8d67725beabd8b34a22572aed4 /components/msg
parent7d978e7b3d6b41b234f7c9b4051b746a1fbeddee (diff)
downloadservo-246723114fa54f82643bad827393cf58f1fdeea9.tar.gz
servo-246723114fa54f82643bad827393cf58f1fdeea9.zip
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.
Diffstat (limited to 'components/msg')
-rw-r--r--components/msg/Cargo.toml1
-rw-r--r--components/msg/lib.rs1
-rw-r--r--components/msg/webdriver_msg.rs10
3 files changed, 12 insertions, 0 deletions
diff --git a/components/msg/Cargo.toml b/components/msg/Cargo.toml
index ac3a967802d..a47e3f83d8c 100644
--- a/components/msg/Cargo.toml
+++ b/components/msg/Cargo.toml
@@ -24,3 +24,4 @@ serde_macros = "0.7"
url = {version = "1.0.0", features = ["heap_size", "serde"]}
util = {path = "../util", features = ["servo"]}
webrender_traits = {git = "https://github.com/servo/webrender_traits"}
+cookie = { version = "0.2.5", features = ["serialize-serde", "serialize-rustc" ] }
diff --git a/components/msg/lib.rs b/components/msg/lib.rs
index bd97c3a33da..bac2f1a6011 100644
--- a/components/msg/lib.rs
+++ b/components/msg/lib.rs
@@ -10,6 +10,7 @@
#[allow(unused_extern_crates)]
#[macro_use]
extern crate bitflags;
+extern crate cookie as cookie_rs;
extern crate euclid;
extern crate heapsize;
extern crate hyper;
diff --git a/components/msg/webdriver_msg.rs b/components/msg/webdriver_msg.rs
index a6c94c3a439..ea848ce431d 100644
--- a/components/msg/webdriver_msg.rs
+++ b/components/msg/webdriver_msg.rs
@@ -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>, ()>>),
@@ -29,6 +33,12 @@ pub enum WebDriverScriptCommand {
}
#[derive(Deserialize, Serialize)]
+pub enum WebDriverCookieError {
+ InvalidDomain,
+ UnableToSetCookie
+}
+
+#[derive(Deserialize, Serialize)]
pub enum WebDriverJSValue {
Undefined,
Null,