1
0
Fork 0
forked from wry/wry

it: test suspended state

This commit is contained in:
Julian Orth 2024-04-02 14:30:24 +02:00
parent 3f4386609e
commit 91022cd1c8
12 changed files with 119 additions and 33 deletions

View file

@ -18,9 +18,9 @@ async fn test(run: Rc<TestRun>) -> Result<(), TestError> {
let window = client.create_window().await?;
window.map().await?;
tassert_eq!(window.tl.width.get(), 800);
tassert_eq!(window.tl.core.width.get(), 800);
tassert_eq!(
window.tl.height.get(),
window.tl.core.height.get(),
600 - 2 * (run.state.theme.sizes.title_height.get() + 1)
);
@ -29,8 +29,8 @@ async fn test(run: Rc<TestRun>) -> Result<(), TestError> {
Rect::new_sized(
0,
2 * (run.state.theme.sizes.title_height.get() + 1),
window.tl.width.get(),
window.tl.height.get(),
window.tl.core.width.get(),
window.tl.core.height.get(),
)
.unwrap()
);

View file

@ -35,7 +35,7 @@ async fn test(run: Rc<TestRun>) -> TestResult {
// | w_tiled | [ w_mono1 | w_mono2 ] | with w_mono2 visible and active
client.sync().await;
tassert_eq!(w_tiled.tl.width.get(), w_mono2.tl.width.get());
tassert_eq!(w_tiled.tl.core.width.get(), w_mono2.tl.core.width.get());
let enters = dss.kb.enter.expect()?;

View file

@ -0,0 +1,48 @@
use {
crate::{
ifs::wl_surface::xdg_surface::xdg_toplevel::STATE_SUSPENDED,
it::{
test_error::TestResult,
test_utils::{
test_ouput_node_ext::TestOutputNodeExt, test_toplevel_node_ext::TestToplevelNodeExt,
},
testrun::TestRun,
},
},
isnt::std_1::collections::IsntHashSet2Ext,
std::rc::Rc,
};
testcase!();
async fn test(run: Rc<TestRun>) -> TestResult {
let ds = run.create_default_setup().await?;
let client = run.create_client().await?;
let win1 = client.create_window().await?;
win1.set_color(255, 0, 0, 255);
win1.map2().await?;
let win2 = client.create_window().await?;
win2.set_color(0, 255, 0, 255);
win2.map2().await?;
let (x, y) = ds.output.first_toplevel()?.center();
ds.move_to(x, y);
tassert!(win2.tl.core.states.borrow().not_contains(&STATE_SUSPENDED));
client.sync().await;
run.cfg.set_mono(ds.seat.id(), true)?;
client.sync().await;
tassert!(win2.tl.core.states.borrow().contains(&STATE_SUSPENDED));
run.cfg.set_mono(ds.seat.id(), false)?;
client.sync().await;
tassert!(win2.tl.core.states.borrow().not_contains(&STATE_SUSPENDED));
Ok(())
}