1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 05:27:23 +08:00

Add test case for resuming PlayerLoader

This commit is contained in:
David Zhao 2019-03-20 17:18:42 +09:00
parent a5916f995e
commit fbfef844de
2 changed files with 20 additions and 2 deletions

View File

@ -223,6 +223,26 @@ namespace osu.Game.Tests.Visual
AddAssert("Screen is undimmed and user blur removed", () => songSelect.IsBackgroundUndimmed() && songSelect.IsBlurCorrect());
}
/// <summary>
/// Check if hovering on the visual settings dialogue after resuming from player still previews the background dim.
/// </summary>
[Test]
public void ResumeFromPlayerTest()
{
performFullSetup();
AddStep("Move mouse to Visual Settings", () => InputManager.MoveMouseTo(playerLoader.VisualSettingsPos));
AddStep("Resume PlayerLoader", () =>
{
player.ValidForResume = false;
player.RestartRequested?.Invoke();
player.Exit();
});
waitForDim();
AddAssert("Screen is dimmed and blur applied", () => songSelect.IsBackgroundDimmed() && songSelect.IsUserBlurApplied());
AddStep("Move mouse to center of screen", () => InputManager.MoveMouseTo(playerLoader.ScreenPos));
AddAssert("Screen is undimmed and user blur removed", () => songSelect.IsBackgroundUndimmed() && playerLoader.IsBlurCorrect());
}
private void waitForDim() => AddWaitStep("Wait for dim", 5);
private void createFakeStoryboard() => AddStep("Create storyboard", () =>

View File

@ -211,8 +211,6 @@ namespace osu.Game.Screens.Play
public override void OnSuspending(IScreen next)
{
Background.EnableUserDim.Value = true;
base.OnSuspending(next);
cancelLoad();
}