1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 12:33:01 +08:00

Add local preserving container to OsuTestScene to ensure correc… (#6805)

Add local preserving container to OsuTestScene to ensure correct test dimensions
This commit is contained in:
Dean Herbert 2019-11-12 16:40:40 +09:00 committed by GitHub
commit 0113ab5e56
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -10,6 +10,8 @@ using osu.Framework.Allocation;
using osu.Framework.Audio; using osu.Framework.Audio;
using osu.Framework.Audio.Track; using osu.Framework.Audio.Track;
using osu.Framework.Bindables; using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Textures; using osu.Framework.Graphics.Textures;
using osu.Framework.Platform; using osu.Framework.Platform;
using osu.Framework.Testing; using osu.Framework.Testing;
@ -93,6 +95,10 @@ namespace osu.Game.Tests.Visual
return Dependencies; return Dependencies;
} }
protected override Container<Drawable> Content => content ?? base.Content;
private readonly Container content;
protected OsuTestScene() protected OsuTestScene()
{ {
localStorage = new Lazy<Storage>(() => new NativeStorage($"{GetType().Name}-{Guid.NewGuid()}")); localStorage = new Lazy<Storage>(() => new NativeStorage($"{GetType().Name}-{Guid.NewGuid()}"));
@ -104,6 +110,8 @@ namespace osu.Game.Tests.Visual
usage.Migrate(); usage.Migrate();
return factory; return factory;
}); });
base.Content.Add(content = new DrawSizePreservingFillContainer());
} }
[Resolved] [Resolved]