mirror of
https://github.com/ppy/osu.git
synced 2025-01-19 19:13:21 +08:00
Add failing test covering exit dialog crash
This commit is contained in:
parent
50e6f0aee9
commit
72bf43e297
@ -722,6 +722,33 @@ namespace osu.Game.Tests.Visual.Navigation
|
|||||||
AddUntilStep("Wait for game exit", () => Game.ScreenStack.CurrentScreen == null);
|
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]
|
[Test]
|
||||||
public void TestExitGameFromSongSelect()
|
public void TestExitGameFromSongSelect()
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user