Add test coverage of more advanced frame delivery scenarios to TestSceneSpectatorPlayback

This commit is contained in:
Dean Herbert
2022-02-24 02:18:42 +09:00
parent 47b84295a6
commit 260cf793fe
2 changed files with 51 additions and 10 deletions

View File

@ -30,6 +30,8 @@ namespace osu.Game.Tests.Visual.Spectator
/// </summary>
public bool ShouldFailSendingFrames { get; set; }
public int FrameSendAttempts { get; private set; }
public override IBindable<bool> IsConnected { get; } = new Bindable<bool>(true);
public IReadOnlyDictionary<int, ReplayFrame> LastReceivedUserFrames => lastReceivedUserFrames;
@ -130,6 +132,8 @@ namespace osu.Game.Tests.Visual.Spectator
protected override Task SendFramesInternal(FrameDataBundle bundle)
{
FrameSendAttempts++;
if (ShouldFailSendingFrames)
return Task.FromException(new InvalidOperationException());