Skip to content

Commit

Permalink
chore: Add WaitForever() debug helper for runtime tests
Browse files Browse the repository at this point in the history
  • Loading branch information
davidjohnoliver committed Oct 1, 2020
1 parent 0dc34bd commit 23970c0
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/Uno.UI.RuntimeTests/IntegrationTests/common/TestServices.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,21 @@ internal static async Task WaitFor(Func<bool> condition, int timeoutMS = 1000, s
throw new AssertFailedException("Timed out waiting for condition to be met. " + message);
}

#if DEBUG
/// <summary>
/// This will wait. Forever. Useful when debugging a runtime test if you wish to visually inspect or interact with a view added
/// by the test. (To break out of the loop, just set 'shouldWait = false' via the Immediate Window.)
/// </summary>
internal static async Task WaitForever()
{
var shouldWait = true;
while (shouldWait)
{
await Task.Delay(1000);
}
}
#endif

internal static void ShutdownXaml() { }
internal static void VerifyTestCleanup() { }

Expand Down

0 comments on commit 23970c0

Please sign in to comment.