Backed out changeset 311c7c91fd52 (bug 1371405) for bustage
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Tue, 20 Jun 2017 16:04:58 +0200
changeset 365059 42da76c2bb69d5b95e8a4f672ae594db581866e7
parent 365058 dd4e600e972a2234883e73ad4f7b21c10a1b9675
child 365060 a5e5a4af220919c10e49b7d3e0176785cfffa3f0
push id91680
push userkwierso@gmail.com
push dateWed, 21 Jun 2017 01:32:01 +0000
treeherdermozilla-inbound@f7b9dc31956c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1371405
milestone56.0a1
backs out311c7c91fd52f065a3f7ed21939b00c0db566337
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
Backed out changeset 311c7c91fd52 (bug 1371405) for bustage
testing/geckodriver/src/marionette.rs
--- a/testing/geckodriver/src/marionette.rs
+++ b/testing/geckodriver/src/marionette.rs
@@ -35,18 +35,19 @@ use webdriver::command::WebDriverCommand
     DeleteCookies, DeleteCookie, GetTimeouts, SetTimeouts, DismissAlert,
     AcceptAlert, GetAlertText, SendAlertText, TakeScreenshot, TakeElementScreenshot,
     Extension, PerformActions, ReleaseActions};
 use webdriver::command::{
     NewSessionParameters, GetParameters, WindowRectParameters, SwitchToWindowParameters,
     SwitchToFrameParameters, LocatorParameters, JavascriptCommandParameters,
     GetNamedCookieParameters, AddCookieParameters, TimeoutsParameters,
     ActionsParameters, TakeScreenshotParameters};
-use webdriver::response::{CloseWindowResponse, Cookie, CookieResponse, RectResponse,
-                          NewSessionResponse, TimeoutsResponse, ValueResponse, WebDriverResponse};
+use webdriver::response::{CloseWindowResponse, Cookie, CookieResponse, ElementRectResponse,
+                          NewSessionResponse, TimeoutsResponse, ValueResponse, WebDriverResponse,
+                          WindowRectResponse};
 use webdriver::common::{
     Date, Nullable, WebElement, FrameId, ELEMENT_KEY};
 use webdriver::error::{ErrorStatus, WebDriverError, WebDriverResult};
 use webdriver::server::{WebDriverHandler, Session};
 use webdriver::httpapi::{WebDriverExtensionRoute};
 
 use capabilities::{FirefoxCapabilities, FirefoxOptions};
 use prefs;
