From 97796a85781aa5192d0317c177026ef00cab9c56 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 10 May 2019 18:10:07 +0900 Subject: [PATCH] Attempt to fix failing tests by delaying starting of the gameplay clock --- osu.Game.Tests/Visual/Gameplay/TestCasePause.cs | 15 +++++++++++++++ osu.Game/Tests/Visual/PlayerTestCase.cs | 4 ++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/osu.Game.Tests/Visual/Gameplay/TestCasePause.cs b/osu.Game.Tests/Visual/Gameplay/TestCasePause.cs index 14be10b65c..81ef41ceec 100644 --- a/osu.Game.Tests/Visual/Gameplay/TestCasePause.cs +++ b/osu.Game.Tests/Visual/Gameplay/TestCasePause.cs @@ -6,6 +6,7 @@ using NUnit.Framework; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Screens; +using osu.Framework.Testing; using osu.Game.Graphics.Containers; using osu.Game.Graphics.Cursor; using osu.Game.Rulesets; @@ -31,6 +32,14 @@ namespace osu.Game.Tests.Visual.Gameplay base.Content.Add(content = new MenuCursorContainer { RelativeSizeAxes = Axes.Both }); } + [SetUpSteps] + public override void SetUpSteps() + { + base.SetUpSteps(); + AddStep("resume player", () => Player.GameplayClockContainer.Start()); + confirmClockRunning(true); + } + [Test] public void TestPauseResume() { @@ -203,6 +212,12 @@ namespace osu.Game.Tests.Visual.Gameplay base.LoadComplete(); HUDOverlay.HoldToQuit.PauseOnFocusLost = false; } + + public override void OnEntering(IScreen last) + { + base.OnEntering(last); + GameplayClockContainer.Stop(); + } } } } diff --git a/osu.Game/Tests/Visual/PlayerTestCase.cs b/osu.Game/Tests/Visual/PlayerTestCase.cs index c1960eefeb..85eacc7e09 100644 --- a/osu.Game/Tests/Visual/PlayerTestCase.cs +++ b/osu.Game/Tests/Visual/PlayerTestCase.cs @@ -1,4 +1,4 @@ -// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System.Linq; @@ -33,7 +33,7 @@ namespace osu.Game.Tests.Visual } [SetUpSteps] - public void SetUpSteps() + public virtual void SetUpSteps() { AddStep(ruleset.RulesetInfo.Name, loadPlayer); AddUntilStep("player loaded", () => Player.IsLoaded && Player.Alpha == 1);