Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable failing arm64 win10 Graphics.FromHdc tests #56732

Merged
merged 2 commits into from
Aug 2, 2021
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
31 changes: 31 additions & 0 deletions src/libraries/System.Drawing.Common/tests/GraphicsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
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 @@ -102,6 +103,12 @@ public static IEnumerable<object[]> FromHdc_TestData()
[MemberData(nameof(FromHdc_TestData))]
public void FromHdc_ValidHdc_ReturnsExpected(IntPtr hdc)
{
if (PlatformDetection.IsArm64Process && OperatingSystem.IsWindows())
{
// ActiveIssue: 51097
Copy link
Member

@safern safern Aug 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we instead use the ActiveIssueAttribute that uses a conditional member?

https://github.com/dotnet/arcade/blob/a50c27610c6a060c677090b801636cd7149cd591/src/Microsoft.DotNet.XUnitExtensions/src/Attributes/ActiveIssueAttribute.cs#L23

If the condition is true, then it'll skip it. Here is an example:

[ActiveIssue("https://github.com/dotnet/runtime/issues/55117", typeof(PlatformDetection), nameof(PlatformDetection.IsLinqExpressionsBuiltWithIsInterpretingOnly))]

throw new SkipTestException("Visible clipping region is not empty.");
}

using (Graphics graphics = Graphics.FromHdc(hdc))
{
Rectangle expected = Helpers.GetWindowDCRect(hdc);
Expand All @@ -114,6 +121,12 @@ public void FromHdc_ValidHdc_ReturnsExpected(IntPtr hdc)
[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 @@ -126,6 +139,12 @@ public void FromHdc_ValidHdcWithContext_ReturnsExpected(IntPtr hdc)
[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 @@ -262,6 +281,12 @@ public static IEnumerable<object[]> Hwnd_TestData()
[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 @@ -274,6 +299,12 @@ public void FromHwnd_ValidHwnd_ReturnsExpected(IntPtr hWnd)
[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