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