diff options
author | Ms2ger <Ms2ger@gmail.com> | 2016-07-04 14:45:29 +0200 |
---|---|---|
committer | Ms2ger <Ms2ger@gmail.com> | 2016-07-05 09:02:46 +0200 |
commit | 77caf83098baf8a9157d388442abcd243eb5825c (patch) | |
tree | dc20f5b5c344fe3e5775df54a713f31ba60d432b /components/msg | |
parent | b8fe9e9637a0824b028c307c0648052ccb6090a1 (diff) | |
download | servo-77caf83098baf8a9157d388442abcd243eb5825c.tar.gz servo-77caf83098baf8a9157d388442abcd243eb5825c.zip |
Move webdriver_msg to script_traits.
Diffstat (limited to 'components/msg')
-rw-r--r-- | components/msg/Cargo.toml | 3 | ||||
-rw-r--r-- | components/msg/lib.rs | 4 | ||||
-rw-r--r-- | components/msg/webdriver_msg.rs | 82 |
3 files changed, 0 insertions, 89 deletions
diff --git a/components/msg/Cargo.toml b/components/msg/Cargo.toml index dfa430505ca..72359201734 100644 --- a/components/msg/Cargo.toml +++ b/components/msg/Cargo.toml @@ -10,15 +10,12 @@ path = "lib.rs" [dependencies] bitflags = "0.7" -cookie = { version = "0.2.5", features = ["serialize-rustc", "serialize-serde"]} cssparser = {version = "0.5.4", features = ["heap_size", "serde-serialization"]} -euclid = "0.7.1" heapsize = "0.3.0" heapsize_plugin = "0.1.2" hyper = {version = "0.9.9", features = ["serde-serialization"]} ipc-channel = {git = "https://github.com/servo/ipc-channel"} plugins = {path = "../plugins"} -rustc-serialize = "0.3.4" serde = "0.7.11" serde_macros = "0.7.11" url = {version = "1.0.0", features = ["heap_size", "serde"]} diff --git a/components/msg/lib.rs b/components/msg/lib.rs index a3eda6b1796..13923b16b6e 100644 --- a/components/msg/lib.rs +++ b/components/msg/lib.rs @@ -10,15 +10,11 @@ #[allow(unused_extern_crates)] #[macro_use] extern crate bitflags; -extern crate cookie as cookie_rs; -extern crate euclid; extern crate heapsize; extern crate hyper; extern crate ipc_channel; -extern crate rustc_serialize; extern crate serde; extern crate url; extern crate webrender_traits; pub mod constellation_msg; -pub mod webdriver_msg; diff --git a/components/msg/webdriver_msg.rs b/components/msg/webdriver_msg.rs deleted file mode 100644 index ea848ce431d..00000000000 --- a/components/msg/webdriver_msg.rs +++ /dev/null @@ -1,82 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * 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}; -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>, ()>>), - GetElementTagName(String, IpcSender<Result<String, ()>>), - GetElementText(String, IpcSender<Result<String, ()>>), - GetFrameId(WebDriverFrameId, IpcSender<Result<Option<PipelineId>, ()>>), - GetUrl(IpcSender<Url>), - IsEnabled(String, IpcSender<Result<bool, ()>>), - IsSelected(String, IpcSender<Result<bool, ()>>), - GetTitle(IpcSender<String>) -} - -#[derive(Deserialize, Serialize)] -pub enum WebDriverCookieError { - InvalidDomain, - UnableToSetCookie -} - -#[derive(Deserialize, Serialize)] -pub enum WebDriverJSValue { - Undefined, - Null, - Boolean(bool), - Number(f64), - String(String), - // TODO: Object and WebElement -} - -#[derive(Deserialize, Serialize)] -pub enum WebDriverJSError { - Timeout, - UnknownType -} - -pub type WebDriverJSResult = Result<WebDriverJSValue, WebDriverJSError>; - -#[derive(Deserialize, Serialize)] -pub enum WebDriverFrameId { - Short(u16), - Element(String), - Parent -} - -impl ToJson for WebDriverJSValue { - fn to_json(&self) -> Json { - match *self { - WebDriverJSValue::Undefined => Json::Null, - WebDriverJSValue::Null => Json::Null, - WebDriverJSValue::Boolean(ref x) => x.to_json(), - WebDriverJSValue::Number(ref x) => x.to_json(), - WebDriverJSValue::String(ref x) => x.to_json() - } - } -} - -#[derive(Deserialize, Serialize)] -pub enum LoadStatus { - LoadComplete, - LoadTimeout -} |