Merge pull request #18164 from Joehuu/fix-exit-dialog-bad-state

Fix popup dialog potentially not clicking last button when dismissed
This commit is contained in:
Dan Balasescu
2022-05-09 17:22:03 +09:00
committed by GitHub
2 changed files with 18 additions and 5 deletions

View File

@ -11,6 +11,7 @@ using osu.Framework.Graphics.Containers;
using osu.Framework.Screens;
using osu.Framework.Testing;
using osu.Game.Beatmaps;
using osu.Game.Configuration;
using osu.Game.Graphics.UserInterface;
using osu.Game.Online.Leaderboards;
using osu.Game.Overlays;
@ -503,6 +504,22 @@ namespace osu.Game.Tests.Visual.Navigation
AddStep("test dispose doesn't crash", () => Game.Dispose());
}
[Test]
public void TestRapidBackButtonExit()
{
AddStep("set hold delay to 0", () => Game.LocalConfig.SetValue(OsuSetting.UIHoldActivationDelay, 0.0));
AddStep("press escape twice rapidly", () =>
{
InputManager.Key(Key.Escape);
InputManager.Key(Key.Escape);
});
pushEscape();
AddAssert("exit dialog is shown", () => Game.Dependencies.Get<IDialogOverlay>().CurrentDialog != null);
}
private Func<Player> playToResults()
{
Player player = null;