From b7367fa0d0f0472e86c1e508ad6bd57f7c279c1c Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 23 Dec 2020 18:32:38 +0000 Subject: [PATCH] wip actually show a thing Signed-off-by: Ian Jackson --- wdriver.rs | 13 +++++++++---- wdriver/wdt-simple.rs | 10 ---------- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/wdriver.rs b/wdriver.rs index af0ec3c3..a410d818 100644 --- a/wdriver.rs +++ b/wdriver.rs @@ -27,6 +27,8 @@ use otter::config::DAEMON_STARTUP_REPORT; pub const MS : time::Duration = time::Duration::from_millis(1); pub type AE = anyhow::Error; +pub const URL : &str = "http://localhost:8000"; + pub trait AlwaysContext { fn always_context(self, msg: &'static str) -> anyhow::Result; } @@ -76,6 +78,7 @@ impl DirSubst { s .replace("@target@", &format!("{}/target", &ds.start_dir)) .replace("@srcbuild@", &ds.start_dir) + .replace("@url@", &URL) } inner(self, s.as_ref()) } @@ -349,7 +352,7 @@ fn prepare_xserver(cln: &cleanup_notify::Handle, ds: &DirSubst) { #[throws(AE)] fn prepare_gameserver(cln: &cleanup_notify::Handle, ds: &DirSubst) { let config = ds.subst(r##" -public_url = "http://localhost:8000" +public_url = "@url" base_dir = "@srcbuild@" command_socket = "command.socket" save_dir = "." @@ -411,9 +414,11 @@ fn prepare_thirtyfour() { .context("create 34 WebDriver")?; // driver.fullscreen_window() // .context("fullscreen")?; - driver.get("http://localhost:") - .context("dummy navigation")?; - driver.screenshot(path::Path::new("test.png")) + driver.screenshot(path::Path::new("test1.png")) + .context("screenshot")?; + driver.get(URL) + .context("navigate to home page")?; + driver.screenshot(path::Path::new("test2.png")) .context("screenshot")?; } diff --git a/wdriver/wdt-simple.rs b/wdriver/wdt-simple.rs index c2692c9c..3868a8ab 100644 --- a/wdriver/wdt-simple.rs +++ b/wdriver/wdt-simple.rs @@ -9,14 +9,4 @@ fn main(){ let s = setup().always_context("setup")?; println!("hi! {:#?}", &s); - - for _ in 0..2 { - let mut c = Command::new("xdpyinfo"); - let s = c - .spawn().context("spawn")? - .wait().context("wait")?; - println!("s = {:?}", &s); - - std::thread::sleep(500 * MS); - } } -- 2.30.2