mirror of
https://github.com/osukey/osukey.git
synced 2025-08-05 15:44:04 +09:00
Add test case for resuming PlayerLoader
This commit is contained in:
@ -223,6 +223,26 @@ namespace osu.Game.Tests.Visual
|
|||||||
AddAssert("Screen is undimmed and user blur removed", () => songSelect.IsBackgroundUndimmed() && songSelect.IsBlurCorrect());
|
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 waitForDim() => AddWaitStep("Wait for dim", 5);
|
||||||
|
|
||||||
private void createFakeStoryboard() => AddStep("Create storyboard", () =>
|
private void createFakeStoryboard() => AddStep("Create storyboard", () =>
|
||||||
|
@ -211,8 +211,6 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
public override void OnSuspending(IScreen next)
|
public override void OnSuspending(IScreen next)
|
||||||
{
|
{
|
||||||
Background.EnableUserDim.Value = true;
|
|
||||||
|
|
||||||
base.OnSuspending(next);
|
base.OnSuspending(next);
|
||||||
cancelLoad();
|
cancelLoad();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user