autocommit 2022-05-02 00:00:45 CEST
This commit is contained in:
parent
04580c4aeb
commit
552c8a9950
8 changed files with 155 additions and 43 deletions
38
src/it/tests/t0003_multi_window.rs
Normal file
38
src/it/tests/t0003_multi_window.rs
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
use {
|
||||
crate::{
|
||||
it::{test_error::TestError, testrun::TestRun},
|
||||
rect::Rect,
|
||||
tree::Node,
|
||||
},
|
||||
std::rc::Rc,
|
||||
};
|
||||
|
||||
testcase!();
|
||||
|
||||
/// Create and map two surfaces
|
||||
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?;
|
||||
|
||||
let window2 = client.create_window().await?;
|
||||
window2.map().await?;
|
||||
|
||||
let otop = 2 * (run.state.theme.title_height.get() + 1);
|
||||
let bw = run.state.theme.border_width.get();
|
||||
|
||||
tassert_eq!(
|
||||
window.tl.server.node_absolute_position(),
|
||||
Rect::new_sized(0, otop, (800 - bw) / 2, 600 - otop).unwrap()
|
||||
);
|
||||
|
||||
tassert_eq!(
|
||||
window2.tl.server.node_absolute_position(),
|
||||
Rect::new_sized((800 - bw) / 2 + bw, otop, (800 - bw) / 2, 600 - otop).unwrap()
|
||||
);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue