1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 16:12:57 +08:00

Fix SlowLoadPlayer potentially not being instantiated in time for test

This commit is contained in:
Dean Herbert 2021-05-26 18:58:18 +09:00
parent 1e77a87fab
commit a77de24746

View File

@ -176,11 +176,9 @@ namespace osu.Game.Tests.Visual.Gameplay
{
SlowLoadPlayer slowPlayer = null;
AddStep("load slow dummy beatmap", () =>
{
LoadScreen(loader = new TestPlayerLoader(() => slowPlayer = new SlowLoadPlayer(false, false)));
Scheduler.AddDelayed(() => slowPlayer.AllowLoad.Set(), 5000);
});
AddStep("load slow dummy beatmap", () => LoadScreen(loader = new TestPlayerLoader(() => slowPlayer = new SlowLoadPlayer(false, false))));
AddUntilStep("wait for slow player to be instantiated", () => slowPlayer != null);
AddStep("schedule slow load", () => Scheduler.AddDelayed(() => slowPlayer.AllowLoad.Set(), 5000));
AddUntilStep("wait for player to be current", () => slowPlayer.IsCurrentScreen());
}