From 9c8131e145e157cd8c80ab4a77e3434756c52bd8 Mon Sep 17 00:00:00 2001 From: Julian Orth Date: Tue, 2 Apr 2024 19:05:16 +0200 Subject: [PATCH] it: test double click float toggle --- src/it/tests.rs | 2 ++ src/it/tests/t0029_double_click_float.rs | 33 ++++++++++++++++++ .../t0029_double_click_float/screenshot_1.qoi | Bin 0 -> 10118 bytes .../t0029_double_click_float/screenshot_2.qoi | Bin 0 -> 7834 bytes 4 files changed, 35 insertions(+) create mode 100644 src/it/tests/t0029_double_click_float.rs create mode 100644 src/it/tests/t0029_double_click_float/screenshot_1.qoi create mode 100644 src/it/tests/t0029_double_click_float/screenshot_2.qoi diff --git a/src/it/tests.rs b/src/it/tests.rs index 018ae928..61ff443d 100644 --- a/src/it/tests.rs +++ b/src/it/tests.rs @@ -59,6 +59,7 @@ mod t0025_dnd_focus_change; mod t0026_output_transform; mod t0027_input_region; mod t0028_top_level_restacking; +mod t0029_double_click_float; pub trait TestCase: Sync { fn name(&self) -> &'static str; @@ -106,5 +107,6 @@ pub fn tests() -> Vec<&'static dyn TestCase> { t0026_output_transform, t0027_input_region, t0028_top_level_restacking, + t0029_double_click_float, } } diff --git a/src/it/tests/t0029_double_click_float.rs b/src/it/tests/t0029_double_click_float.rs new file mode 100644 index 00000000..dbce7c08 --- /dev/null +++ b/src/it/tests/t0029_double_click_float.rs @@ -0,0 +1,33 @@ +use { + crate::{ + ifs::wl_seat::BTN_LEFT, + it::{test_error::TestResult, testrun::TestRun}, + tree::Node, + }, + std::rc::Rc, +}; + +testcase!(); + +async fn test(run: Rc) -> 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?; + run.cfg.set_floating(ds.seat.id(), true)?; + + for i in ["1", "2"] { + let (x, y) = win1.tl.server.node_absolute_position().position(); + ds.move_to(x + 10, y - 3); + ds.mouse.click(BTN_LEFT); + ds.mouse.click(BTN_LEFT); + + client.sync().await; + client.compare_screenshot(i, false).await?; + } + + Ok(()) +} diff --git a/src/it/tests/t0029_double_click_float/screenshot_1.qoi b/src/it/tests/t0029_double_click_float/screenshot_1.qoi new file mode 100644 index 0000000000000000000000000000000000000000..f49edd4d3627d804802ad5f24047b69f68aebc11 GIT binary patch literal 10118 zcmXTS&rD-rU{+vYV2WU7_@@zCe*PZ=1H)e=@KpS~DH8YZh~xh=Ha12MfN%d81SF9K zM%kkwFd71*Aut*OBPj%){j+!Xf_V6m3532R4WWtW9}$CVM$^G)Iv7m{ zpb!{M2cS?GEe}T1!Du=Fg}`V!0ENP6c`%v|M$-W(1V+;VC=^D^gOQjHKr#RKFY!|$ esOllSQF1f{MnhmU1V%$(Gz5lU2z+CJ07d}izNMo8 literal 0 HcmV?d00001 diff --git a/src/it/tests/t0029_double_click_float/screenshot_2.qoi b/src/it/tests/t0029_double_click_float/screenshot_2.qoi new file mode 100644 index 0000000000000000000000000000000000000000..dd974ccffda932661558262ad0c65bd5f05f7bed GIT binary patch literal 7834 zcmXTS&rD-rU{+vYV2WU7_@@zCe*PZ=1H)e=@KpS~DH8YZh~xh=Ha12MfN$c+ykW+^ zVub9WZ~y+ICI)25QTAvEjE2By2#kinXb6mkz-S1JhQMeDjE2By2#kinXb6mkz-S1J phQMeDjE2By2#kinXb6mkz-S1JhQMeDjE2By2;dEY8w?P@2moq80f+zq literal 0 HcmV?d00001