aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2019-04-20 09:34:07 -0400
committerGitHub <noreply@github.com>2019-04-20 09:34:07 -0400
commit328244684a8b1f98d515d5f40655b9cf7347affd (patch)
tree0c0e166baedfde38fc0479f3216c7849c4d086f0
parent63b4455837a08fac47ed6589d3aa7e1929a17863 (diff)
parent18a90f04db545c091aec5f244b74953d04140253 (diff)
downloadservo-328244684a8b1f98d515d5f40655b9cf7347affd.tar.gz
servo-328244684a8b1f98d515d5f40655b9cf7347affd.zip
Auto merge of #23234 - Eijebong:webdriver, r=jdm
Update webdriver to 0.39 <!-- Reviewable:start --> This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23234) <!-- Reviewable:end -->
-rw-r--r--Cargo.lock6
-rw-r--r--components/webdriver_server/Cargo.toml2
-rw-r--r--components/webdriver_server/lib.rs17
3 files changed, 14 insertions, 11 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 87e5fc6248f..fbf547ae545 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -4898,7 +4898,7 @@ dependencies = [
[[package]]
name = "webdriver"
-version = "0.38.1"
+version = "0.39.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -4941,7 +4941,7 @@ dependencies = [
"servo_url 0.0.1",
"url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)",
"uuid 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "webdriver 0.38.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "webdriver 0.39.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -5637,7 +5637,7 @@ dependencies = [
"checksum wayland-protocols 0.21.4 (registry+https://github.com/rust-lang/crates.io-index)" = "d3f6cebb98963f028d397e9bad2acf9d3b2f6b76fae65aea191edd9e7c0df88c"
"checksum wayland-scanner 0.21.4 (registry+https://github.com/rust-lang/crates.io-index)" = "f1927ee62e4e149c010dc9eca8ca47e238416cd6f45f688eb9f8a8e9c3794c30"
"checksum wayland-sys 0.21.4 (registry+https://github.com/rust-lang/crates.io-index)" = "ca41ed78a12256f81df6f53fcbe4503213ba442e02cdad3c9c888a64a668eaf4"
-"checksum webdriver 0.38.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c6022ea74cc9f0085c01ff24965d935cd40f9592d7a56f13909c65f08ea98149"
+"checksum webdriver 0.39.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0533b0b0a05e2e5c081317759a038482806c6085c9605dded03c8bbd2498b042"
"checksum webrender 0.60.0 (git+https://github.com/servo/webrender)" = "<none>"
"checksum webrender_api 0.60.0 (git+https://github.com/servo/webrender)" = "<none>"
"checksum webrender_build 0.0.1 (git+https://github.com/servo/webrender)" = "<none>"
diff --git a/components/webdriver_server/Cargo.toml b/components/webdriver_server/Cargo.toml
index 3fecf338098..fd7b4a16590 100644
--- a/components/webdriver_server/Cargo.toml
+++ b/components/webdriver_server/Cargo.toml
@@ -31,4 +31,4 @@ servo_config = {path = "../config"}
servo_url = {path = "../url"}
url = "1.2"
uuid = {version = "0.7", features = ["v4"]}
-webdriver = "0.38"
+webdriver = "0.39"
diff --git a/components/webdriver_server/lib.rs b/components/webdriver_server/lib.rs
index 293b364967c..ec79ca8d5c0 100644
--- a/components/webdriver_server/lib.rs
+++ b/components/webdriver_server/lib.rs
@@ -109,7 +109,7 @@ struct WebDriverSession {
/// Time to wait for injected scripts to run before interrupting them. A [`None`] value
/// specifies that the script should run indefinitely.
- script_timeout: u64,
+ script_timeout: Option<u64>,
/// Time to wait for a page to finish loading upon navigation.
load_timeout: u64,
@@ -129,7 +129,7 @@ impl WebDriverSession {
browsing_context_id: browsing_context_id,
top_level_browsing_context_id: top_level_browsing_context_id,
- script_timeout: 30_000,
+ script_timeout: Some(30_000),
load_timeout: 300_000,
implicit_wait_timeout: 0,
}
@@ -994,7 +994,7 @@ impl Handler {
.ok_or(WebDriverError::new(ErrorStatus::SessionNotCreated, ""))?;
if let Some(timeout) = parameters.script {
- session.script_timeout = timeout
+ session.script_timeout = timeout;
}
if let Some(timeout) = parameters.page_load {
session.load_timeout = timeout
@@ -1032,11 +1032,14 @@ impl Handler {
let func_body = &parameters.script;
let args_string = "window.webdriverCallback";
+ let timeout_script = if let Some(script_timeout) = self.session()?.script_timeout {
+ format!("setTimeout(webdriverTimeout, {});", script_timeout)
+ } else {
+ "".into()
+ };
let script = format!(
- "setTimeout(webdriverTimeout, {}); (function(callback) {{ {} }})({})",
- self.session()?.script_timeout,
- func_body,
- args_string
+ "{} (function(callback) {{ {} }})({})",
+ timeout_script, func_body, args_string
);
let (sender, receiver) = ipc::channel().unwrap();