it: test xdg-activation
This commit is contained in:
parent
91022cd1c8
commit
6fe6b1b491
16 changed files with 239 additions and 23 deletions
|
|
@ -43,19 +43,17 @@ async fn test(run: Rc<TestRun>) -> Result<(), TestError> {
|
|||
|
||||
parent.map().await?;
|
||||
|
||||
seat.set_app_cursor(None);
|
||||
|
||||
client.compare_screenshot("1").await?;
|
||||
client.compare_screenshot("1", false).await?;
|
||||
|
||||
sub.place_below(parent.surface.id)?;
|
||||
child.commit()?;
|
||||
parent.map().await?;
|
||||
client.compare_screenshot("2").await?;
|
||||
client.compare_screenshot("2", false).await?;
|
||||
|
||||
sub.place_above(parent.surface.id)?;
|
||||
child.commit()?;
|
||||
parent.map().await?;
|
||||
client.compare_screenshot("1").await?;
|
||||
client.compare_screenshot("1", false).await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,12 +44,12 @@ async fn test(run: Rc<TestRun>) -> Result<(), TestError> {
|
|||
let enter = enter.next()?;
|
||||
seat.pointer.set_cursor(enter.serial, &surface, 0, 0)?;
|
||||
|
||||
client.compare_screenshot("1").await?;
|
||||
client.compare_screenshot("1", true).await?;
|
||||
|
||||
surface.offset(-100, -100)?;
|
||||
surface.commit()?;
|
||||
|
||||
client.compare_screenshot("2").await?;
|
||||
client.compare_screenshot("2", true).await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
|||
40
src/it/tests/t0023_xdg_activation.rs
Normal file
40
src/it/tests/t0023_xdg_activation.rs
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
use {
|
||||
crate::it::{
|
||||
test_error::TestResult,
|
||||
test_utils::{
|
||||
test_ouput_node_ext::TestOutputNodeExt, test_toplevel_node_ext::TestToplevelNodeExt,
|
||||
},
|
||||
testrun::TestRun,
|
||||
},
|
||||
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);
|
||||
|
||||
client.sync().await;
|
||||
run.cfg.set_mono(ds.seat.id(), true)?;
|
||||
|
||||
let token = client.activation.get_token().await?;
|
||||
client.activation.activate(&win2.surface, &token)?;
|
||||
client.sync().await;
|
||||
|
||||
client.compare_screenshot("1", false).await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
BIN
src/it/tests/t0023_xdg_activation/screenshot_1.qoi
Normal file
BIN
src/it/tests/t0023_xdg_activation/screenshot_1.qoi
Normal file
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue