added sending closing event message to settings windows (#7)
Release / release (push) Successful in 5m7s
Release / release (push) Successful in 5m7s
Reviewed-on: #7 Co-authored-by: Aleksandr Neychev <alexnejchev73@gmail.com>
This commit was merged in pull request #7.
This commit is contained in:
@@ -133,6 +133,34 @@ public sealed partial class EndToEndTests
|
||||
Assert.False(launch.Process.HasExited);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// "Exit" in the tray menu ends the application whole: the settings window goes with
|
||||
/// the agent instead of staying on the screen belonging to nothing.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// The menu itself is out of reach of a test — it is a <c>TrackPopupMenuEx</c> menu
|
||||
/// with a modal loop of its own — so what is checked is the request the menu makes.
|
||||
/// The settings window here is the real one, started by the agent, and it must be
|
||||
/// listening by the time it is on the screen.
|
||||
/// </remarks>
|
||||
[Fact]
|
||||
public void The_agents_exit_closes_the_settings_window()
|
||||
{
|
||||
using Launch launch = Launch.Start();
|
||||
launch.WaitForSettingsWindow();
|
||||
|
||||
Process settings = Launch.SettingsProcesses().Single();
|
||||
try
|
||||
{
|
||||
Assert.True(SettingsCloseSignal.RequestClose(), "the settings window was not listening");
|
||||
Assert.True(settings.WaitForExit(ExitTimeout), "the settings window outlived the agent's exit");
|
||||
}
|
||||
finally
|
||||
{
|
||||
settings.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>A started application that shuts down together with the check.</summary>
|
||||
private sealed class Launch : IDisposable
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user