Tests: functional profile round-trip through the real main-window controls

Local checkpoint - NOT for public release.

Toward Ed's "every control and every function tested" goal: a new self-test applies a
profile to the ACTUAL main-window controls (via an internal ApplyThenCaptureForTest seam
on the headless form) and reads it straight back, asserting every persisted value
survived - volume, mute, send/receive toggles, peer-shaping master, send mode, send-all-
applications, and the selected applications. This exercises each control's load AND save
logic, not just that it exists (which the accessibility audit already covers).

The apply path pops the "set a password to stream" dialog when enabling send with no
password (would hang a headless test); the seam sets the existing suppressStreamingPasswordGate
around the apply, same gate the app uses internally.

Gate 25/25.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Ednunp
2026-07-12 19:16:08 +01:00
co-authored by Claude Opus 4.8
parent 499e9644d7
commit a52f08c188
2 changed files with 63 additions and 0 deletions
+15
View File
@@ -8172,6 +8172,21 @@ public sealed class MainForm : Form
return profile;
}
/// <summary>Test-only: push a profile INTO the real controls and read it straight back OUT, so a
/// self-test can prove every persisted control both loads and saves correctly. Headless forms only
/// (a real form would try to reconnect peers etc.); pass a profile with no peers.</summary>
internal Profile ApplyThenCaptureForTest(Profile input)
{
pendingProfile = input;
settings.ApplyProfile(input);
// Suppress the interactive "set a password to stream" gate that a real user apply would show —
// it would pop a modal dialog and hang the headless test. We only care about control round-trip.
suppressStreamingPasswordGate = true;
try { ApplyPendingProfileToControls(); }
finally { suppressStreamingPasswordGate = false; }
return BuildCurrentProfile(input.Title);
}
/// <summary>Common save body — gathers all current state into a Profile and writes it.
/// On success, becomes the active profile (sets currentProfileTitle, updates window
/// title, refreshes button visibility, and shows a confirmation popup).</summary>