1
0
Fork 0
forked from wry/wry

tree: switch workspace by scrolling

This commit is contained in:
Julian Orth 2022-05-07 18:27:20 +02:00
parent a310329c42
commit b970965ed9
5 changed files with 82 additions and 2 deletions

View file

@ -41,6 +41,7 @@ mod t0012_subsurface_focus;
mod t0013_graphics_initialized;
mod t0014_container_scroll_focus;
mod t0015_scroll_partial;
mod t0016_scroll_ws;
pub trait TestCase: Sync {
fn name(&self) -> &'static str;
@ -74,5 +75,6 @@ pub fn tests() -> Vec<&'static dyn TestCase> {
t0013_graphics_initialized,
t0014_container_scroll_focus,
t0015_scroll_partial,
t0016_scroll_ws,
}
}

View file

@ -0,0 +1,37 @@
use {
crate::it::{
test_error::{TestErrorExt, TestResult},
testrun::TestRun,
},
std::rc::Rc,
};
testcase!();
async fn test(run: Rc<TestRun>) -> TestResult {
let ds = run.create_default_setup().await?;
run.cfg.show_workspace(ds.seat.id(), "1")?;
let client = run.create_client().await?;
let dss = client.get_default_seat().await?;
let w1 = client.create_window().await?;
w1.map().await?;
run.cfg.show_workspace(ds.seat.id(), "2")?;
let w2 = client.create_window().await?;
w2.map().await?;
let enters = dss.kb.enter.expect()?;
ds.mouse.abs(&ds.connector, 0.0, 0.0);
ds.mouse.scroll(-1);
client.sync().await;
let enter = enters.next().with_context(|| "no enter")?;
tassert_eq!(enter.surface, w1.surface.id);
Ok(())
}