--- a/testing/geckodriver/src/marionette.rs
+++ b/testing/geckodriver/src/marionette.rs
@@ -1022,17 +1022,17 @@ impl MarionetteCommand {
let mut data = BTreeMap::new();
data.insert("name".to_string(), x.to_json());
(Some("WebDriver:DeleteCookie"), Some(Ok(data)))
}
DeleteCookies => (Some("WebDriver:DeleteAllCookies"), None),
DeleteSession => {
let mut body = BTreeMap::new();
body.insert("flags".to_owned(), vec!["eForceQuit".to_json()].to_json());
- (Some("quit"), Some(Ok(body)))
+ (Some("Marionette:Quit"), Some(Ok(body)))
}
DismissAlert => (Some("WebDriver:DismissAlert"), None),
ElementClear(ref x) => (Some("WebDriver:ElementClear"), Some(x.to_marionette())),
ElementClick(ref x) => (Some("WebDriver:ElementClick"), Some(x.to_marionette())),
ElementSendKeys(ref e, ref x) => {
let mut data = BTreeMap::new();
data.insert("id".to_string(), e.id.to_json());
data.insert("text".to_string(), x.text.to_json());
@@ -1155,44 +1155,40 @@ impl MarionetteCommand {
}
TakeScreenshot => {
let mut data = BTreeMap::new();
data.insert("id".to_string(), Json::Null);
data.insert("highlights".to_string(), Json::Array(vec![]));
data.insert("full".to_string(), Json::Boolean(false));
(Some("WebDriver:TakeScreenshot"), Some(Ok(data)))
}
- Extension(ref extension) => {
- match extension {
- &GeckoExtensionCommand::GetContext => {
- (Some("getContext"), None)
- },
- &GeckoExtensionCommand::InstallAddon(ref x) => {
- (Some("addon:install"), Some(x.to_marionette()))
- },
- &GeckoExtensionCommand::SetContext(ref x) => {
- (Some("setContext"), Some(x.to_marionette()))
- },
- &GeckoExtensionCommand::UninstallAddon(ref x) => {
- (Some("addon:uninstall"), Some(x.to_marionette()))
- },
- &GeckoExtensionCommand::XblAnonymousByAttribute(ref e, ref x) => {
- let mut data = try!(x.to_marionette());
- data.insert("element".to_string(), e.id.to_json());
- (Some("findElement"), Some(Ok(data)))
- },
- &GeckoExtensionCommand::XblAnonymousChildren(ref e) => {
- let mut data = BTreeMap::new();
- data.insert("using".to_owned(), "anon".to_json());
- data.insert("value".to_owned(), Json::Null);
- data.insert("element".to_string(), e.id.to_json());
- (Some("findElements"), Some(Ok(data)))
- }
+ Extension(ref extension) => match extension {
+ &GeckoExtensionCommand::GetContext => (Some("Marionette:GetContext"), None),
+ &GeckoExtensionCommand::InstallAddon(ref x) => {
+ (Some("Addon:Install"), Some(x.to_marionette()))
+ }
+ &GeckoExtensionCommand::SetContext(ref x) => {
+ (Some("Marionette:SetContext"), Some(x.to_marionette()))
+ }
+ &GeckoExtensionCommand::UninstallAddon(ref x) => {
+ (Some("Addon:Uninstall"), Some(x.to_marionette()))
}
- }
+ &GeckoExtensionCommand::XblAnonymousByAttribute(ref e, ref x) => {
+ let mut data = try!(x.to_marionette());
+ data.insert("element".to_string(), e.id.to_json());
+ (Some("WebDriver:FindElement"), Some(Ok(data)))
+ }
+ &GeckoExtensionCommand::XblAnonymousChildren(ref e) => {
+ let mut data = BTreeMap::new();
+ data.insert("using".to_owned(), "anon".to_json());
+ data.insert("value".to_owned(), Json::Null);
+ data.insert("element".to_string(), e.id.to_json());
+ (Some("WebDriver:FindElements"), Some(Ok(data)))
+ }
+ },
};
let name = try_opt!(opt_name,
ErrorStatus::UnsupportedOperation,
"Operation not supported");
let parameters = try!(opt_parameters.unwrap_or(Ok(BTreeMap::new())));
Ok(MarionetteCommand::new(id, name.into(), parameters))