mirror of
https://github.com/osukey/osukey.git
synced 2025-06-05 12:57:39 +09:00
Merge pull request #21466 from peppy/fix-song-progress-test-flaky
Attempt to fix flaky `TestHoldForMenuDoesWorkWhenHidden`
This commit is contained in:
commit
54c0b2c20c
@ -2,6 +2,7 @@
|
|||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
@ -187,18 +188,22 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
[Test]
|
[Test]
|
||||||
public void TestInputDoesntWorkWhenHUDHidden()
|
public void TestInputDoesntWorkWhenHUDHidden()
|
||||||
{
|
{
|
||||||
SongProgressBar getSongProgress() => hudOverlay.ChildrenOfType<SongProgressBar>().Single();
|
SongProgressBar? getSongProgress() => hudOverlay.ChildrenOfType<SongProgressBar>().SingleOrDefault();
|
||||||
|
|
||||||
bool seeked = false;
|
bool seeked = false;
|
||||||
|
|
||||||
createNew();
|
createNew();
|
||||||
|
|
||||||
|
AddUntilStep("wait for song progress", () => getSongProgress() != null);
|
||||||
|
|
||||||
AddStep("bind seek", () =>
|
AddStep("bind seek", () =>
|
||||||
{
|
{
|
||||||
seeked = false;
|
seeked = false;
|
||||||
|
|
||||||
var progress = getSongProgress();
|
var progress = getSongProgress();
|
||||||
|
|
||||||
|
Debug.Assert(progress != null);
|
||||||
|
|
||||||
progress.ShowHandle = true;
|
progress.ShowHandle = true;
|
||||||
progress.OnSeek += _ => seeked = true;
|
progress.OnSeek += _ => seeked = true;
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user