diff options
Diffstat (limited to 'core/replica.zig')
| -rw-r--r-- | core/replica.zig | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/core/replica.zig b/core/replica.zig index c68848f2..a13acada 100644 --- a/core/replica.zig +++ b/core/replica.zig @@ -5342,7 +5342,6 @@ const may_wait = [_]Wait{ .{ .what = "Dump", .on = .any, .stop = "write_dump", .why = "a dump written" }, .{ .what = "Upgrade", .on = .any, .stop = "upgrade", .why = "the session execs itself" }, .{ .what = "Detach", .on = .any, .stop = "detach", .why = "the session lets its frontend go" }, - .{ .what = "focus lost and found", .on = .any, .stop = "newer_build", .why = "a window found again asks whether a newer build is installed: the session's disk" }, // What the session alone holds: its closed panes, Recent and History // (every session of its user writes them), the config and theme files. .{ .what = "Restore", .on = .any, .stop = "the authority's own state", .why = "the session's dumps" }, @@ -5884,3 +5883,26 @@ test "an idle client's check answered covers the units that came while it was as c.take(.{ .checked = digestOf(a) }); try std.testing.expect(!c.asked and c.changed); } + +// A window's keyboard found again asked the session's host whether a newer +// pardes is installed, in the core's focus step: a client's refocus waited +// a round trip for a question about the session's binary that its own +// window has nothing to do with. Each process's build is its own frontend's +// to look at, at its own focus-in (upgrade.noticeNewer). +test "a far client's window found again is instant: its refocus asks the session's host nothing, and the session's unit confirms it" { + const gpa = std.testing.allocator; + const a = try Authority.init(gpa, .{ .cols = 80, .rows = 24, .file = "mise.toml" }, FullHost.host(), false); + defer a.deinit(); + const r = try joinedFresh(a); + defer r.deinit(); + for ([_]bool{ false, true }) |focused| { + const msg = try gpa.dupe(u8, try r.input(.{ .focus = focused })); + defer gpa.free(msg); + try std.testing.expectEqual(@as(usize, 1), r.applied); + r.confirm(try a.take(msg)); + r.settle(); + try agrees(a, r); + } + try std.testing.expectEqual(@as(u32, 0), r.stats.stopped); + try std.testing.expectEqual(@as(u32, 2), r.stats.fast); +} |
