Add failing test covering exit dialog crash

This commit is contained in:
Bartłomiej Dach 2023-07-16 16:28:44 +02:00
parent 50e6f0aee9
commit 72bf43e297
No known key found for this signature in database

View File

@ -722,6 +722,33 @@ namespace osu.Game.Tests.Visual.Navigation
AddUntilStep("Wait for game exit", () => Game.ScreenStack.CurrentScreen == null);
}
[Test]
public void TestForceExitWithOperationInProgress()
{
AddStep("set hold delay to 0", () => Game.LocalConfig.SetValue(OsuSetting.UIHoldActivationDelay, 0.0));
AddUntilStep("wait for dialog overlay", () => Game.ChildrenOfType<DialogOverlay>().SingleOrDefault() != null);
ProgressNotification progressNotification = null!;
AddStep("start ongoing operation", () =>
{
progressNotification = new ProgressNotification
{
Text = "Something is still running",
Progress = 0.5f,
State = ProgressNotificationState.Active,
};
Game.Notifications.Post(progressNotification);
});
AddStep("attempt exit", () =>
{
for (int i = 0; i < 2; ++i)
Game.ScreenStack.CurrentScreen.Exit();
});
AddUntilStep("stopped at exit confirm", () => Game.ChildrenOfType<DialogOverlay>().Single().CurrentDialog is ConfirmExitDialog);
}
[Test]
public void TestExitGameFromSongSelect()
{