1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-06 07:42:55 +08:00

Update test in line with framework changes

This commit is contained in:
Dean Herbert 2023-08-01 07:17:12 +09:00
parent d78cc60851
commit 528298bc39

View File

@ -99,16 +99,18 @@ namespace osu.Game.Tests.Visual.UserInterface
{ {
TestUpdateableOnlineBeatmapSetCover updateableCover = null; TestUpdateableOnlineBeatmapSetCover updateableCover = null;
AddStep("setup cover", () => Child = updateableCover = new TestUpdateableOnlineBeatmapSetCover AddStep("setup cover", () => Child = updateableCover = new TestUpdateableOnlineBeatmapSetCover(400)
{ {
OnlineInfo = CreateAPIBeatmapSet(), OnlineInfo = CreateAPIBeatmapSet(),
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Masking = true, Masking = true,
}); });
AddStep("change model", () => updateableCover.OnlineInfo = null); AddStep("change model to null", () => updateableCover.OnlineInfo = null);
AddWaitStep("wait some", 5);
AddAssert("no cover added", () => !updateableCover.ChildrenOfType<DelayedLoadUnloadWrapper>().Any()); AddUntilStep("wait for load", () => updateableCover.DelayedLoadFinished);
AddAssert("no cover added", () => !updateableCover.ChildrenOfType<TestOnlineBeatmapSetCover>().Any());
} }
[Test] [Test]
@ -143,11 +145,19 @@ namespace osu.Game.Tests.Visual.UserInterface
{ {
private readonly int loadDelay; private readonly int loadDelay;
public bool DelayedLoadFinished;
public TestUpdateableOnlineBeatmapSetCover(int loadDelay = 10000) public TestUpdateableOnlineBeatmapSetCover(int loadDelay = 10000)
{ {
this.loadDelay = loadDelay; this.loadDelay = loadDelay;
} }
protected override void OnLoadFinished()
{
base.OnLoadFinished();
DelayedLoadFinished = true;
}
protected override Drawable CreateDrawable(IBeatmapSetOnlineInfo model) protected override Drawable CreateDrawable(IBeatmapSetOnlineInfo model)
{ {
if (model == null) if (model == null)