Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(flyout): Fix NRE from trying to close uncreated Popup in Flyout
Flyout.Close() is called when an owning Button is unloaded, which was resulting in an NRE if the Flyout had never been shown.
- Loading branch information
1 parent
db1fba4
commit 18f0191
Showing
2 changed files
with
39 additions
and
1 deletion.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml_Controls/Given_Flyout.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
using Private.Infrastructure; | ||
using Windows.UI.Xaml.Controls; | ||
|
||
namespace Uno.UI.RuntimeTests.Tests.Windows_UI_Xaml_Controls | ||
{ | ||
[TestClass] | ||
public class Given_Flyout | ||
{ | ||
[TestMethod] | ||
[RunsOnUIThread] | ||
public async Task When_Unloaded_Before_Shown() | ||
{ | ||
var button = new Button() | ||
{ | ||
Flyout = new Flyout | ||
{ | ||
Content = new Border { Width = 50, Height = 30 } | ||
} | ||
}; | ||
|
||
TestServices.WindowHelper.WindowContent = button; | ||
|
||
await TestServices.WindowHelper.WaitForIdle(); | ||
|
||
TestServices.WindowHelper.WindowContent = null; | ||
|
||
await TestServices.WindowHelper.WaitForIdle(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters