1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-24 16:17:23 +08:00

Ensure frames arrive

This commit is contained in:
Dean Herbert 2020-10-27 14:47:15 +09:00
parent 593b0a3ada
commit 400542bc0b
2 changed files with 10 additions and 1 deletions

View File

@ -9,6 +9,8 @@ using osu.Framework.Testing;
using osu.Game.Beatmaps;
using osu.Game.Online.Spectator;
using osu.Game.Replays.Legacy;
using osu.Game.Rulesets.Osu;
using osu.Game.Rulesets.Osu.Replays;
using osu.Game.Screens.Play;
using osu.Game.Tests.Beatmaps.IO;
using osu.Game.Users;
@ -38,12 +40,19 @@ namespace osu.Game.Tests.Visual.Gameplay
});
}
private OsuFramedReplayInputHandler replayHandler =>
(OsuFramedReplayInputHandler)Stack.ChildrenOfType<OsuInputManager>().First().ReplayInputHandler;
[Test]
public void TestBasicSpectatingFlow()
{
beginSpectating();
AddStep("start play", () => testSpectatorStreamingClient.StartPlay());
AddStep("send frames", () => testSpectatorStreamingClient.SendFrames());
AddUntilStep("wait for player", () => Stack.CurrentScreen is Player);
AddAssert("ensure frames arrived", () => replayHandler.HasFrames);
}
[Test]

View File

@ -82,7 +82,7 @@ namespace osu.Game.Rulesets.Replays
/// </summary>
public bool FrameAccuratePlayback = false;
protected bool HasFrames => Frames.Count > 0;
public bool HasFrames => Frames.Count > 0;
private bool inImportantSection
{