Seek track instead

This commit is contained in:
smoogipoo
2019-06-14 19:35:31 +09:00
parent f12caaf907
commit 4972f862e6

View File

@ -6,6 +6,7 @@ using System.Linq;
using NUnit.Framework; using NUnit.Framework;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Audio; using osu.Framework.Audio;
using osu.Framework.Audio.Track;
using osu.Framework.MathUtils; using osu.Framework.MathUtils;
using osu.Framework.Timing; using osu.Framework.Timing;
using osu.Game.Beatmaps; using osu.Game.Beatmaps;
@ -31,8 +32,14 @@ namespace osu.Game.Tests.Visual.Gameplay
{ {
} }
private Track track;
protected override WorkingBeatmap CreateWorkingBeatmap(IBeatmap beatmap) protected override WorkingBeatmap CreateWorkingBeatmap(IBeatmap beatmap)
=> new ClockBackedTestWorkingBeatmap(beatmap, new FramedClock(new ManualClock { Rate = 1 }), audioManager); {
var working = new ClockBackedTestWorkingBeatmap(beatmap, new FramedClock(new ManualClock { Rate = 1 }), audioManager);
track = working.Track;
return working;
}
[Test] [Test]
public void TestNotJudgementsOnRewind() public void TestNotJudgementsOnRewind()
@ -47,7 +54,7 @@ namespace osu.Game.Tests.Visual.Gameplay
private void addSeekStep(double time) private void addSeekStep(double time)
{ {
AddStep($"seek to {time}", () => player.GameplayClockContainer.Seek(time)); AddStep($"seek to {time}", () => track.Seek(time));
// Allow a few frames of lenience // Allow a few frames of lenience
AddUntilStep("wait for seek to finish", () => Precision.AlmostEquals(time, player.DrawableRuleset.FrameStableClock.CurrentTime, 100)); AddUntilStep("wait for seek to finish", () => Precision.AlmostEquals(time, player.DrawableRuleset.FrameStableClock.CurrentTime, 100));