Bug 1461463 - [geckodriver] Empty response value should be null and not {}.
WebDriver commands which do not return a value have to send null.
But currently geckodriver returns an empty object.
MozReview-Commit-ID: EEmNlbmxu5n
--- a/testing/webdriver/src/response.rs
+++ b/testing/webdriver/src/response.rs
@@ -21,22 +21,22 @@ pub enum WebDriverResponse {
impl WebDriverResponse {
pub fn to_json_string(self) -> String {
use response::WebDriverResponse::*;
let obj = match self {
CloseWindow(ref x) => json::encode(&x.to_json()),
Cookie(ref x) => json::encode(x),
Cookies(ref x) => json::encode(x),
- DeleteSession => Ok("{}".to_string()),
+ DeleteSession => Ok("null".to_string()),
ElementRect(ref x) => json::encode(x),
Generic(ref x) => json::encode(x),
NewSession(ref x) => json::encode(x),
Timeouts(ref x) => json::encode(x),
- Void => Ok("{}".to_string()),
+ Void => Ok("null".to_string()),
WindowRect(ref x) => json::encode(&x.to_json()),
}.unwrap();
match self {
Generic(_) | Cookie(_) | Cookies(_) => obj,
_ => {
let mut data = String::with_capacity(11 + obj.len());
data.push_str("{\"value\": ");