From 5fcd39a43d521e7829b1fd39769d4dd56eab090e Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 28 Oct 2020 16:29:06 +0900 Subject: [PATCH] Ensure spectator screen is loaded before continuing --- osu.Game.Tests/Visual/Gameplay/TestSceneSpectator.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/osu.Game.Tests/Visual/Gameplay/TestSceneSpectator.cs b/osu.Game.Tests/Visual/Gameplay/TestSceneSpectator.cs index a716b0c06b..5a2230dd64 100644 --- a/osu.Game.Tests/Visual/Gameplay/TestSceneSpectator.cs +++ b/osu.Game.Tests/Visual/Gameplay/TestSceneSpectator.cs @@ -5,6 +5,7 @@ using System.Collections.Generic; using System.Linq; using NUnit.Framework; using osu.Framework.Allocation; +using osu.Framework.Graphics; using osu.Framework.Screens; using osu.Framework.Testing; using osu.Framework.Utils; @@ -170,8 +171,11 @@ namespace osu.Game.Tests.Visual.Gameplay }); } - private void loadSpectatingScreen() => + private void loadSpectatingScreen() + { AddStep("load screen", () => LoadScreen(spectatorScreen = new Spectator(testSpectatorStreamingClient.StreamingUser))); + AddUntilStep("wait for screen load", () => spectatorScreen.LoadState == LoadState.Loaded); + } internal class TestSpectatorStreamingClient : SpectatorStreamingClient {