From ad9584e6586f73684702bfdc128b95f53008d199 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 24 Jul 2025 13:23:27 +0900 Subject: [PATCH] Remove duplicate test --- .../Navigation/TestSceneScreenNavigation.cs | 60 ------------------- .../TestSceneSongSelectNavigation.cs | 24 ++++++++ 2 files changed, 24 insertions(+), 60 deletions(-) diff --git a/osu.Game.Tests/Visual/Navigation/TestSceneScreenNavigation.cs b/osu.Game.Tests/Visual/Navigation/TestSceneScreenNavigation.cs index 62ef4fb9d5..466fbf92a8 100644 --- a/osu.Game.Tests/Visual/Navigation/TestSceneScreenNavigation.cs +++ b/osu.Game.Tests/Visual/Navigation/TestSceneScreenNavigation.cs @@ -697,44 +697,6 @@ namespace osu.Game.Tests.Visual.Navigation AddUntilStep("wait for score panel removal", () => scorePanel.Parent == null); } - [TestCase(true)] - [TestCase(false)] - public void TestSongContinuesAfterExitPlayer(bool withUserPause) - { - Player player = null; - - IWorkingBeatmap beatmap() => Game.Beatmap.Value; - - Screens.SelectV2.SongSelect songSelect = null; - PushAndConfirm(() => songSelect = new SoloSongSelect()); - AddUntilStep("wait for song select", () => songSelect.CarouselItemsPresented); - - AddStep("import beatmap", () => BeatmapImportHelper.LoadOszIntoOsu(Game, virtualTrack: true).WaitSafely()); - - AddUntilStep("wait for selected", () => !Game.Beatmap.IsDefault); - - if (withUserPause) - AddStep("pause", () => Game.Dependencies.Get().Stop(true)); - - AddStep("press enter", () => InputManager.Key(Key.Enter)); - - AddUntilStep("wait for player", () => - { - DismissAnyNotifications(); - return (player = Game.ScreenStack.CurrentScreen as Player) != null; - }); - - AddUntilStep("wait for fail", () => player.GameplayState.HasFailed); - - AddUntilStep("wait for track stop", () => !Game.MusicController.IsPlaying); - AddAssert("Ensure time before preview point", () => Game.MusicController.CurrentTrack.CurrentTime < beatmap().BeatmapInfo.Metadata.PreviewTime); - - pushEscape(); - - AddUntilStep("wait for track playing", () => Game.MusicController.IsPlaying); - AddAssert("Ensure time wasn't reset to preview point", () => Game.MusicController.CurrentTrack.CurrentTime < beatmap().BeatmapInfo.Metadata.PreviewTime); - } - [Test] public void TestMenuMakesMusic() { @@ -1347,28 +1309,6 @@ namespace osu.Game.Tests.Visual.Navigation } } - [Test] - public void TestSongPresentBeatmap() - { - BeatmapSetInfo beatmapInfo = null!; - AddStep("import beatmap", () => - { - var task = BeatmapImportHelper.LoadOszIntoOsu(Game, virtualTrack: true); - task.WaitSafely(); - beatmapInfo = task.GetResultSafely(); - }); - - AddStep("present beatmap", () => Game.PresentBeatmap(beatmapInfo)); - - AddUntilStep("wait for track playing", () => Game.MusicController.IsPlaying); - AddAssert("ensure time is reset to preview point", - () => - { - double timeFormPreviewPoint = Game.MusicController.CurrentTrack.CurrentTime - beatmapInfo.Metadata.PreviewTime; - return timeFormPreviewPoint > 0 && timeFormPreviewPoint < 1000; - }); - } - [Test] public void TestPresentBeatmapAfterDeletion() { diff --git a/osu.Game.Tests/Visual/Navigation/TestSceneSongSelectNavigation.cs b/osu.Game.Tests/Visual/Navigation/TestSceneSongSelectNavigation.cs index 676be8fccf..9a1f1dc515 100644 --- a/osu.Game.Tests/Visual/Navigation/TestSceneSongSelectNavigation.cs +++ b/osu.Game.Tests/Visual/Navigation/TestSceneSongSelectNavigation.cs @@ -92,6 +92,30 @@ namespace osu.Game.Tests.Visual.Navigation waitForScreen(); } + [Test] + public void TestPresentBeatmapFromMainMenuUsesPreviewPoint() + { + BeatmapSetInfo beatmapInfo = null!; + + AddStep("import beatmap", () => + { + var task = BeatmapImportHelper.LoadOszIntoOsu(Game, virtualTrack: true); + task.WaitSafely(); + beatmapInfo = task.GetResultSafely(); + }); + + AddStep("present beatmap", () => Game.PresentBeatmap(beatmapInfo)); + + AddUntilStep("wait for track playing", () => Game.MusicController.IsPlaying); + + AddAssert("ensure time is reset to preview point", + () => + { + double timeFromPreviewPoint = Math.Abs(Game.MusicController.CurrentTrack.CurrentTime - beatmapInfo.Metadata.PreviewTime); + return timeFromPreviewPoint < 5000; + }); + } + [TestCase(true)] [TestCase(false)] public void TestSongContinuesAfterExitPlayer(bool withUserPause)