Bug 1486467 - [webdriver] Rename sessionId to session_id for NewSessionResponse. r=ato
authorHenrik Skupin <mail@hskupin.info>
Mon, 27 Aug 2018 16:44:35 +0200
changeset 481857 9d702b7e5d80bc365790fe49001882b8dca80c9c
parent 481856 b4cb950d23e59879f9081cdf0a0ebd3405d39c4c
child 481858 55ab0c5a32b00368c2d0a534f8fe26f83b4a80d3
push id232
push userfmarier@mozilla.com
push dateWed, 05 Sep 2018 20:45:54 +0000
reviewersato
bugs1486467
milestone63.0a1
Bug 1486467 - [webdriver] Rename sessionId to session_id for NewSessionResponse. r=ato
testing/webdriver/src/response.rs
testing/webdriver/src/server.rs
--- a/testing/webdriver/src/response.rs
+++ b/testing/webdriver/src/response.rs
@@ -63,25 +63,26 @@ pub struct ElementRectResponse {
     /// pixels.
     ///
     /// [bounding rectangle]: https://drafts.fxtf.org/geometry/#rectangle
     pub height: f64,
 }
 
 #[derive(Debug, PartialEq, Serialize)]
 pub struct NewSessionResponse {
-    pub sessionId: String,
+    #[serde(rename = "sessionId")]
+    pub session_id: String,
     pub capabilities: Value,
 }
 
 impl NewSessionResponse {
     pub fn new(session_id: String, capabilities: Value) -> NewSessionResponse {
         NewSessionResponse {
-            capabilities: capabilities,
-            sessionId: session_id,
+            capabilities,
+            session_id,
         }
     }
 }
 
 #[derive(Debug, PartialEq, Serialize)]
 pub struct TimeoutsResponse {
     pub script: u64,
     #[serde(rename = "pageLoad")]
--- a/testing/webdriver/src/server.rs
+++ b/testing/webdriver/src/server.rs
@@ -69,17 +69,17 @@ impl<T: WebDriverHandler<U>, U: WebDrive
                 Ok(DispatchMessage::HandleWebDriver(msg, resp_chan)) => {
                     let resp = match self.check_session(&msg) {
                         Ok(_) => self.handler.handle_command(&self.session, msg),
                         Err(e) => Err(e),
                     };
 
                     match resp {
                         Ok(WebDriverResponse::NewSession(ref new_session)) => {
-                            self.session = Some(Session::new(new_session.sessionId.clone()));
+                            self.session = Some(Session::new(new_session.session_id.clone()));
                         }
                         Ok(WebDriverResponse::CloseWindow(CloseWindowResponse(ref handles))) => {
                             if handles.len() == 0 {
                                 debug!("Last window was closed, deleting session");
                                 self.delete_session();
                             }
                         }
                         Ok(WebDriverResponse::DeleteSession) => self.delete_session(),