mirror of
https://github.com/ppy/osu.git
synced 2026-05-18 19:10:28 +08:00
Remove duplicate test
This commit is contained in:
@@ -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<MusicController>().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()
|
||||
{
|
||||
|
||||
@@ -92,6 +92,30 @@ namespace osu.Game.Tests.Visual.Navigation
|
||||
waitForScreen<SoloSongSelect>();
|
||||
}
|
||||
|
||||
[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)
|
||||
|
||||
Reference in New Issue
Block a user