Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Use ActiveIssue with conditional
  • Loading branch information
Mateo Torres Ruiz committed Aug 2, 2021
commit 1abc5819a9c7682058841949362390a5a7f432ec
36 changes: 5 additions & 31 deletions src/libraries/System.Drawing.Common/tests/GraphicsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
using System.Drawing.Drawing2D;
using System.Drawing.Imaging;
using System.Drawing.Text;
using Microsoft.DotNet.XUnitExtensions;
using Xunit;

namespace System.Drawing.Tests
Expand Down Expand Up @@ -99,16 +98,11 @@ public static IEnumerable<object[]> FromHdc_TestData()
}

[ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)]
[ActiveIssue("https://github.com/dotnet/runtime/issues/51097", typeof(PlatformDetection), nameof(PlatformDetection.IsArm64Process), nameof(PlatformDetection.IsWindows10OrLater))]
[ConditionalTheory(Helpers.IsDrawingSupported)]
[MemberData(nameof(FromHdc_TestData))]
public void FromHdc_ValidHdc_ReturnsExpected(IntPtr hdc)
{
if (PlatformDetection.IsArm64Process && OperatingSystem.IsWindows())
{
// ActiveIssue: 51097
throw new SkipTestException("Visible clipping region is not empty.");
}

using (Graphics graphics = Graphics.FromHdc(hdc))
{
Rectangle expected = Helpers.GetWindowDCRect(hdc);
Expand All @@ -117,16 +111,11 @@ public void FromHdc_ValidHdc_ReturnsExpected(IntPtr hdc)
}

[ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)]
[ActiveIssue("https://github.com/dotnet/runtime/issues/51097", typeof(PlatformDetection), nameof(PlatformDetection.IsArm64Process), nameof(PlatformDetection.IsWindows10OrLater))]
[ConditionalTheory(Helpers.IsDrawingSupported)]
[MemberData(nameof(FromHdc_TestData))]
public void FromHdc_ValidHdcWithContext_ReturnsExpected(IntPtr hdc)
{
if (PlatformDetection.IsArm64Process && OperatingSystem.IsWindows())
{
// ActiveIssue: 51097
throw new SkipTestException("Visible clipping region is not empty.");
}

using (Graphics graphics = Graphics.FromHdc(hdc, IntPtr.Zero))
{
Rectangle expected = Helpers.GetWindowDCRect(hdc);
Expand All @@ -135,16 +124,11 @@ public void FromHdc_ValidHdcWithContext_ReturnsExpected(IntPtr hdc)
}

[ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)]
[ActiveIssue("https://github.com/dotnet/runtime/issues/51097", typeof(PlatformDetection), nameof(PlatformDetection.IsArm64Process), nameof(PlatformDetection.IsWindows10OrLater))]
[ConditionalTheory(Helpers.IsDrawingSupported)]
[MemberData(nameof(FromHdc_TestData))]
public void FromHdcInternal_GetDC_ReturnsExpected(IntPtr hdc)
{
if (PlatformDetection.IsArm64Process && OperatingSystem.IsWindows())
{
// ActiveIssue: 51097
throw new SkipTestException("Visible clipping region is not empty.");
}

using (Graphics graphics = Graphics.FromHdcInternal(hdc))
{
Rectangle expected = Helpers.GetWindowDCRect(hdc);
Expand Down Expand Up @@ -277,16 +261,11 @@ public static IEnumerable<object[]> Hwnd_TestData()
}

[ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)]
[ActiveIssue("https://github.com/dotnet/runtime/issues/51097", typeof(PlatformDetection), nameof(PlatformDetection.IsArm64Process), nameof(PlatformDetection.IsWindows10OrLater))]
[ConditionalTheory(Helpers.IsDrawingSupported)]
[MemberData(nameof(Hwnd_TestData))]
public void FromHwnd_ValidHwnd_ReturnsExpected(IntPtr hWnd)
{
if (PlatformDetection.IsArm64Process && OperatingSystem.IsWindows ())
{
// ActiveIssue: 51097
throw new SkipTestException("Visible clipping region is not empty.");
}

using (Graphics graphics = Graphics.FromHwnd(hWnd))
{
Rectangle expected = Helpers.GetHWndRect(hWnd);
Expand All @@ -295,16 +274,11 @@ public void FromHwnd_ValidHwnd_ReturnsExpected(IntPtr hWnd)
}

[ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)]
[ActiveIssue("https://github.com/dotnet/runtime/issues/51097", typeof(PlatformDetection), nameof(PlatformDetection.IsArm64Process), nameof(PlatformDetection.IsWindows10OrLater))]
[ConditionalTheory(Helpers.IsDrawingSupported)]
[MemberData(nameof(Hwnd_TestData))]
public void FromHwndInternal_ValidHwnd_ReturnsExpected(IntPtr hWnd)
{
if (PlatformDetection.IsArm64Process && OperatingSystem.IsWindows())
{
// ActiveIssue: 51097
throw new SkipTestException("Visible clipping region is not empty.");
}

using (Graphics graphics = Graphics.FromHwnd(hWnd))
{
Rectangle expected = Helpers.GetHWndRect(hWnd);
Expand Down