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

@ -1,13 +1,20 @@
use {
crate::{
it::test_error::TestResult,
tree::{OutputNode, WorkspaceNode},
it::{
test_error::TestResult,
test_utils::{
test_container_node_ext::TestContainerExt,
test_workspace_node_ext::TestWorkspaceNodeExt,
},
},
tree::{OutputNode, ToplevelNode, WorkspaceNode},
},
std::rc::Rc,
};
pub trait TestOutputNodeExt {
fn workspace(&self) -> TestResult<Rc<WorkspaceNode>>;
fn first_toplevel(&self) -> TestResult<Rc<dyn ToplevelNode>>;
}
impl TestOutputNodeExt for OutputNode {
@ -17,4 +24,8 @@ impl TestOutputNodeExt for OutputNode {
Some(w) => Ok(w),
}
}
fn first_toplevel(&self) -> TestResult<Rc<dyn ToplevelNode>> {
self.workspace()?.container()?.first_toplevel()
}
}

View file

@ -28,7 +28,7 @@ impl TestWindow {
self.surface.attach(buffer.id)?;
self.viewport.set_source(0, 0, 1, 1)?;
self.viewport
.set_destination(self.tl.width.get(), self.tl.height.get())?;
.set_destination(self.tl.core.width.get(), self.tl.core.height.get())?;
self.xdg.ack_configure(self.xdg.last_serial.get())?;
self.surface.commit()?;
self.surface.tran.sync().await;