1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 15:07:44 +08:00

Fix test failures due to recorder not stopping in time

This commit is contained in:
Dean Herbert 2020-10-23 14:47:08 +09:00
parent e99cf369fa
commit 55f1b05dbf
2 changed files with 16 additions and 1 deletions

View File

@ -166,6 +166,12 @@ namespace osu.Game.Tests.Visual.Gameplay
playbackManager?.ReplayInputHandler.SetFrameFromTime(Time.Current - 100);
}
[TearDownSteps]
public void TearDown()
{
AddStep("stop recorder", () => recorder.Expire());
}
public class TestFramedReplayInputHandler : FramedReplayInputHandler<TestReplayFrame>
{
public TestFramedReplayInputHandler(Replay replay)

View File

@ -12,6 +12,7 @@ using osu.Framework.Graphics.Shapes;
using osu.Framework.Input.Bindings;
using osu.Framework.Input.Events;
using osu.Framework.Input.StateChanges;
using osu.Framework.Testing;
using osu.Game.Beatmaps;
using osu.Game.Graphics.Sprites;
using osu.Game.Online.Spectator;
@ -38,6 +39,8 @@ namespace osu.Game.Tests.Visual.Gameplay
private IBindableList<int> users;
private TestReplayRecorder recorder;
[Resolved]
private SpectatorStreamingClient streamingClient { get; set; }
@ -82,7 +85,7 @@ namespace osu.Game.Tests.Visual.Gameplay
{
recordingManager = new TestRulesetInputManager(new TestSceneModSettings.TestRulesetInfo(), 0, SimultaneousBindingMode.Unique)
{
Recorder = new TestReplayRecorder
Recorder = recorder = new TestReplayRecorder
{
ScreenSpaceToGamefield = pos => recordingManager.ToLocalSpace(pos),
},
@ -153,6 +156,12 @@ namespace osu.Game.Tests.Visual.Gameplay
playbackManager?.ReplayInputHandler.SetFrameFromTime(Time.Current - 100);
}
[TearDownSteps]
public void TearDown()
{
AddStep("stop recorder", () => recorder.Expire());
}
public class TestFramedReplayInputHandler : FramedReplayInputHandler<TestReplayFrame>
{
public TestFramedReplayInputHandler(Replay replay)