mirror of
https://github.com/osukey/osukey.git
synced 2025-08-08 09:03:50 +09:00
Merge pull request #7917 from smoogipoo/fix-drawableroom-async-test
Fix possible test failures due to async loads
This commit is contained in:
@ -28,7 +28,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
|||||||
typeof(DrawableRoomPlaylistItem)
|
typeof(DrawableRoomPlaylistItem)
|
||||||
};
|
};
|
||||||
|
|
||||||
private DrawableRoomPlaylist playlist;
|
private TestPlaylist playlist;
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestNonEditableNonSelectable()
|
public void TestNonEditableNonSelectable()
|
||||||
@ -211,9 +211,11 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
|||||||
private void assertDeleteButtonVisibility(int index, bool visible)
|
private void assertDeleteButtonVisibility(int index, bool visible)
|
||||||
=> AddAssert($"delete button {index} {(visible ? "is" : "is not")} visible", () => (playlist.ChildrenOfType<IconButton>().ElementAt(2 + index * 2).Alpha > 0) == visible);
|
=> AddAssert($"delete button {index} {(visible ? "is" : "is not")} visible", () => (playlist.ChildrenOfType<IconButton>().ElementAt(2 + index * 2).Alpha > 0) == visible);
|
||||||
|
|
||||||
private void createPlaylist(bool allowEdit, bool allowSelection) => AddStep("create playlist", () =>
|
private void createPlaylist(bool allowEdit, bool allowSelection)
|
||||||
{
|
{
|
||||||
Child = playlist = new DrawableRoomPlaylist(allowEdit, allowSelection)
|
AddStep("create playlist", () =>
|
||||||
|
{
|
||||||
|
Child = playlist = new TestPlaylist(allowEdit, allowSelection)
|
||||||
{
|
{
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
@ -236,5 +238,18 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
AddUntilStep("wait for items to load", () => playlist.ItemMap.Values.All(i => i.IsLoaded));
|
||||||
|
}
|
||||||
|
|
||||||
|
private class TestPlaylist : DrawableRoomPlaylist
|
||||||
|
{
|
||||||
|
public new IReadOnlyDictionary<PlaylistItem, RearrangeableListItem<PlaylistItem>> ItemMap => base.ItemMap;
|
||||||
|
|
||||||
|
public TestPlaylist(bool allowEdit, bool allowSelection)
|
||||||
|
: base(allowEdit, allowSelection)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user