mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 15:33:21 +08:00
Pause playback in present tests to avoid track inadvertently changing at menu
This commit is contained in:
parent
71f32a2e37
commit
e43e12cb2d
@ -74,6 +74,13 @@ namespace osu.Game.Tests.Visual.Navigation
|
|||||||
|
|
||||||
private void returnToMenu()
|
private void returnToMenu()
|
||||||
{
|
{
|
||||||
|
// if we don't pause, there's a chance the track may change at the main menu out of our control (due to reaching the end of the track).
|
||||||
|
AddStep("pause audio", () =>
|
||||||
|
{
|
||||||
|
if (Game.MusicController.IsPlaying)
|
||||||
|
Game.MusicController.TogglePause();
|
||||||
|
});
|
||||||
|
|
||||||
AddStep("return to menu", () => Game.ScreenStack.CurrentScreen.Exit());
|
AddStep("return to menu", () => Game.ScreenStack.CurrentScreen.Exit());
|
||||||
AddUntilStep("wait for menu", () => Game.ScreenStack.CurrentScreen is MainMenu);
|
AddUntilStep("wait for menu", () => Game.ScreenStack.CurrentScreen is MainMenu);
|
||||||
}
|
}
|
||||||
|
@ -110,6 +110,13 @@ namespace osu.Game.Tests.Visual.Navigation
|
|||||||
|
|
||||||
private void returnToMenu()
|
private void returnToMenu()
|
||||||
{
|
{
|
||||||
|
// if we don't pause, there's a chance the track may change at the main menu out of our control (due to reaching the end of the track).
|
||||||
|
AddStep("pause audio", () =>
|
||||||
|
{
|
||||||
|
if (Game.MusicController.IsPlaying)
|
||||||
|
Game.MusicController.TogglePause();
|
||||||
|
});
|
||||||
|
|
||||||
AddStep("return to menu", () => Game.ScreenStack.CurrentScreen.Exit());
|
AddStep("return to menu", () => Game.ScreenStack.CurrentScreen.Exit());
|
||||||
AddUntilStep("wait for menu", () => Game.ScreenStack.CurrentScreen is MainMenu);
|
AddUntilStep("wait for menu", () => Game.ScreenStack.CurrentScreen is MainMenu);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user