1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 09:27:29 +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;
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<DelayedLoadUnloadWrapper>().Any());
AddStep("change model to null", () => updateableCover.OnlineInfo = null);
AddUntilStep("wait for load", () => updateableCover.DelayedLoadFinished);
AddAssert("no cover added", () => !updateableCover.ChildrenOfType<TestOnlineBeatmapSetCover>().Any());
}
[Test]
@ -143,11 +145,19 @@ namespace osu.Game.Tests.Visual.UserInterface
{
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)