Skip to content

Commit

Permalink
fix: Fix WaitForIdle to really wait for "Idle"
Browse files Browse the repository at this point in the history
  • Loading branch information
Youssef1313 committed Dec 20, 2023
1 parent 6c3ce9e commit cd058ca
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ internal set
/// <returns></returns>
public static async Task WaitForIdle()
{
await RootElementDispatcher.RunAsync(UnitTestDispatcherCompat.Priority.Low, () => { });
await RootElementDispatcher.RunAsync(UnitTestDispatcherCompat.Priority.Low, () => { });
await RootElementDispatcher.RunAsync(UnitTestDispatcherCompat.Priority.Idle, () => { });
await RootElementDispatcher.RunAsync(UnitTestDispatcherCompat.Priority.Idle, () => { });
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,11 @@ namespace Uno.UI.RuntimeTests.Internal.Helpers;

public partial class UnitTestDispatcherCompat
{
public enum Priority { Low = -1, Normal = 0, High = 1 }
public enum Priority { Idle = -2, Low = -1, Normal = 0, High = 1 }

private static _Priority RemapPriority(Priority priority) => priority switch
{
// [uwp] Windows.UI.Core.CoreDispatcherPriority::Idle doesnt have a counterpart, and is thus ignored.

Priority.Idle => _Priority.Idle,

Check failure on line 38 in src/Uno.UI.RuntimeTests.Engine.Library/Engine/UI/_Private/UnitTestDispatcherCompat.cs

View workflow job for this annotation

GitHub Actions / build

'DispatcherQueuePriority' does not contain a definition for 'Idle'
Priority.Low => _Priority.Low,
Priority.Normal => _Priority.Normal,
Priority.High => _Priority.High,
Expand Down

0 comments on commit cd058ca

Please sign in to comment.