Fix TestSceneEditorSummaryTimeline not displaying actual beatmap content

This commit is contained in:
Dean Herbert 2021-04-15 16:30:02 +09:00
parent ed14e01401
commit dd9a142e89

View File

@ -4,6 +4,7 @@
using NUnit.Framework; using NUnit.Framework;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Game.Beatmaps;
using osu.Game.Rulesets.Osu; using osu.Game.Rulesets.Osu;
using osu.Game.Rulesets.Osu.Beatmaps; using osu.Game.Rulesets.Osu.Beatmaps;
using osu.Game.Screens.Edit; using osu.Game.Screens.Edit;
@ -16,12 +17,21 @@ namespace osu.Game.Tests.Visual.Editing
public class TestSceneEditorSummaryTimeline : EditorClockTestScene public class TestSceneEditorSummaryTimeline : EditorClockTestScene
{ {
[Cached(typeof(EditorBeatmap))] [Cached(typeof(EditorBeatmap))]
private readonly EditorBeatmap editorBeatmap = new EditorBeatmap(new OsuBeatmap()); private readonly EditorBeatmap editorBeatmap;
[BackgroundDependencyLoader] public TestSceneEditorSummaryTimeline()
private void load()
{ {
Beatmap.Value = CreateWorkingBeatmap(new OsuRuleset().RulesetInfo); editorBeatmap = new EditorBeatmap(CreateBeatmap(new OsuRuleset().RulesetInfo));
}
protected override void LoadComplete()
{
base.LoadComplete();
AddStep("create timeline", () =>
{
// required for track
Beatmap.Value = CreateWorkingBeatmap(editorBeatmap.PlayableBeatmap);
Add(new SummaryTimeline Add(new SummaryTimeline
{ {
@ -29,6 +39,7 @@ namespace osu.Game.Tests.Visual.Editing
Origin = Anchor.Centre, Origin = Anchor.Centre,
Size = new Vector2(500, 50) Size = new Vector2(500, 50)
}); });
});
} }
} }
} }