Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions tests/demos.zig
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,12 @@ const BundledApp = struct {
try dvui.testing.settle(headlessFrame);
}

/// Quits the way `appQuit` does: after the last frame, with no window current.
fn down(self: *BundledApp) void {
const harness_window = dvui.current_window;
dvui.current_window = null;
self.editor.deinit() catch {};
dvui.current_window = harness_window;
gpa.destroy(self.editor);
gpa.destroy(self.entry);
@import("app").profile.root = null;
Expand Down Expand Up @@ -511,6 +515,11 @@ test "demo: every bundled demo plays to the end through fizzy's stage, a seek la
}

try tourOnAPhone(&app);

// Left loaded for `down`, which quits the way `appQuit` does.
try app.editor.demo.play(fizzy.Editor.Demo.catalog.entries[0].name);
for (0..5) |_| _ = try dvui.testing.step(headlessFrame);
try std.testing.expect(app.editor.demo.active());
}

/// What straight play of a demo must keep steady, watched a frame at a time:
Expand Down
Loading