diff --git a/src/Uno.Toolkit.RuntimeTests/Tests/ItemsRepeaterExtensionTests.ISelectionInfo.cs b/src/Uno.Toolkit.RuntimeTests/Tests/ItemsRepeaterExtensionTests.ISelectionInfo.cs index a223defcd..848373533 100644 --- a/src/Uno.Toolkit.RuntimeTests/Tests/ItemsRepeaterExtensionTests.ISelectionInfo.cs +++ b/src/Uno.Toolkit.RuntimeTests/Tests/ItemsRepeaterExtensionTests.ISelectionInfo.cs @@ -24,7 +24,7 @@ namespace Uno.Toolkit.RuntimeTests.Tests { [TestClass] [RunsOnUIThread] - partial class ItemsRepeaterExtensionsTests + public partial class ItemsRepeaterExtensionsTests { private const ItemsSelectionMode Single = ItemsSelectionMode.Single; diff --git a/src/Uno.Toolkit.RuntimeTests/Tests/NavigationBarTests.cs b/src/Uno.Toolkit.RuntimeTests/Tests/NavigationBarTests.cs index 58ef1a81b..47a53e7dc 100644 --- a/src/Uno.Toolkit.RuntimeTests/Tests/NavigationBarTests.cs +++ b/src/Uno.Toolkit.RuntimeTests/Tests/NavigationBarTests.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; +using System.Threading; using System.Threading.Tasks; using Microsoft.VisualStudio.TestTools.UnitTesting; using Uno.Disposables; @@ -93,13 +94,12 @@ public async Task MainCommand_In_Popup_Without_Page(MainCommandMode mainCommandM var popup = new Popup { Width = 100, Height = 100, HorizontalOffset = 100, VerticalOffset = 100, Child = new StackPanel { Children = { navigationBar } } }; var content = new StackPanel { Children = { popup } }; - EventHandler popupOpened = async (s, e) => + var autoResetEvent = new AutoResetEvent(false); + + EventHandler popupOpened = (s, e) => { Assert.IsTrue(navigationBar.TryPerformMainCommand() == shouldGoBack, "Unexpected result from TryPerformMainCommand"); - - await UnitTestsUIContentHelper.WaitForIdle(); - - Assert.IsTrue(popup.IsOpen == !shouldGoBack, "Popup is in an incorrect state"); + autoResetEvent.Set(); }; try @@ -108,6 +108,11 @@ public async Task MainCommand_In_Popup_Without_Page(MainCommandMode mainCommandM popup.Opened += popupOpened; popup.IsOpen = true; + + autoResetEvent.WaitOne(); + await UnitTestsUIContentHelper.WaitForIdle(); + + Assert.IsTrue(popup.IsOpen == !shouldGoBack, "Popup is in an incorrect state"); } finally {