diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2025-10-04 09:44:42 +0300 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2025-10-15 09:04:16 +0300 |
| commit | 5ad3d661f0fd25c924d8a5efc7294f560bc42617 (patch) | |
| tree | 2814602e68848f06b5edffb114043fcbe5c4b1d0 /src | |
| parent | 87dc96fa69738b5d57562a0a556efa7def138539 (diff) | |
| download | niri-5ad3d661f0fd25c924d8a5efc7294f560bc42617.tar.gz niri-5ad3d661f0fd25c924d8a5efc7294f560bc42617.tar.bz2 niri-5ad3d661f0fd25c924d8a5efc7294f560bc42617.zip | |
tests/floating: Extract set_up_with_config()
Diffstat (limited to 'src')
| -rw-r--r-- | src/tests/floating.rs | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/src/tests/floating.rs b/src/tests/floating.rs index e1cb4330..43caf211 100644 --- a/src/tests/floating.rs +++ b/src/tests/floating.rs @@ -9,7 +9,11 @@ use super::*; // Sets up a fixture with two outputs and 100×100 window. fn set_up() -> (Fixture, ClientId, WlSurface) { - let mut f = Fixture::new(); + set_up_with_config(Config::default()) +} + +fn set_up_with_config(config: Config) -> (Fixture, ClientId, WlSurface) { + let mut f = Fixture::with_config(config); f.add_output(1, (1920, 1080)); f.add_output(2, (1280, 720)); @@ -796,22 +800,7 @@ window-rule { } "##; let config = Config::parse_mem(config).unwrap(); - let mut f = Fixture::with_config(config); - f.add_output(1, (1920, 1080)); - f.add_output(2, (1280, 720)); - - let id = f.add_client(); - let window = f.client(id).create_window(); - let surface = window.surface.clone(); - window.commit(); - f.roundtrip(id); - - // Open with smaller width than min. - let window = f.client(id).window(&surface); - window.attach_new_buffer(); - window.set_size(100, 100); - window.ack_last_and_commit(); - f.double_roundtrip(id); + let (mut f, id, surface) = set_up_with_config(config); // Commit to the Activated state configure. f.client(id).window(&surface).ack_last_and_commit(); |
