1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-13 05:22:54 +08:00

Fix regression in tournament test startup behaviour

This commit is contained in:
Dean Herbert 2021-02-13 01:10:39 +09:00
parent 7d057ab6ce
commit 13aaf766f9
2 changed files with 17 additions and 15 deletions

View File

@ -13,17 +13,18 @@ namespace osu.Game.Tournament.Tests
{
base.LoadComplete();
BracketLoadTask.Wait();
LoadComponentAsync(new Background("Menu/menu-background-0")
BracketLoadTask.ContinueWith(_ => Schedule(() =>
{
Colour = OsuColour.Gray(0.5f),
Depth = 10
}, AddInternal);
LoadComponentAsync(new Background("Menu/menu-background-0")
{
Colour = OsuColour.Gray(0.5f),
Depth = 10
}, AddInternal);
// Have to construct this here, rather than in the constructor, because
// we depend on some dependencies to be loaded within OsuGameBase.load().
Add(new TestBrowser());
// Have to construct this here, rather than in the constructor, because
// we depend on some dependencies to be loaded within OsuGameBase.load().
Add(new TestBrowser());
}));
}
}
}

View File

@ -154,12 +154,13 @@ namespace osu.Game.Tournament.Tests
protected override void LoadAsyncComplete()
{
BracketLoadTask.Wait();
// this has to be run here rather than LoadComplete because
// TestScene.cs is checking the IsLoaded state (on another thread) and expects
// the runner to be loaded at that point.
Add(runner = new TestSceneTestRunner.TestRunner());
BracketLoadTask.ContinueWith(_ => Schedule(() =>
{
// this has to be run here rather than LoadComplete because
// TestScene.cs is checking the IsLoaded state (on another thread) and expects
// the runner to be loaded at that point.
Add(runner = new TestSceneTestRunner.TestRunner());
}));
}
public void RunTestBlocking(TestScene test) => runner.RunTestBlocking(test);