@@ -631,17 +632,17 @@ impl MarionetteSession {
             return Err(WebDriverError::new(status, error.message));
         }
 
         try!(self.update(msg, &resp));
 
         Ok(match msg.command {
             // Everything that doesn't have a response value
             Get(_) | GoBack | GoForward | Refresh | SetTimeouts(_) |
-            SwitchToWindow(_) | SwitchToFrame(_) |
+            MaximizeWindow | SwitchToWindow(_) | SwitchToFrame(_) |
             SwitchToParentFrame | AddCookie(_) | DeleteCookies | DeleteCookie(_) |
             DismissAlert | AcceptAlert | SendAlertText(_) | ElementClick(_) |
             ElementTap(_) | ElementClear(_) | ElementSendKeys(_, _) |
             PerformActions(_) | ReleaseActions => {
                 WebDriverResponse::Void
             },
             // Things that simply return the contents of the marionette "value" property
             GetCurrentUrl | GetTitle | GetPageSource | GetWindowHandle | IsDisplayed(_) |
@@ -698,16 +699,50 @@ impl MarionetteSession {
                                        .map(|x| {
                                                 Ok(try_opt!(x.as_string(),
                                                             ErrorStatus::UnknownError,
                                                             "Failed to interpret window handle as string")
                                                            .to_owned())
                                             })
                                        .collect());
                 WebDriverResponse::CloseWindow(CloseWindowResponse { window_handles: handles })
+            }
+            GetWindowRect => {
+                let width = try_opt!(
+                    try_opt!(resp.result.find("width"),
+                             ErrorStatus::UnknownError,
+                             "Failed to find width field").as_u64(),
+                    ErrorStatus::UnknownError,
+                    "Failed to interpret width as integer");
+
+                let height = try_opt!(
+                    try_opt!(resp.result.find("height"),
+                             ErrorStatus::UnknownError,
+                             "Failed to find height field").as_u64(),
+                    ErrorStatus::UnknownError,
+                    "Failed to interpret width as integer");
+
+                let x = try_opt!(
+                    try_opt!(resp.result.find("x"),
+                             ErrorStatus::UnknownError,
+                             "Failed to find x field").as_i64(),
+                    ErrorStatus::UnknownError,
+                    "Failed to interpret x as integer");
+
+                let y = try_opt!(
+                    try_opt!(resp.result.find("y"),
+                             ErrorStatus::UnknownError,
+                             "Failed to find y field").as_i64(),
+                    ErrorStatus::UnknownError,
+                    "Failed to interpret y as integer");
+
+                WebDriverResponse::WindowRect(WindowRectResponse {x: x,
+                                                                  y: y,
+                                                                  width: width,
+                                                                  height: height})
             },
             GetElementRect(_) => {
                 let x = try_opt!(
                     try_opt!(resp.result.find("x"),
                              ErrorStatus::UnknownError,
                              "Failed to find x field").as_f64(),
                     ErrorStatus::UnknownError,
                     "Failed to interpret x as float");
@@ -728,20 +763,50 @@ impl MarionetteSession {
 
                 let height = try_opt!(
                     try_opt!(resp.result.find("height"),
                              ErrorStatus::UnknownError,
                              "Failed to find height field").as_f64(),
                     ErrorStatus::UnknownError,
                     "Failed to interpret width as float");
 
-                WebDriverResponse::ElementRect(RectResponse::new(x, y, width, height))
+                WebDriverResponse::ElementRect(ElementRectResponse::new(x, y, width, height))
             },
-            FullscreenWindow | MaximizeWindow | GetWindowRect |
-            MaximizeWindow | SetWindowRect(_) => {
+            SetWindowRect(_) => {
+                let x = try_opt!(
+                    try_opt!(resp.result.find("x"),
+                             ErrorStatus::UnknownError,
+                             "Failed to find x field").as_f64(),
+                    ErrorStatus::UnknownError,
+                    "Failed to interpret x as float");
+
+                let y = try_opt!(
+                    try_opt!(resp.result.find("y"),
+                             ErrorStatus::UnknownError,
+                             "Failed to find y field").as_f64(),
+                    ErrorStatus::UnknownError,
+                    "Failed to interpret y as float");
+
+                let width = try_opt!(
+                    try_opt!(resp.result.find("width"),
+                             ErrorStatus::UnknownError,
+                             "Failed to find width field").as_f64(),
+                    ErrorStatus::UnknownError,
+                    "Failed to interpret width as float");
+
+                let height = try_opt!(
+                    try_opt!(resp.result.find("height"),
+                             ErrorStatus::UnknownError,
+                             "Failed to find height field").as_f64(),
+                    ErrorStatus::UnknownError,
+                    "Failed to interpret width as float");
+
+                WebDriverResponse::ElementRect(ElementRectResponse::new(x, y, width, height))
+            },
+            FullscreenWindow => {
                 let width = try_opt!(
                     try_opt!(resp.result.find("width"),
                              ErrorStatus::UnknownError,
                              "Failed to find width field").as_u64(),
                     ErrorStatus::UnknownError,
                     "Failed to interpret width as integer");
 
                 let height = try_opt!(
@@ -760,17 +825,20 @@ impl MarionetteSession {
 
                 let y = try_opt!(
                     try_opt!(resp.result.find("y"),
                              ErrorStatus::UnknownError,
                              "Failed to find y field").as_i64(),
                     ErrorStatus::UnknownError,
                     "Failed to interpret y as integer");
 
-                WebDriverResponse::WindowRect(RectResponse::new(x, y, width, height))
+                WebDriverResponse::WindowRect(WindowRectResponse {x: x,
+                                                                  y: y,
+                                                                  width: width,
+                                                                  height: height})
             },
             GetCookies => {
                 let cookies = try!(self.process_cookies(&resp.result));
                 WebDriverResponse::Cookie(CookieResponse::new(cookies))
             },
             GetNamedCookie(ref name) => {
                 let mut cookies = try!(self.process_cookies(&resp.result));
                 cookies.retain(|x| x.name == *name);