1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-12 04:49:40 +08:00

Merge pull request #19041 from smoogipoo/fix-music-tests

Fix intermittent MusicController tests
This commit is contained in:
Dean Herbert 2022-07-08 15:01:32 +09:00 committed by GitHub
commit 5454171de1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -24,10 +24,11 @@ namespace osu.Game.Tests.Visual.Menus
public void TestMusicPlayAction() public void TestMusicPlayAction()
{ {
AddStep("ensure playing something", () => Game.MusicController.EnsurePlayingSomething()); AddStep("ensure playing something", () => Game.MusicController.EnsurePlayingSomething());
AddUntilStep("music playing", () => Game.MusicController.IsPlaying);
AddStep("toggle playback", () => globalActionContainer.TriggerPressed(GlobalAction.MusicPlay)); AddStep("toggle playback", () => globalActionContainer.TriggerPressed(GlobalAction.MusicPlay));
AddAssert("music paused", () => !Game.MusicController.IsPlaying && Game.MusicController.UserPauseRequested); AddUntilStep("music paused", () => !Game.MusicController.IsPlaying && Game.MusicController.UserPauseRequested);
AddStep("toggle playback", () => globalActionContainer.TriggerPressed(GlobalAction.MusicPlay)); AddStep("toggle playback", () => globalActionContainer.TriggerPressed(GlobalAction.MusicPlay));
AddAssert("music resumed", () => Game.MusicController.IsPlaying && !Game.MusicController.UserPauseRequested); AddUntilStep("music resumed", () => Game.MusicController.IsPlaying && !Game.MusicController.UserPauseRequested);
} }
[Test] [Test]