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 -->
This commit is contained in:
bors-servo 2019-04-20 09:34:07 -04:00 committed by GitHub
commit 328244684a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 11 deletions

6
Cargo.lock generated
View file

@ -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>"

View file

@ -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"

View file

@ -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();