mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-21 02:01:55 +07:00
tests: Move complete_animations() to Fixture
This commit is contained in:
@@ -44,12 +44,6 @@ fn create_window(f: &mut Fixture, id: ClientId, w: u16, h: u16) -> WlSurface {
|
||||
surface
|
||||
}
|
||||
|
||||
fn complete_animations(niri: &mut Niri) {
|
||||
niri.clock.set_complete_instantly(true);
|
||||
niri.advance_animations();
|
||||
niri.clock.set_complete_instantly(false);
|
||||
}
|
||||
|
||||
fn set_time(niri: &mut Niri, time: Duration) {
|
||||
// This is a bit involved because we're dealing with an AdjustableClock that maintains its own
|
||||
// internal current_time.
|
||||
@@ -118,7 +112,7 @@ fn set_up_two_in_column() -> (Fixture, ClientId, WlSurface, WlSurface) {
|
||||
f.double_roundtrip(id);
|
||||
|
||||
set_time(f.niri(), Duration::ZERO);
|
||||
complete_animations(f.niri());
|
||||
f.niri_complete_animations();
|
||||
|
||||
(f, id, surface1, surface2)
|
||||
}
|
||||
|
||||
@@ -82,6 +82,13 @@ impl Fixture {
|
||||
niri.layout.focus_output(output);
|
||||
}
|
||||
|
||||
pub fn niri_complete_animations(&mut self) {
|
||||
let niri = self.niri();
|
||||
niri.clock.set_complete_instantly(true);
|
||||
niri.advance_animations();
|
||||
niri.clock.set_complete_instantly(false);
|
||||
}
|
||||
|
||||
pub fn add_output(&mut self, n: u8, size: (u16, u16)) {
|
||||
let state = self.niri_state();
|
||||
let niri = &mut state.niri;
|
||||
|
||||
Reference in New Issue
Block a user