mirror of
https://github.com/osukey/osukey.git
synced 2025-08-03 22:56:36 +09:00
Purge final spectator frames before ending play
This commit is contained in:
@ -15,11 +15,14 @@ using osu.Game.Online.Spectator;
|
||||
using osu.Game.Rulesets.Osu;
|
||||
using osu.Game.Rulesets.Osu.Replays;
|
||||
using osu.Game.Rulesets.UI;
|
||||
using osu.Game.Scoring;
|
||||
using osu.Game.Screens;
|
||||
using osu.Game.Screens.Play;
|
||||
using osu.Game.Tests.Beatmaps;
|
||||
using osu.Game.Tests.Beatmaps.IO;
|
||||
using osu.Game.Tests.Visual.Multiplayer;
|
||||
using osu.Game.Tests.Visual.Spectator;
|
||||
using osuTK;
|
||||
|
||||
namespace osu.Game.Tests.Visual.Gameplay
|
||||
{
|
||||
@ -200,6 +203,21 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
AddAssert("screen didn't change", () => Stack.CurrentScreen is SoloSpectator);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestFinalFramesPurgedBeforeEndingPlay()
|
||||
{
|
||||
AddStep("begin playing", () => spectatorClient.BeginPlaying(new GameplayState(new TestBeatmap(new OsuRuleset().RulesetInfo), new OsuRuleset()), new Score()));
|
||||
|
||||
AddStep("send frames and finish play", () =>
|
||||
{
|
||||
spectatorClient.HandleFrame(new OsuReplayFrame(1000, Vector2.Zero));
|
||||
spectatorClient.EndPlaying();
|
||||
});
|
||||
|
||||
// We can't access API because we're an "online" test.
|
||||
AddAssert("last received frame has time = 1000", () => spectatorClient.LastReceivedFrame.First().Value.Time == 1000);
|
||||
}
|
||||
|
||||
private OsuFramedReplayInputHandler replayHandler =>
|
||||
(OsuFramedReplayInputHandler)Stack.ChildrenOfType<OsuInputManager>().First().ReplayInputHandler;
|
||||
|
||||
|
Reference in New Issue
Block a user