mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-24 02:01:18 +07:00
tests/floating: Extract set_up_with_config()
This commit is contained in:
+6
-17
@@ -9,7 +9,11 @@ use super::*;
|
|||||||
|
|
||||||
// Sets up a fixture with two outputs and 100×100 window.
|
// Sets up a fixture with two outputs and 100×100 window.
|
||||||
fn set_up() -> (Fixture, ClientId, WlSurface) {
|
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(1, (1920, 1080));
|
||||||
f.add_output(2, (1280, 720));
|
f.add_output(2, (1280, 720));
|
||||||
|
|
||||||
@@ -796,22 +800,7 @@ window-rule {
|
|||||||
}
|
}
|
||||||
"##;
|
"##;
|
||||||
let config = Config::parse_mem(config).unwrap();
|
let config = Config::parse_mem(config).unwrap();
|
||||||
let mut f = Fixture::with_config(config);
|
let (mut f, id, surface) = set_up_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);
|
|
||||||
|
|
||||||
// Commit to the Activated state configure.
|
// Commit to the Activated state configure.
|
||||||
f.client(id).window(&surface).ack_last_and_commit();
|
f.client(id).window(&surface).ack_last_and_commit();
|
||||||
|
|||||||
Reference in New Issue
Block a user