surface: commit subsurface state during parent commit
This commit is contained in:
parent
a2c907c8c4
commit
c5fd2cd989
10 changed files with 125 additions and 69 deletions
|
|
@ -69,6 +69,7 @@ mod t0034_workspace_restoration;
|
|||
mod t0035_scanout_feedback;
|
||||
mod t0036_idle;
|
||||
mod t0037_toplevel_drag;
|
||||
mod t0038_subsurface_parent_state;
|
||||
|
||||
pub trait TestCase: Sync {
|
||||
fn name(&self) -> &'static str;
|
||||
|
|
@ -125,5 +126,6 @@ pub fn tests() -> Vec<&'static dyn TestCase> {
|
|||
t0035_scanout_feedback,
|
||||
t0036_idle,
|
||||
t0037_toplevel_drag,
|
||||
t0038_subsurface_parent_state,
|
||||
}
|
||||
}
|
||||
|
|
|
|||
38
src/it/tests/t0038_subsurface_parent_state.rs
Normal file
38
src/it/tests/t0038_subsurface_parent_state.rs
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
use {
|
||||
crate::{
|
||||
it::{test_error::TestResult, testrun::TestRun},
|
||||
theme::Color,
|
||||
},
|
||||
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 win = client.create_window().await?;
|
||||
win.set_color(255, 255, 255, 255);
|
||||
win.map2().await?;
|
||||
|
||||
let ss = client.comp.create_surface().await?;
|
||||
let vp = client.viewporter.get_viewport(&ss)?;
|
||||
vp.set_destination(100, 100)?;
|
||||
let buf = client.spbm.create_buffer(Color::SOLID_BLACK)?;
|
||||
ss.attach(buf.id)?;
|
||||
ss.commit()?;
|
||||
|
||||
let ss = client.sub.get_subsurface(ss.id, win.surface.id).await?;
|
||||
ss.set_position(0, 0)?;
|
||||
win.surface.commit()?;
|
||||
|
||||
client.compare_screenshot("1", false).await?;
|
||||
|
||||
ss.set_position(100, 100)?;
|
||||
win.surface.commit()?;
|
||||
|
||||
client.compare_screenshot("2", false).await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
BIN
src/it/tests/t0038_subsurface_parent_state/screenshot_1.qoi
Normal file
BIN
src/it/tests/t0038_subsurface_parent_state/screenshot_1.qoi
Normal file
Binary file not shown.
BIN
src/it/tests/t0038_subsurface_parent_state/screenshot_2.qoi
Normal file
BIN
src/it/tests/t0038_subsurface_parent_state/screenshot_2.qoi
Normal file
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue