1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 14:57:52 +08:00

Add local preserving container to OsuTestScene to ensure correct test dimensions

This commit is contained in:
Dean Herbert 2019-11-11 13:49:12 +09:00
parent cceb982f57
commit dc88bd3d61

View File

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