Merge pull request #4753 from peppy/fix-failing-pause-tests

Attempt to fix failing tests by delaying starting of the gameplay clock
This commit is contained in:
Dan Balasescu 2019-05-10 19:08:42 +09:00 committed by GitHub
commit 101889cff9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 2 deletions

View File

@ -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();
}
}
}
}

View File

@ -1,4 +1,4 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. 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);