|
@@ -1,5 +1,6 @@
|
|
|
using System.Collections.ObjectModel;
|
|
using System.Collections.ObjectModel;
|
|
|
using Avalonia.Controls;
|
|
using Avalonia.Controls;
|
|
|
|
|
+using Avalonia.Controls.Shapes;
|
|
|
using Avalonia.Layout;
|
|
using Avalonia.Layout;
|
|
|
using Avalonia.Media;
|
|
using Avalonia.Media;
|
|
|
using Avalonia.Threading;
|
|
using Avalonia.Threading;
|
|
@@ -36,6 +37,73 @@ public class RenderingTests
|
|
|
|
|
|
|
|
Assert.NotNull(frame);
|
|
Assert.NotNull(frame);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+#if NUNIT
|
|
|
|
|
+ [AvaloniaTest, Timeout(10000)]
|
|
|
|
|
+#elif XUNIT
|
|
|
|
|
+ [AvaloniaFact(Timeout = 10000)]
|
|
|
|
|
+#endif
|
|
|
|
|
+ public void Should_Not_Crash_On_GeometryGroup()
|
|
|
|
|
+ {
|
|
|
|
|
+ var window = new Window
|
|
|
|
|
+ {
|
|
|
|
|
+ Content = new ContentControl
|
|
|
|
|
+ {
|
|
|
|
|
+ HorizontalAlignment = HorizontalAlignment.Stretch,
|
|
|
|
|
+ VerticalAlignment = VerticalAlignment.Stretch,
|
|
|
|
|
+ Padding = new Thickness(4),
|
|
|
|
|
+ Content = new PathIcon
|
|
|
|
|
+ {
|
|
|
|
|
+ Data = new GeometryGroup()
|
|
|
|
|
+ {
|
|
|
|
|
+ Children = new GeometryCollection(new []
|
|
|
|
|
+ {
|
|
|
|
|
+ new RectangleGeometry(new Rect(0, 0, 50, 50)),
|
|
|
|
|
+ new RectangleGeometry(new Rect(50, 50, 100, 100))
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ SizeToContent = SizeToContent.WidthAndHeight
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ window.Show();
|
|
|
|
|
+
|
|
|
|
|
+ var frame = window.CaptureRenderedFrame();
|
|
|
|
|
+
|
|
|
|
|
+ Assert.NotNull(frame);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+#if NUNIT
|
|
|
|
|
+ [AvaloniaTest, Timeout(10000)]
|
|
|
|
|
+#elif XUNIT
|
|
|
|
|
+ [AvaloniaFact(Timeout = 10000)]
|
|
|
|
|
+#endif
|
|
|
|
|
+ public void Should_Not_Crash_On_CombinedGeometry()
|
|
|
|
|
+ {
|
|
|
|
|
+ var window = new Window
|
|
|
|
|
+ {
|
|
|
|
|
+ Content = new ContentControl
|
|
|
|
|
+ {
|
|
|
|
|
+ HorizontalAlignment = HorizontalAlignment.Stretch,
|
|
|
|
|
+ VerticalAlignment = VerticalAlignment.Stretch,
|
|
|
|
|
+ Padding = new Thickness(4),
|
|
|
|
|
+ Content = new PathIcon
|
|
|
|
|
+ {
|
|
|
|
|
+ Data = new CombinedGeometry(GeometryCombineMode.Union,
|
|
|
|
|
+ new RectangleGeometry(new Rect(0, 0, 50, 50)),
|
|
|
|
|
+ new RectangleGeometry(new Rect(50, 50, 100, 100)))
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ SizeToContent = SizeToContent.WidthAndHeight
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ window.Show();
|
|
|
|
|
+
|
|
|
|
|
+ var frame = window.CaptureRenderedFrame();
|
|
|
|
|
+
|
|
|
|
|
+ Assert.NotNull(frame);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
#if NUNIT
|
|
#if NUNIT
|
|
|
[AvaloniaTest, Timeout(10000)]
|
|
[AvaloniaTest, Timeout(10000)]
|