mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 08:49:59 +09:00
Fix regressions in tests
This commit is contained in:
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Screens;
|
using osu.Framework.Screens;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Screens.Play;
|
using osu.Game.Screens.Play;
|
||||||
@ -12,28 +13,37 @@ namespace osu.Game.Tests.Visual
|
|||||||
public class TestCasePlayerLoader : ManualInputManagerTestCase
|
public class TestCasePlayerLoader : ManualInputManagerTestCase
|
||||||
{
|
{
|
||||||
private PlayerLoader loader;
|
private PlayerLoader loader;
|
||||||
|
private ScreenStack stack;
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuGameBase game)
|
private void load(OsuGameBase game)
|
||||||
{
|
{
|
||||||
Beatmap.Value = new DummyWorkingBeatmap(game);
|
Beatmap.Value = new DummyWorkingBeatmap(game);
|
||||||
|
|
||||||
AddStep("load dummy beatmap", () => Add(loader = new PlayerLoader(() => new Player
|
InputManager.Add(stack = new ScreenStack { RelativeSizeAxes = Axes.Both });
|
||||||
|
|
||||||
|
AddStep("load dummy beatmap", () => stack.Push(loader = new PlayerLoader(() => new Player
|
||||||
{
|
{
|
||||||
AllowPause = false,
|
AllowPause = false,
|
||||||
AllowLeadIn = false,
|
AllowLeadIn = false,
|
||||||
AllowResults = false,
|
AllowResults = false,
|
||||||
})));
|
})));
|
||||||
|
|
||||||
|
AddUntilStep(() => loader.IsCurrentScreen(), "wait for current");
|
||||||
|
|
||||||
AddStep("mouse in centre", () => InputManager.MoveMouseTo(loader.ScreenSpaceDrawQuad.Centre));
|
AddStep("mouse in centre", () => InputManager.MoveMouseTo(loader.ScreenSpaceDrawQuad.Centre));
|
||||||
|
|
||||||
AddUntilStep(() => !loader.IsCurrentScreen(), "wait for no longer current");
|
AddUntilStep(() => !loader.IsCurrentScreen(), "wait for no longer current");
|
||||||
|
|
||||||
|
AddStep("exit loader", () => loader.Exit());
|
||||||
|
|
||||||
|
AddUntilStep(() => !loader.IsAlive, "wait for no longer alive");
|
||||||
|
|
||||||
AddStep("load slow dummy beatmap", () =>
|
AddStep("load slow dummy beatmap", () =>
|
||||||
{
|
{
|
||||||
SlowLoadPlayer slow = null;
|
SlowLoadPlayer slow = null;
|
||||||
|
|
||||||
Add(loader = new PlayerLoader(() => slow = new SlowLoadPlayer
|
stack.Push(loader = new PlayerLoader(() => slow = new SlowLoadPlayer
|
||||||
{
|
{
|
||||||
AllowPause = false,
|
AllowPause = false,
|
||||||
AllowLeadIn = false,
|
AllowLeadIn = false,
|
||||||
|
@ -32,7 +32,7 @@ namespace osu.Game.Tests.Visual
|
|||||||
// This is the earliest we can get OsuGameBase, which is used by the dummy working beatmap to find textures
|
// This is the earliest we can get OsuGameBase, which is used by the dummy working beatmap to find textures
|
||||||
beatmap.Default = new DummyWorkingBeatmap(Dependencies.Get<OsuGameBase>());
|
beatmap.Default = new DummyWorkingBeatmap(Dependencies.Get<OsuGameBase>());
|
||||||
|
|
||||||
Dependencies.CacheAs<BindableBeatmap>(beatmap);
|
Dependencies.CacheAs<Bindable<WorkingBeatmap>>(beatmap);
|
||||||
Dependencies.CacheAs<IBindable<WorkingBeatmap>>(beatmap);
|
Dependencies.CacheAs<IBindable<WorkingBeatmap>>(beatmap);
|
||||||
|
|
||||||
Dependencies.CacheAs(Ruleset);
|
Dependencies.CacheAs(Ruleset);
|
||||||
|
Reference in New Issue
Block a user