1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-13 21:27:54 +08:00

Clear lists on room leave

This commit is contained in:
Dan Balasescu 2021-12-01 18:57:29 +09:00
parent fc8c8685b8
commit a4cd22d5a9

View File

@ -113,6 +113,19 @@ namespace osu.Game.Tests.Visual.Multiplayer
assertItemInHistoryListStep(1, 2); assertItemInHistoryListStep(1, 2);
} }
[Test]
public void TestListsClearedWhenRoomLeft()
{
addItemStep();
AddStep("finish current item", () => Client.FinishCurrentItem());
AddStep("leave room", () => RoomManager.PartRoom());
AddUntilStep("wait for room part", () => Client.Room == null);
AddUntilStep("item 0 not in lists", () => !inHistoryList(0) && !inQueueList(0));
AddUntilStep("item 1 not in lists", () => !inHistoryList(0) && !inQueueList(0));
}
[Test] [Test]
public void TestJoinRoomWithMixedItemsAddedInCorrectLists() public void TestJoinRoomWithMixedItemsAddedInCorrectLists()
{ {
@ -212,7 +225,11 @@ namespace osu.Game.Tests.Visual.Multiplayer
base.OnRoomUpdated(); base.OnRoomUpdated();
if (Room == null) if (Room == null)
{
historyList.Items.Clear();
queueList.Items.Clear();
return; return;
}
if (!firstPopulation) return; if (!firstPopulation) return;