Add test coverage of SpectatorPlayer failing to seek on inopportune frame arrival time

This commit is contained in:
Dean Herbert
2022-03-17 19:23:49 +09:00
parent dae5569e36
commit 63998ad9f1
2 changed files with 55 additions and 4 deletions

View File

@ -88,7 +88,8 @@ namespace osu.Game.Tests.Visual.Spectator
/// </summary>
/// <param name="userId">The user to send frames for.</param>
/// <param name="count">The total number of frames to send.</param>
public void SendFramesFromUser(int userId, int count)
/// <param name="startTime">The time to start gameplay frames from.</param>
public void SendFramesFromUser(int userId, int count, double startTime = 0)
{
var frames = new List<LegacyReplayFrame>();
@ -102,7 +103,7 @@ namespace osu.Game.Tests.Visual.Spectator
flush();
var buttonState = currentFrameIndex == lastFrameIndex ? ReplayButtonState.None : ReplayButtonState.Left1;
frames.Add(new LegacyReplayFrame(currentFrameIndex * 100, RNG.Next(0, 512), RNG.Next(0, 512), buttonState));
frames.Add(new LegacyReplayFrame(currentFrameIndex * 100 + startTime, RNG.Next(0, 512), RNG.Next(0, 512), buttonState));
}
flush();