Merge remote-tracking branch 'upstream/master' into HoutarouOreki-changelog-overlay

This commit is contained in:
Dean Herbert
2019-05-15 14:24:45 +09:00
10 changed files with 79 additions and 45 deletions

View File

@ -58,7 +58,7 @@ namespace osu.Game.Tests.Visual.Menus
bool logoVisible = false;
AddStep("begin loading", () => LoadScreen(loader = new TestLoader()));
AddWaitStep("wait", 2);
AddWaitStep("wait", 3);
AddStep("finish loading", () =>
{
logoVisible = loader.Logo?.Alpha > 0;

View File

@ -3,7 +3,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using NUnit.Framework;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
@ -23,6 +22,7 @@ using osu.Game.Online.API;
using osu.Game.Online.Chat;
using osu.Game.Overlays;
using osu.Game.Rulesets;
using osu.Game.Rulesets.Mods;
using osu.Game.Scoring;
using osu.Game.Screens.Menu;
using osu.Game.Skinning;
@ -43,8 +43,6 @@ namespace osu.Game.Tests.Visual
{
typeof(OsuGame),
typeof(RavenLogger),
typeof(Bindable<RulesetInfo>),
typeof(IBindable<RulesetInfo>),
typeof(OsuLogo),
typeof(IdleTracker),
typeof(OnScreenDisplay),
@ -60,12 +58,17 @@ namespace osu.Game.Tests.Visual
typeof(MusicController),
typeof(AccountCreationOverlay),
typeof(DialogOverlay),
typeof(ScreenshotManager)
};
private IReadOnlyList<Type> requiredGameBaseDependencies => new[]
{
typeof(OsuGameBase),
typeof(DatabaseContextFactory),
typeof(Bindable<RulesetInfo>),
typeof(IBindable<RulesetInfo>),
typeof(Bindable<IReadOnlyList<Mod>>),
typeof(IBindable<IReadOnlyList<Mod>>),
typeof(LargeTextureStore),
typeof(OsuConfigManager),
typeof(SkinManager),
@ -86,7 +89,7 @@ namespace osu.Game.Tests.Visual
};
[BackgroundDependencyLoader]
private void load(GameHost host)
private void load(GameHost host, OsuGameBase gameBase)
{
OsuGame game = new OsuGame();
game.SetHost(host);
@ -103,8 +106,22 @@ namespace osu.Game.Tests.Visual
AddUntilStep("wait for load", () => game.IsLoaded);
AddAssert("check OsuGame DI members", () => requiredGameDependencies.All(d => game.Dependencies.Get(d) != null));
AddAssert("check OsuGameBase DI members", () => requiredGameBaseDependencies.All(d => Dependencies.Get(d) != null));
AddAssert("check OsuGame DI members", () =>
{
foreach (var type in requiredGameDependencies)
if (game.Dependencies.Get(type) == null)
throw new Exception($"{type} has not been cached");
return true;
});
AddAssert("check OsuGameBase DI members", () =>
{
foreach (var type in requiredGameBaseDependencies)
if (gameBase.Dependencies.Get(type) == null)
throw new Exception($"{type} has not been cached");
return true;
});
}
}
}

View File

@ -9,7 +9,7 @@ using osuTK.Graphics;
namespace osu.Game.Tests.Visual.UserInterface
{
public class TestCaseLoadingAnimation : GridTestCase
public class TestCaseLoadingAnimation : GridTestScene //todo: this should be an OsuTestCase
{
public TestCaseLoadingAnimation()
: base(2, 2)

View File

@ -9,7 +9,6 @@ using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Cursor;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Testing;
using osu.Game.Graphics;
using osuTK;
using osuTK.Graphics;
@ -17,7 +16,7 @@ using osuTK.Graphics;
namespace osu.Game.Tests.Visual.UserInterface
{
[TestFixture]
public class TestCaseOsuIcon : TestCase
public class TestCaseOsuIcon : OsuTestCase
{
public TestCaseOsuIcon()
{