mirror of
https://github.com/osukey/osukey.git
synced 2025-05-06 22:27:25 +09:00
Merge pull request #15871 from peppy/fix-wedge-test-intermittent-failure
Fix intermittent test failures in `TestSceneBeatmapInfoWedge` due to async load
This commit is contained in:
commit
f7b0d567bb
@ -82,7 +82,7 @@ namespace osu.Game.Tests.Visual.SongSelect
|
|||||||
|
|
||||||
beatmaps.Add(testBeatmap);
|
beatmaps.Add(testBeatmap);
|
||||||
|
|
||||||
AddStep("set ruleset", () => Ruleset.Value = rulesetInfo);
|
setRuleset(rulesetInfo);
|
||||||
|
|
||||||
selectBeatmap(testBeatmap);
|
selectBeatmap(testBeatmap);
|
||||||
|
|
||||||
@ -167,6 +167,22 @@ namespace osu.Game.Tests.Visual.SongSelect
|
|||||||
label => label.Statistic.Name == "BPM" && label.Statistic.Content == target.ToString(CultureInfo.InvariantCulture)));
|
label => label.Statistic.Name == "BPM" && label.Statistic.Content == target.ToString(CultureInfo.InvariantCulture)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void setRuleset(RulesetInfo rulesetInfo)
|
||||||
|
{
|
||||||
|
Container containerBefore = null;
|
||||||
|
|
||||||
|
AddStep("set ruleset", () =>
|
||||||
|
{
|
||||||
|
// wedge content is only refreshed if the ruleset changes, so only wait for load in that case.
|
||||||
|
if (!rulesetInfo.Equals(Ruleset.Value))
|
||||||
|
containerBefore = infoWedge.DisplayedContent;
|
||||||
|
|
||||||
|
Ruleset.Value = rulesetInfo;
|
||||||
|
});
|
||||||
|
|
||||||
|
AddUntilStep("wait for async load", () => infoWedge.DisplayedContent != containerBefore);
|
||||||
|
}
|
||||||
|
|
||||||
private void selectBeatmap([CanBeNull] IBeatmap b)
|
private void selectBeatmap([CanBeNull] IBeatmap b)
|
||||||
{
|
{
|
||||||
Container containerBefore = null;
|
Container containerBefore = null;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user