webdriver: Merge branch 'command-status-rebased'
authorVangelis Katsikaros <vkatsikaros@gmail.com>
Mon, 24 Oct 2016 17:25:44 +0100
changeset 428085 fac4373faedc5a0ff63f6d497ff7bc4f99e4c81d
parent 428084 3fde37a93ce5212b1fdf3041ddc096db74b4d96b
child 428086 470146fab45d67eda94addbd875af5b8f53aaa23
push id7761
push userjlund@mozilla.com
push dateFri, 15 Sep 2017 00:19:52 +0000
treeherdermozilla-beta@c38455951db4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone57.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
webdriver: Merge branch 'command-status-rebased' Source-Repo: https://github.com/mozilla/webdriver-rust Source-Revision: f0e19ac2794a7602cde640d0ac49ffd69e220a0c committer: Andreas Tolfsen <ato@mozilla.com>
testing/webdriver/src/command.rs
testing/webdriver/src/httpapi.rs
--- a/testing/webdriver/src/command.rs
+++ b/testing/webdriver/src/command.rs
@@ -57,16 +57,17 @@ pub enum WebDriverCommand<T: WebDriverEx
     ElementTap(WebElement),
     ElementClear(WebElement),
     ElementSendKeys(WebElement, SendKeysParameters),
     DismissAlert,
     AcceptAlert,
     GetAlertText,
     SendAlertText(SendKeysParameters),
     TakeScreenshot,
+    Status,
     Extension(T)
 }
 
 pub trait WebDriverExtensionCommand : Clone + Send + PartialEq {
     fn parameters_json(&self) -> Option<Json>;
 }
 
 #[derive(Clone, PartialEq)]
@@ -314,16 +315,17 @@ impl <U: WebDriverExtensionRoute> WebDri
             Route::GetAlertText => {
                 WebDriverCommand::GetAlertText
             },
             Route::SendAlertText => {
                 let parameters: SendKeysParameters = try!(Parameters::from_json(&body_data));
                 WebDriverCommand::SendAlertText(parameters)
             },
             Route::TakeScreenshot => WebDriverCommand::TakeScreenshot,
+            Route::Status => WebDriverCommand::Status,
             Route::Extension(ref extension) => {
                 try!(extension.command(params, &body_data))
             }
         };
         Ok(WebDriverMessage::new(session_id, command))
     }
 
     fn get_session_id(params: &Captures) -> Option<String> {
@@ -364,17 +366,18 @@ impl <U:WebDriverExtensionRoute> ToJson 
             WebDriverCommand::DeleteCookies |
             WebDriverCommand::DeleteCookie(_) |
             WebDriverCommand::DismissAlert |
             WebDriverCommand::AcceptAlert |
             WebDriverCommand::GetAlertText |
             WebDriverCommand::ElementClick(_) |
             WebDriverCommand::ElementTap(_) |
             WebDriverCommand::ElementClear(_) |
-            WebDriverCommand::TakeScreenshot => {
+            WebDriverCommand::TakeScreenshot |
+            WebDriverCommand::Status => {
                 None
             },
             WebDriverCommand::Get(ref x) => Some(x.to_json()),
             WebDriverCommand::SetTimeouts(ref x) => Some(x.to_json()),
             WebDriverCommand::SetWindowSize(ref x) => Some(x.to_json()),
             WebDriverCommand::SetWindowPosition(ref x) => Some(x.to_json()),
             WebDriverCommand::SwitchToWindow(ref x) => Some(x.to_json()),
             WebDriverCommand::SwitchToFrame(ref x) => Some(x.to_json()),
--- a/testing/webdriver/src/httpapi.rs
+++ b/testing/webdriver/src/httpapi.rs
@@ -66,17 +66,18 @@ fn standard_routes<U:WebDriverExtensionR
                 (Get, "/session/{sessionId}/alert_text", Route::GetAlertText),
                 (Post, "/session/{sessionId}/alert_text", Route::SendAlertText),
                 (Post, "/session/{sessionId}/accept_alert", Route::AcceptAlert),
                 (Post, "/session/{sessionId}/dismiss_alert", Route::DismissAlert),
                 (Get, "/session/{sessionId}/window_handle", Route::GetWindowHandle),
                 (Get, "/session/{sessionId}/window_handles", Route::GetWindowHandles),
                 (Delete, "/session/{sessionId}/window_handle", Route::Close),
                 (Post, "/session/{sessionId}/execute_async", Route::ExecuteAsyncScript),
-                (Post, "/session/{sessionId}/execute", Route::ExecuteScript),]
+                (Post, "/session/{sessionId}/execute", Route::ExecuteScript),
+                (Get, "/status", Route::Status),]
 }
 
 #[derive(Clone, Copy)]
 pub enum Route<U:WebDriverExtensionRoute> {
     NewSession,
     DeleteSession,
     Get,
     GetCurrentUrl,
@@ -123,16 +124,17 @@ pub enum Route<U:WebDriverExtensionRoute
     ElementTap,
     ElementClear,
     ElementSendKeys,
     DismissAlert,
     AcceptAlert,
     GetAlertText,
     SendAlertText,
     TakeScreenshot,
+    Status,
     Extension(U)
 }
 
 pub trait WebDriverExtensionRoute : Clone + Send + PartialEq {
     type Command: WebDriverExtensionCommand + 'static;
 
     fn command(&self, &Captures, &Json) -> WebDriverResult<WebDriverCommand<Self::Command>>;
 }