Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mozilla/geckodriver.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Tolfsen <ato@mozilla.com>2017-02-23 22:05:11 +0300
committerAndreas Tolfsen <ato@mozilla.com>2017-02-24 20:44:11 +0300
commit140ab5a897d16d01418fc8aff94ae580eef49f2d (patch)
treee68856fd38882eb03c90642cf20daba8a867e4fc
parent09231df3527c0c37f2cc2210072683d6d8cbdbf5 (diff)
marionette: add Get Timeouts command
-rw-r--r--CHANGES.md6
-rw-r--r--src/marionette.rs37
2 files changed, 37 insertions, 6 deletions
diff --git a/CHANGES.md b/CHANGES.md
index 81fd4f2..37812b6 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -4,9 +4,15 @@ All notable changes to this program is documented in this file.
## Unreleased
+### Added
+- Added routing and parsing for the [Get Timeouts](https://w3c.github.io/webdriver/webdriver-spec.html#dfn-get-timeouts) command
+
### Changed
- Now uses about:blank as the new tab document; this was previously disabled due to [bug 1333736](https://bugzilla.mozilla.org/show_bug.cgi?id=1333736) in Marionette
+### Fixed
+- Aligned the data structure accepted by the [Set Timeouts](https://w3c.github.io/webdriver/webdriver-spec.html#set-timeouts) command with the WebDriver specification
+
## 0.14.0 (2017-01-31)
### Changed
diff --git a/src/marionette.rs b/src/marionette.rs
index 0fd6a68..e515586 100644
--- a/src/marionette.rs
+++ b/src/marionette.rs
@@ -40,9 +40,9 @@ use webdriver::command::{
SwitchToFrameParameters, LocatorParameters, JavascriptCommandParameters,
GetNamedCookieParameters, AddCookieParameters, TimeoutsParameters,
ActionsParameters, TakeScreenshotParameters, WindowPositionParameters};
-use webdriver::response::{
- WebDriverResponse, NewSessionResponse, ValueResponse, WindowSizeResponse,
- WindowPositionResponse, ElementRectResponse, CookieResponse, Cookie};
+use webdriver::response::{Cookie, CookieResponse, ElementRectResponse, NewSessionResponse,
+ TimeoutsResponse, ValueResponse, WebDriverResponse,
+ WindowPositionResponse, WindowSizeResponse};
use webdriver::common::{
Date, Nullable, WebElement, FrameId, ELEMENT_KEY};
use webdriver::error::{ErrorStatus, WebDriverError, WebDriverResult};
@@ -532,8 +532,33 @@ impl MarionetteSession {
WebDriverResponse::Generic(ValueResponse::new(value.clone()))
},
GetTimeouts => {
- return Err(WebDriverError::new(ErrorStatus::UnsupportedOperation,
- "Getting timeouts not yet supported"));
+ let script = try_opt!(try_opt!(resp.result
+ .find("script"),
+ ErrorStatus::UnknownError,
+ "Missing field: script")
+ .as_u64(),
+ ErrorStatus::UnknownError,
+ "Failed to interpret script timeout duration as u64");
+ let page_load = try_opt!(try_opt!(resp.result
+ .find("pageLoad"),
+ ErrorStatus::UnknownError,
+ "Missing field: pageLoad")
+ .as_u64(),
+ ErrorStatus::UnknownError,
+ "Failed to interpret page load duration as u64");
+ let implicit = try_opt!(try_opt!(resp.result
+ .find("implicit"),
+ ErrorStatus::UnknownError,
+ "Missing field: implicit")
+ .as_u64(),
+ ErrorStatus::UnknownError,
+ "Failed to interpret implicit search duration as u64");
+
+ WebDriverResponse::Timeouts(TimeoutsResponse {
+ script: script,
+ pageLoad: page_load,
+ implicit: implicit,
+ })
},
Status => panic!("Got status command that should already have been handled"),
GetWindowHandles => {
@@ -810,7 +835,7 @@ impl MarionetteCommand {
GetWindowHandle => (Some("getWindowHandle"), None),
GetWindowHandles => (Some("getWindowHandles"), None),
CloseWindow => (Some("close"), None),
- GetTimeouts => (None, None),
+ GetTimeouts => (Some("getTimeouts"), None),
SetTimeouts(ref x) => (Some("timeouts"), Some(x.to_marionette())),
SetWindowSize(ref x) => (Some("setWindowSize"), Some(x.to_marionette())),
GetWindowSize => (Some("getWindowSize"), None),