mirror of https://github.com/ppy/osu
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 @@ public void TestFromSongSelectDifferentRuleset()
|
|||
|
||||
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());
|
||||
AddUntilStep("wait for menu", () => Game.ScreenStack.CurrentScreen is MainMenu);
|
||||
}
|
||||
|
|
|
@ -110,6 +110,13 @@ public void TestFromSongSelectDifferentRuleset([Values] ScorePresentType type)
|
|||
|
||||
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());
|
||||
AddUntilStep("wait for menu", () => Game.ScreenStack.CurrentScreen is MainMenu);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue