mirror of
https://github.com/ppy/osu
synced 2025-01-12 17:19:38 +00:00
Add visualtest to check if Track loops in Welcome
This commit is contained in:
parent
444504f2b9
commit
0c4b06b485
@ -19,10 +19,10 @@ namespace osu.Game.Tests.Visual.Menus
|
||||
[Cached]
|
||||
private OsuLogo logo;
|
||||
|
||||
protected OsuScreenStack IntroStack;
|
||||
|
||||
protected IntroTestScene()
|
||||
{
|
||||
OsuScreenStack introStack = null;
|
||||
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new Box
|
||||
@ -45,17 +45,17 @@ namespace osu.Game.Tests.Visual.Menus
|
||||
logo.FinishTransforms();
|
||||
logo.IsTracking = false;
|
||||
|
||||
introStack?.Expire();
|
||||
IntroStack?.Expire();
|
||||
|
||||
Add(introStack = new OsuScreenStack
|
||||
Add(IntroStack = new OsuScreenStack
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
});
|
||||
|
||||
introStack.Push(CreateScreen());
|
||||
IntroStack.Push(CreateScreen());
|
||||
});
|
||||
|
||||
AddUntilStep("wait for menu", () => introStack.CurrentScreen is MainMenu);
|
||||
AddUntilStep("wait for menu", () => IntroStack.CurrentScreen is MainMenu);
|
||||
}
|
||||
|
||||
protected abstract IScreen CreateScreen();
|
||||
|
@ -11,5 +11,18 @@ namespace osu.Game.Tests.Visual.Menus
|
||||
public class TestSceneIntroWelcome : IntroTestScene
|
||||
{
|
||||
protected override IScreen CreateScreen() => new IntroWelcome();
|
||||
|
||||
public TestSceneIntroWelcome()
|
||||
{
|
||||
AddAssert("check if menu music loops", () =>
|
||||
{
|
||||
var menu = IntroStack?.CurrentScreen as MainMenu;
|
||||
|
||||
if (menu == null)
|
||||
return false;
|
||||
|
||||
return menu.Track.Looping;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user