Bug 1461463 - [geckodriver] Empty response value should be null and not {}. r=ato
authorHenrik Skupin <mail@hskupin.info>
Thu, 17 May 2018 15:56:39 +0200
changeset 420247 9d1398fa66ba134fdb4399eda11aec8abcdbc0d4
parent 420246 1c4a5bba3582a3498a992f6a3c8c817f5830e18a
child 420248 abd4d105082af9649e2b6c452d9be30d94256015
push id64569
push userhskupin@mozilla.com
push dateTue, 29 May 2018 15:49:19 +0000
treeherderautoland@fe8aa70475dd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersato
bugs1461463
milestone62.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1461463 - [geckodriver] Empty response value should be null and not {}. r=ato WebDriver commands which do not return a value have to send null. But currently geckodriver returns an empty object. MozReview-Commit-ID: EEmNlbmxu5n
testing/webdriver/src/response.rs
--- 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\": ");