mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 14:17:26 +08: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]
|
[Cached]
|
||||||
private OsuLogo logo;
|
private OsuLogo logo;
|
||||||
|
|
||||||
|
protected OsuScreenStack IntroStack;
|
||||||
|
|
||||||
protected IntroTestScene()
|
protected IntroTestScene()
|
||||||
{
|
{
|
||||||
OsuScreenStack introStack = null;
|
|
||||||
|
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
new Box
|
new Box
|
||||||
@ -45,17 +45,17 @@ namespace osu.Game.Tests.Visual.Menus
|
|||||||
logo.FinishTransforms();
|
logo.FinishTransforms();
|
||||||
logo.IsTracking = false;
|
logo.IsTracking = false;
|
||||||
|
|
||||||
introStack?.Expire();
|
IntroStack?.Expire();
|
||||||
|
|
||||||
Add(introStack = new OsuScreenStack
|
Add(IntroStack = new OsuScreenStack
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
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();
|
protected abstract IScreen CreateScreen();
|
||||||
|
@ -11,5 +11,18 @@ namespace osu.Game.Tests.Visual.Menus
|
|||||||
public class TestSceneIntroWelcome : IntroTestScene
|
public class TestSceneIntroWelcome : IntroTestScene
|
||||||
{
|
{
|
||||||
protected override IScreen CreateScreen() => new IntroWelcome();
|
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