1
0
Fork 0
forked from wry/wry
wry/src/it/tests/t0002_window.rs
2022-05-15 20:13:25 +02:00

39 lines
867 B
Rust

use {
crate::{
it::{test_error::TestError, testrun::TestRun},
rect::Rect,
tree::Node,
},
std::rc::Rc,
};
testcase!();
/// Create and map a single surface
async fn test(run: Rc<TestRun>) -> Result<(), TestError> {
run.backend.install_default()?;
let client = run.create_client().await?;
let window = client.create_window().await?;
window.map().await?;
tassert_eq!(window.tl.width.get(), 800);
tassert_eq!(
window.tl.height.get(),
600 - 2 * (run.state.theme.sizes.title_height.get() + 1)
);
tassert_eq!(
window.tl.server.node_absolute_position(),
Rect::new_sized(
0,
2 * (run.state.theme.sizes.title_height.get() + 1),
window.tl.width.get(),
window.tl.height.get(),
)
.unwrap()
);
Ok(())
}