mirror of
https://github.com/ppy/osu
synced 2024-12-15 11:25:29 +00: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);
|
||||
|
||||
AddStep("set ruleset", () => Ruleset.Value = rulesetInfo);
|
||||
setRuleset(rulesetInfo);
|
||||
|
||||
selectBeatmap(testBeatmap);
|
||||
|
||||
@ -167,6 +167,22 @@ namespace osu.Game.Tests.Visual.SongSelect
|
||||
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)
|
||||
{
|
||||
Container containerBefore = null;
|
||||
|
Loading…
Reference in New Issue
Block a user