Fix TimelineTestScene's beatmap getting overwritten by EditorClockTestScene

This commit is contained in:
Dean Herbert 2022-08-26 18:38:52 +09:00
parent cd90536e4b
commit 9c9238d6e8
2 changed files with 13 additions and 11 deletions

View File

@ -17,8 +17,6 @@ namespace osu.Game.Tests.Visual.Editing
{
double initialVisibleRange = 0;
AddUntilStep("wait for load", () => MusicController.TrackLoaded);
AddStep("reset zoom", () => TimelineArea.Timeline.Zoom = 100);
AddStep("get initial range", () => initialVisibleRange = TimelineArea.Timeline.VisibleRange);
@ -36,8 +34,6 @@ namespace osu.Game.Tests.Visual.Editing
{
double initialVisibleRange = 0;
AddUntilStep("wait for load", () => MusicController.TrackLoaded);
AddStep("reset timeline size", () => TimelineArea.Timeline.Width = 1);
AddStep("get initial range", () => initialVisibleRange = TimelineArea.Timeline.VisibleRange);

View File

@ -9,12 +9,14 @@ using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Testing;
using osu.Game.Beatmaps;
using osu.Game.Graphics.Cursor;
using osu.Game.Graphics.UserInterface;
using osu.Game.Rulesets.Edit;
using osu.Game.Screens.Edit;
using osu.Game.Screens.Edit.Compose.Components.Timeline;
using osu.Game.Storyboards;
using osuTK;
using osuTK.Graphics;
@ -28,10 +30,14 @@ namespace osu.Game.Tests.Visual.Editing
protected EditorBeatmap EditorBeatmap { get; private set; }
[BackgroundDependencyLoader]
private void load(AudioManager audio)
[Resolved]
private AudioManager audio { get; set; }
protected override WorkingBeatmap CreateWorkingBeatmap(IBeatmap beatmap, Storyboard storyboard = null) => new WaveformTestBeatmap(audio);
protected override void LoadComplete()
{
Beatmap.Value = new WaveformTestBeatmap(audio);
base.LoadComplete();
var playable = Beatmap.Value.GetPlayableBeatmap(Beatmap.Value.BeatmapInfo.Ruleset);
EditorBeatmap = new EditorBeatmap(playable);
@ -68,11 +74,11 @@ namespace osu.Game.Tests.Visual.Editing
});
}
protected override void LoadComplete()
[SetUpSteps]
public void SetUpSteps()
{
base.LoadComplete();
EditorClock.Seek(2500);
AddUntilStep("wait for track loaded", () => MusicController.TrackLoaded);
AddStep("seek forward", () => EditorClock.Seek(2500));
}
public abstract Drawable CreateTestComponent();