Bug 1380936 - Add support for 'minimize' command in geckodriver; r?ato,whimboo draft
authoryangyi_peng@htc.com
Fri, 14 Jul 2017 16:23:34 +0800
changeset 608873 65ed548dee5da29f516a8946f77b6bb327102a60
parent 608838 8ec3297460e1f4857d158a608641f4e6157f8edc
child 609688 f810a8104cd94f1cf3a83a6b307478a4d963d564
child 609690 a592f274040ef668df69b828d3140fd4fc5bc826
push id68430
push userbmo:yangyi_peng@htc.com
push dateFri, 14 Jul 2017 08:23:54 +0000
reviewersato, whimboo
bugs1380936
milestone56.0a1
Bug 1380936 - Add support for 'minimize' command in geckodriver; r?ato,whimboo Need to merge after webdriver-rust update to include the commit "Implement the minimize window for webdriver-rust (#105)" MozReview-Commit-ID: F13y0aOn6Ia
testing/geckodriver/src/marionette.rs
--- a/testing/geckodriver/src/marionette.rs
+++ b/testing/geckodriver/src/marionette.rs
@@ -19,18 +19,18 @@ use std::sync::Mutex;
 use std::thread::sleep;
 use std::time::Duration;
 use webdriver::capabilities::CapabilitiesMatching;
 use webdriver::command::{WebDriverCommand, WebDriverMessage, Parameters,
                          WebDriverExtensionCommand};
 use webdriver::command::WebDriverCommand::{
     NewSession, DeleteSession, Status, Get, GetCurrentUrl,
     GoBack, GoForward, Refresh, GetTitle, GetPageSource, GetWindowHandle,
-    GetWindowHandles, CloseWindow, SetWindowRect,
-    GetWindowRect, MaximizeWindow, FullscreenWindow, SwitchToWindow, SwitchToFrame,
+    GetWindowHandles, CloseWindow, SetWindowRect, GetWindowRect,
+    MinimizeWindow, MaximizeWindow, FullscreenWindow, SwitchToWindow, SwitchToFrame,
     SwitchToParentFrame, FindElement, FindElements,
     FindElementElement, FindElementElements, GetActiveElement,
     IsDisplayed, IsSelected, GetElementAttribute, GetElementProperty, GetCSSValue,
     GetElementText, GetElementTagName, GetElementRect, IsEnabled,
     ElementClick, ElementTap, ElementClear, ElementSendKeys,
     ExecuteScript, ExecuteAsyncScript, GetCookies, GetNamedCookie, AddCookie,
     DeleteCookies, DeleteCookie, GetTimeouts, SetTimeouts, DismissAlert,
     AcceptAlert, GetAlertText, SendAlertText, TakeScreenshot, TakeElementScreenshot,
@@ -730,17 +730,17 @@ impl MarionetteSession {
                     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))
             },
-            FullscreenWindow | MaximizeWindow | GetWindowRect |
+            FullscreenWindow | MinimizeWindow | MaximizeWindow | GetWindowRect |
             SetWindowRect(_) => {
                 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");
 
@@ -1007,16 +1007,17 @@ impl MarionetteCommand {
             GetPageSource => (Some("getPageSource"), None),
             GetWindowHandle => (Some("getWindowHandle"), None),
             GetWindowHandles => (Some("getWindowHandles"), None),
             CloseWindow => (Some("close"), None),
             GetTimeouts => (Some("getTimeouts"), None),
             SetTimeouts(ref x) => (Some("setTimeouts"), Some(x.to_marionette())),
             SetWindowRect(ref x) => (Some("setWindowRect"), Some(x.to_marionette())),
             GetWindowRect => (Some("getWindowRect"), None),
+            MinimizeWindow => (Some("minimizeWindow"), None),
             MaximizeWindow => (Some("maximizeWindow"), None),
             FullscreenWindow => (Some("fullscreenWindow"), None),
             SwitchToWindow(ref x) => (Some("switchToWindow"), Some(x.to_marionette())),
             SwitchToFrame(ref x) => (Some("switchToFrame"), Some(x.to_marionette())),
             SwitchToParentFrame => (Some("switchToParentFrame"), None),
             FindElement(ref x) => (Some("findElement"), Some(x.to_marionette())),
             FindElements(ref x) => (Some("findElements"), Some(x.to_marionette())),
             FindElementElement(ref e, ref x) => {