From d9dab73eb72d3448cfaf32cde096ef51c484e0b5 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Mon, 3 May 2021 22:56:38 +0100 Subject: [PATCH] wdriver: Provide url in Window Signed-off-by: Ian Jackson --- wdriver/wdriver.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/wdriver/wdriver.rs b/wdriver/wdriver.rs index ed0b9a52..55a09c77 100644 --- a/wdriver/wdriver.rs +++ b/wdriver/wdriver.rs @@ -59,6 +59,7 @@ pub struct Window { pub name: String, pub player: PlayerId, pub instance: InstanceName, + pub url: String, js_logfile: JsLogfile, vpid_cache: RefCell>, } @@ -516,7 +517,7 @@ fn check_window_name_sanity(name: &str) -> &str { impl Setup { #[throws(AE)] pub fn new_window<'s>(&'s mut self, instance: &Instance, name: &str, - player: PlayerId) + player: PlayerId, url: String) -> Window { let name = check_window_name_sanity(name)?; let window = (||{ @@ -549,7 +550,7 @@ impl Setup { name: name.to_owned(), instance: instance.0.clone(), vpid_cache: default(), - player, js_logfile, + url, player, js_logfile, }) })() .with_context(|| name.to_owned()) @@ -799,6 +800,7 @@ impl Drop for Setup { player: default(), vpid_cache: default(), js_logfile: jslog.clone(), + url: default(), }; self.w(&w)?.screenshot("final", log::Level::Info) .context(name) @@ -847,7 +849,8 @@ impl Setup { susus .into_iter().map(|sus| { - let w = self.new_window(instance, sus.nick, sus.player)?; + let w = self.new_window(instance, sus.nick, + sus.player, sus.url.clone())?; self.w(&w)?.get(sus.url)?; self.w(&w)?.screenshot("initial", log::Level::Trace)?; Ok::<_,AE>(w) -- 2.30.2