Fix headless test

This commit is contained in:
jkh675 2024-08-04 23:45:42 +08:00
parent 2720bcf285
commit 1b25633e47
2 changed files with 8 additions and 16 deletions

View File

@ -33,20 +33,16 @@ namespace osu.Game.Rulesets.Mania.Tests.Editor
{
private TestComposer composer;
[Cached]
public readonly OsuContextMenuContainer ContextMenuContainer = new OsuContextMenuContainer();
[SetUp]
public void Setup() => Schedule(() =>
{
BeatDivisor.Value = 8;
EditorClock.Seek(0);
Child = new DependencyProvidingContainer
{
CachedDependencies = new (Type, object)[]
{
(typeof(OsuContextMenuContainer), new OsuContextMenuContainer()),
},
Child = composer = new TestComposer { RelativeSizeAxes = Axes.Both },
};
Child = composer = new TestComposer { RelativeSizeAxes = Axes.Both };
});
[Test]

View File

@ -33,6 +33,9 @@ namespace osu.Game.Tests.Editing
[Cached(typeof(IBeatSnapProvider))]
private readonly EditorBeatmap editorBeatmap;
[Cached]
public readonly OsuContextMenuContainer ContextMenuContainer = new OsuContextMenuContainer();
protected override Container<Drawable> Content { get; } = new PopoverContainer { RelativeSizeAxes = Axes.Both };
public TestSceneHitObjectComposerDistanceSnapping()
@ -54,14 +57,7 @@ namespace osu.Game.Tests.Editing
[SetUp]
public void Setup() => Schedule(() =>
{
Child = new DependencyProvidingContainer
{
CachedDependencies = new (Type, object)[]
{
(typeof(OsuContextMenuContainer), new OsuContextMenuContainer()),
},
Child = composer = new TestHitObjectComposer(),
};
Child = composer = new TestHitObjectComposer();
BeatDivisor.Value = 1;