From 528298bc39a07f7f5f75f5cb3931b0f6a283b3b9 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 1 Aug 2023 07:17:12 +0900 Subject: [PATCH] Update test in line with framework changes --- .../TestSceneUpdateableBeatmapSetCover.cs | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/osu.Game.Tests/Visual/UserInterface/TestSceneUpdateableBeatmapSetCover.cs b/osu.Game.Tests/Visual/UserInterface/TestSceneUpdateableBeatmapSetCover.cs index a1a546d4a7..54532001a9 100644 --- a/osu.Game.Tests/Visual/UserInterface/TestSceneUpdateableBeatmapSetCover.cs +++ b/osu.Game.Tests/Visual/UserInterface/TestSceneUpdateableBeatmapSetCover.cs @@ -99,16 +99,18 @@ public void TestSetNullBeatmapWhileLoading() { TestUpdateableOnlineBeatmapSetCover updateableCover = null; - AddStep("setup cover", () => Child = updateableCover = new TestUpdateableOnlineBeatmapSetCover + AddStep("setup cover", () => Child = updateableCover = new TestUpdateableOnlineBeatmapSetCover(400) { OnlineInfo = CreateAPIBeatmapSet(), RelativeSizeAxes = Axes.Both, Masking = true, }); - AddStep("change model", () => updateableCover.OnlineInfo = null); - AddWaitStep("wait some", 5); - AddAssert("no cover added", () => !updateableCover.ChildrenOfType().Any()); + AddStep("change model to null", () => updateableCover.OnlineInfo = null); + + AddUntilStep("wait for load", () => updateableCover.DelayedLoadFinished); + + AddAssert("no cover added", () => !updateableCover.ChildrenOfType().Any()); } [Test] @@ -143,11 +145,19 @@ private partial class TestUpdateableOnlineBeatmapSetCover : UpdateableOnlineBeat { private readonly int loadDelay; + public bool DelayedLoadFinished; + public TestUpdateableOnlineBeatmapSetCover(int loadDelay = 10000) { this.loadDelay = loadDelay; } + protected override void OnLoadFinished() + { + base.OnLoadFinished(); + DelayedLoadFinished = true; + } + protected override Drawable CreateDrawable(IBeatmapSetOnlineInfo model) { if (model == null)