-
Notifications
You must be signed in to change notification settings - Fork 742
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: [Skia] Fix layout when RevealBrush is used
Fall back on FallbackColor when RevealBrush is assigned, instead of trying to use unimplemented CompositionBrush property which throws an exception.
- Loading branch information
1 parent
4a85f10
commit 9f5e1a8
Showing
2 changed files
with
67 additions
and
8 deletions.
There are no files selected for viewing
49 changes: 49 additions & 0 deletions
49
src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml_Media/Given_RevealBrush.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,49 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
using Windows.UI; | ||
using Windows.UI.Xaml.Controls; | ||
using Windows.UI.Xaml.Media; | ||
using static Private.Infrastructure.TestServices; | ||
|
||
namespace Uno.UI.RuntimeTests.Tests.Windows_UI_Xaml_Media | ||
{ | ||
[TestClass] | ||
[RunsOnUIThread] | ||
public class Given_RevealBrush | ||
{ | ||
[TestMethod] | ||
public async Task When_RevealBrush_Assigned() | ||
{ | ||
// Basic smoke test - RevealBrush is currently unimplemented, but it shouldn't break the layout | ||
|
||
var siblingBorder = new Border { Width = 43, Height = 22 }; | ||
var gridWithRevealBackground = new Grid | ||
{ | ||
Width = 57, | ||
Height = 34, | ||
Background = new RevealBackgroundBrush() { Color = Colors.Brown, FallbackColor = Colors.Brown }, | ||
}; | ||
var parentSP = new StackPanel | ||
{ | ||
Children = | ||
{ | ||
gridWithRevealBackground, | ||
siblingBorder | ||
} | ||
}; | ||
|
||
WindowHelper.WindowContent = parentSP; | ||
await WindowHelper.WaitForLoaded(parentSP); | ||
|
||
await WindowHelper.WaitForEqual(57, () => gridWithRevealBackground.ActualWidth); | ||
Assert.AreEqual(34, gridWithRevealBackground.ActualHeight); | ||
|
||
Assert.AreEqual(43, siblingBorder.ActualWidth); | ||
Assert.AreEqual(22, siblingBorder.ActualHeight); | ||
} | ||
} | ||
} |
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