1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 03:22:57 +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(); base.LoadComplete();
BracketLoadTask.Wait(); BracketLoadTask.ContinueWith(_ => Schedule(() =>
LoadComponentAsync(new Background("Menu/menu-background-0")
{ {
Colour = OsuColour.Gray(0.5f), LoadComponentAsync(new Background("Menu/menu-background-0")
Depth = 10 {
}, AddInternal); Colour = OsuColour.Gray(0.5f),
Depth = 10
}, AddInternal);
// Have to construct this here, rather than in the constructor, because // Have to construct this here, rather than in the constructor, because
// we depend on some dependencies to be loaded within OsuGameBase.load(). // we depend on some dependencies to be loaded within OsuGameBase.load().
Add(new TestBrowser()); Add(new TestBrowser());
}));
} }
} }
} }

View File

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