From e9d6ccfca0b25fd8b4da0064467564d657b1d36e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20K=C3=A4s?= Date: Tue, 26 May 2020 02:59:39 +0200 Subject: [PATCH] update Xunit.StaFact to include bugfixes (#3276) --- eng/Versions.props | 2 +- .../MyServices/ClipboardProxyTests.cs | 16 ++-- .../CheckedListBoxAccessibleObjectTests.cs | 4 +- .../ListBoxAccessibleObjectTests.cs | 4 +- .../System/Windows/Forms/ClipboardTests.cs | 92 +++++++++---------- .../Windows/Forms/ControlTests.Handlers.cs | 4 +- .../Windows/Forms/ControlTests.Methods.cs | 12 ++- .../Windows/Forms/ToolStripItemTests.cs | 20 ++-- ...WindowsFormsSynchronizationContextTests.cs | 11 ++- .../tests/UnitTests/WebBrowserBaseTests.cs | 82 ++++++++--------- 10 files changed, 129 insertions(+), 118 deletions(-) diff --git a/eng/Versions.props b/eng/Versions.props index b14b837e133..03ddc499e4e 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -52,7 +52,7 @@ $(XUnitVersion) $(XUnitVersion) $(XUnitVersion) - 0.3.18 + 1.0.33-beta diff --git a/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/MyServices/ClipboardProxyTests.cs b/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/MyServices/ClipboardProxyTests.cs index b67825db367..45cfa92628a 100644 --- a/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/MyServices/ClipboardProxyTests.cs +++ b/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/MyServices/ClipboardProxyTests.cs @@ -13,7 +13,7 @@ namespace Microsoft.VisualBasic.MyServices.Tests { public class ClipboardProxyTests { - [StaFact] + [WinFormsFact] public void Clear() { var clipboard = (new Computer()).Clipboard; @@ -24,19 +24,19 @@ public void Clear() Assert.False(System.Windows.Forms.Clipboard.ContainsText()); } - [StaFact] + [WinFormsFact] public void Text() { var clipboard = (new Computer()).Clipboard; var text = GetUniqueText(); + clipboard.SetText(text, TextDataFormat.UnicodeText); Assert.Equal(System.Windows.Forms.Clipboard.ContainsText(), clipboard.ContainsText()); Assert.Equal(System.Windows.Forms.Clipboard.GetText(), clipboard.GetText()); Assert.Equal(System.Windows.Forms.Clipboard.GetText(TextDataFormat.UnicodeText), clipboard.GetText(TextDataFormat.UnicodeText)); - clipboard.SetText(text, TextDataFormat.UnicodeText); Assert.Equal(text, clipboard.GetText(TextDataFormat.UnicodeText)); } - [StaFact] + [WinFormsFact] public void Image() { var clipboard = (new Computer()).Clipboard; @@ -46,7 +46,7 @@ public void Image() clipboard.SetImage(image); } - [StaFact] + [WinFormsFact] public void Audio() { var clipboard = (new Computer()).Clipboard; @@ -57,7 +57,7 @@ public void Audio() // Public Sub SetAudio(ByVal audioStream As Stream) } - [StaFact] + [WinFormsFact] public void FileDropList() { var clipboard = (new Computer()).Clipboard; @@ -67,7 +67,7 @@ public void FileDropList() // Public Sub SetFileDropList(ByVal filePaths As StringCollection) } - [StaFact] + [WinFormsFact] public void Data() { var clipboard = (new Computer()).Clipboard; @@ -77,7 +77,7 @@ public void Data() clipboard.SetData(DataFormats.UnicodeText, data); } - [StaFact] + [WinFormsFact] public void DataObject() { var clipboard = (new Computer()).Clipboard; diff --git a/src/System.Windows.Forms/tests/UnitTests/AccessibleObjects/CheckedListBoxAccessibleObjectTests.cs b/src/System.Windows.Forms/tests/UnitTests/AccessibleObjects/CheckedListBoxAccessibleObjectTests.cs index b623a0fef11..c512be2619d 100644 --- a/src/System.Windows.Forms/tests/UnitTests/AccessibleObjects/CheckedListBoxAccessibleObjectTests.cs +++ b/src/System.Windows.Forms/tests/UnitTests/AccessibleObjects/CheckedListBoxAccessibleObjectTests.cs @@ -9,10 +9,10 @@ namespace System.Windows.Forms.Tests.AccessibleObjects { public class CheckedListBoxAccessibleObjectTests : IClassFixture { - [StaFact] + [WinFormsFact] public void CheckedListBoxAccessibleObject_CheckBounds() { - CheckedListBox checkedListBox = new CheckedListBox(); + using CheckedListBox checkedListBox = new CheckedListBox(); checkedListBox.Size = new Size(120, 100); checkedListBox.Items.Add("a"); checkedListBox.Items.Add("b"); diff --git a/src/System.Windows.Forms/tests/UnitTests/AccessibleObjects/ListBoxAccessibleObjectTests.cs b/src/System.Windows.Forms/tests/UnitTests/AccessibleObjects/ListBoxAccessibleObjectTests.cs index 72b8cedff08..d39a39410ed 100644 --- a/src/System.Windows.Forms/tests/UnitTests/AccessibleObjects/ListBoxAccessibleObjectTests.cs +++ b/src/System.Windows.Forms/tests/UnitTests/AccessibleObjects/ListBoxAccessibleObjectTests.cs @@ -9,10 +9,10 @@ namespace System.Windows.Forms.Tests.AccessibleObjects { public class ListBoxAccessibleObjectTests : IClassFixture { - [StaFact] + [WinFormsFact] public void ListBoxAccessibleObjectTests_Ctor_Default() { - ListBox listBox = new ListBox(); + using ListBox listBox = new ListBox(); listBox.Items.AddRange(new object[] { "a", "b", diff --git a/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/ClipboardTests.cs b/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/ClipboardTests.cs index e1bb97a2568..0c348e1b819 100644 --- a/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/ClipboardTests.cs +++ b/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/ClipboardTests.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. @@ -18,7 +18,7 @@ namespace System.Windows.Forms.Tests { public class ClipboardTests : IClassFixture { - [StaFact] + [WinFormsFact] public void Clipboard_Clear_InvokeMultipleTimes_Success() { Clipboard.Clear(); @@ -42,14 +42,14 @@ public void Clipboard_Clear_NotSta_ThrowsThreadStateException() Assert.Throws(() => Clipboard.Clear()); } - [StaFact] + [WinFormsFact] public void Clipboard_ContainsAudio_InvokeMultipleTimes_Success() { bool result = Clipboard.ContainsAudio(); Assert.Equal(result, Clipboard.ContainsAudio()); } - [StaTheory] + [WinFormsTheory] [CommonMemberData(nameof(CommonTestHelper.GetStringWithNullTheoryData))] public void Clipboard_ContainsData_InvokeMultipleTimes_Success(string format) { @@ -58,28 +58,28 @@ public void Clipboard_ContainsData_InvokeMultipleTimes_Success(string format) Assert.False(result); } - [StaFact] + [WinFormsFact] public void Clipboard_ContainsFileDropList_InvokeMultipleTimes_Success() { bool result = Clipboard.ContainsFileDropList(); Assert.Equal(result, Clipboard.ContainsFileDropList()); } - [StaFact] + [WinFormsFact] public void Clipboard_ContainsImage_InvokeMultipleTimes_Success() { bool result = Clipboard.ContainsImage(); Assert.Equal(result, Clipboard.ContainsImage()); } - [StaFact] + [WinFormsFact] public void Clipboard_ContainsText_InvokeMultipleTimes_Success() { bool result = Clipboard.ContainsText(); Assert.Equal(result, Clipboard.ContainsText()); } - [StaTheory] + [WinFormsTheory] [CommonMemberData(nameof(CommonTestHelper.GetEnumTypeTheoryData), typeof(TextDataFormat))] public void Clipboard_ContainsText_InvokeTextDataFormatMultipleTimes_Success(TextDataFormat format) { @@ -87,21 +87,21 @@ public void Clipboard_ContainsText_InvokeTextDataFormatMultipleTimes_Success(Tex Assert.Equal(result, Clipboard.ContainsText(format)); } - [StaTheory] + [WinFormsTheory] [CommonMemberData(nameof(CommonTestHelper.GetEnumTypeTheoryDataInvalid), typeof(TextDataFormat))] public void Clipboard_ContainsText_InvalidFormat_ThrowsInvalidEnumArgumentException(TextDataFormat format) { Assert.Throws("format", () => Clipboard.ContainsText(format)); } - [StaFact] + [WinFormsFact] public void Clipboard_GetAudioStream_InvokeMultipleTimes_Success() { Stream result = Clipboard.GetAudioStream(); Assert.Equal(result, Clipboard.GetAudioStream()); } - [StaTheory] + [WinFormsTheory] [InlineData(null)] [InlineData("")] [InlineData("\t")] @@ -112,35 +112,35 @@ public void Clipboard_GetData_NullOrEmptyFormat_Returns_Null(string format) Assert.Null(result); } - [StaFact] + [WinFormsFact] public void Clipboard_GetDataObject_InvokeMultipleTimes_Success() { object result = Clipboard.GetDataObject(); Assert.NotEqual(result, Clipboard.GetDataObject()); } - [StaFact] + [WinFormsFact] public void Clipboard_GetFileDropList_InvokeMultipleTimes_Success() { bool result = Clipboard.ContainsFileDropList(); Assert.Equal(result, Clipboard.ContainsFileDropList()); } - [StaFact] + [WinFormsFact] public void Clipboard_GetImage_InvokeMultipleTimes_Success() { bool result = Clipboard.ContainsImage(); Assert.Equal(result, Clipboard.ContainsImage()); } - [StaFact] + [WinFormsFact] public void Clipboard_GetText_InvokeMultipleTimes_Success() { bool result = Clipboard.ContainsText(); Assert.Equal(result, Clipboard.ContainsText()); } - [StaTheory] + [WinFormsTheory] [CommonMemberData(nameof(CommonTestHelper.GetEnumTypeTheoryData), typeof(TextDataFormat))] public void Clipboard_GetText_InvokeTextDataFormatMultipleTimes_Success(TextDataFormat format) { @@ -148,14 +148,14 @@ public void Clipboard_GetText_InvokeTextDataFormatMultipleTimes_Success(TextData Assert.Equal(result, Clipboard.GetText(format)); } - [StaTheory] + [WinFormsTheory] [CommonMemberData(nameof(CommonTestHelper.GetEnumTypeTheoryDataInvalid), typeof(TextDataFormat))] public void Clipboard_GetText_InvalidFormat_ThrowsInvalidEnumArgumentException(TextDataFormat format) { Assert.Throws("format", () => Clipboard.GetText(format)); } - [StaFact] + [WinFormsFact] public void Clipboard_SetAudio_InvokeByteArray_GetReturnsExpected() { byte[] audioBytes = new byte[] { 1, 2, 3 }; @@ -166,7 +166,7 @@ public void Clipboard_SetAudio_InvokeByteArray_GetReturnsExpected() Assert.True(Clipboard.ContainsData(DataFormats.WaveAudio)); } - [StaFact] + [WinFormsFact] public void Clipboard_SetAudio_InvokeEmptyByteArray_GetReturnsExpected() { byte[] audioBytes = new byte[0]; @@ -177,13 +177,13 @@ public void Clipboard_SetAudio_InvokeEmptyByteArray_GetReturnsExpected() Assert.True(Clipboard.ContainsData(DataFormats.WaveAudio)); } - [StaFact] + [WinFormsFact] public void Clipboard_SetAudio_NullAudioBytes_ThrowsArgumentNullException() { Assert.Throws("audioBytes", () => Clipboard.SetAudio((byte[])null)); } - [StaFact] + [WinFormsFact] public void Clipboard_SetAudio_InvokeStream_GetReturnsExpected() { byte[] audioBytes = new byte[] { 1, 2, 3 }; @@ -197,7 +197,7 @@ public void Clipboard_SetAudio_InvokeStream_GetReturnsExpected() } } - [StaFact] + [WinFormsFact] public void Clipboard_SetAudio_InvokeEmptyStream_GetReturnsExpected() { var audioStream = new MemoryStream(); @@ -208,7 +208,7 @@ public void Clipboard_SetAudio_InvokeEmptyStream_GetReturnsExpected() Assert.True(Clipboard.ContainsData(DataFormats.WaveAudio)); } - [StaFact] + [WinFormsFact] public void Clipboard_SetAudio_NullAudioStream_ThrowsArgumentNullException() { Assert.Throws("audioStream", () => Clipboard.SetAudio((Stream)null)); @@ -221,7 +221,7 @@ public void Clipboard_SetAudio_NotSta_ThrowsThreadStateException() Assert.Throws(() => Clipboard.SetAudio(new MemoryStream())); } - [StaTheory] + [WinFormsTheory] [InlineData("format", null)] [InlineData("format", 1)] public void Clipboard_SetData_Invoke_GetReturnsExpected(string format, object data) @@ -231,13 +231,13 @@ public void Clipboard_SetData_Invoke_GetReturnsExpected(string format, object da Assert.True(Clipboard.ContainsData(format)); } - [StaFact] + [WinFormsFact] public void Clipboard_SetData_NullFormat_ThrowsArgumentNullException() { Assert.Throws(() => Clipboard.SetData(format: null, data: new object())); } - [StaTheory] + [WinFormsTheory] [InlineData("")] [InlineData(" ")] [InlineData("\t")] @@ -252,7 +252,7 @@ public void Clipboard_SetData_NotSta_ThrowsThreadStateException() Assert.Throws(() => Clipboard.SetData("format", data: null)); } - [StaTheory] + [WinFormsTheory] [InlineData(1)] [InlineData("data")] public void Clipboard_SetDataObject_InvokeObjectNotIComDataObject_GetReturnsExpected(object data) @@ -262,7 +262,7 @@ public void Clipboard_SetDataObject_InvokeObjectNotIComDataObject_GetReturnsExpe Assert.True(Clipboard.ContainsData(data.GetType().FullName)); } - [StaTheory] + [WinFormsTheory] [InlineData(1)] [InlineData("data")] public void Clipboard_SetDataObject_InvokeObjectIComDataObject_GetReturnsExpected(object data) @@ -273,7 +273,7 @@ public void Clipboard_SetDataObject_InvokeObjectIComDataObject_GetReturnsExpecte Assert.True(Clipboard.ContainsData(data.GetType().FullName)); } - [StaTheory] + [WinFormsTheory] [InlineData(1, true)] [InlineData(1, false)] [InlineData("data", true)] @@ -285,7 +285,7 @@ public void Clipboard_SetDataObject_InvokeObjectBoolNotIComDataObject_GetReturns Assert.True(Clipboard.ContainsData(data.GetType().FullName)); } - [StaTheory] + [WinFormsTheory] [InlineData(1, true, 0, 0)] [InlineData(1, false, 1, 2)] [InlineData("data", true, 0, 0)] @@ -298,7 +298,7 @@ public void Clipboard_SetDataObject_InvokeObjectBoolIComDataObject_GetReturnsExp Assert.True(Clipboard.ContainsData(data.GetType().FullName)); } - [StaTheory] + [WinFormsTheory] [InlineData(1, true, 0, 0)] [InlineData(1, false, 1, 2)] [InlineData("data", true, 0, 0)] @@ -310,7 +310,7 @@ public void Clipboard_SetDataObject_InvokeObjectBoolIntIntNotIComDataObject_GetR Assert.True(Clipboard.ContainsData(data.GetType().FullName)); } - [StaFact] + [WinFormsFact] public void Clipboard_SetDataObject_NullData_ThrowsArgumentNullException() { Assert.Throws("data", () => Clipboard.SetDataObject(null)); @@ -318,13 +318,13 @@ public void Clipboard_SetDataObject_NullData_ThrowsArgumentNullException() Assert.Throws("data", () => Clipboard.SetDataObject(null, copy: true, retryTimes: 10, retryDelay: 0)); } - [StaFact] + [WinFormsFact] public void Clipboard_SetDataObject_NegativeRetryTimes_ThrowsArgumentOutOfRangeException() { Assert.Throws("retryTimes", () => Clipboard.SetDataObject(new object(), copy: true, retryTimes: -1, retryDelay: 0)); } - [StaFact] + [WinFormsFact] public void Clipboard_SetDataObject_NegativeRetryDelay_ThrowsArgumentOutOfRangeException() { Assert.Throws("retryDelay", () => Clipboard.SetDataObject(new object(), copy: true, retryTimes: 10, retryDelay: -1)); @@ -338,7 +338,7 @@ public void Clipboard_SetDataObject_NotSta_ThrowsThreadStateException() Assert.Throws(() => Clipboard.SetDataObject(null, copy: true, retryTimes: 10, retryDelay: 0)); } - [StaFact] + [WinFormsFact] public void Clipboard_SetFileDropList_Invoke_GetReturnsExpected() { var filePaths = new StringCollection @@ -350,20 +350,20 @@ public void Clipboard_SetFileDropList_Invoke_GetReturnsExpected() Assert.True(Clipboard.ContainsFileDropList()); } - [StaFact] + [WinFormsFact] public void Clipboard_SetFileDropList_NullFilePaths_ThrowsArgumentNullException() { Assert.Throws("filePaths", () => Clipboard.SetFileDropList(null)); } - [StaFact] + [WinFormsFact] public void Clipboard_SetFileDropList_EmptyFilePaths_ThrowsArgumentException() { var filePaths = new StringCollection(); Assert.Throws(null, () => Clipboard.SetFileDropList(filePaths)); } - [StaTheory] + [WinFormsTheory] [InlineData("")] [InlineData("\0")] public void Clipboard_SetFileDropList_InvalidFileInPaths_ThrowsArgumentException(string filePath) @@ -385,7 +385,7 @@ public void Clipboard_SetFileDropList_NotSta_ThrowsThreadStateException() Assert.Throws(() => Clipboard.SetFileDropList(filePaths)); } - [StaFact] + [WinFormsFact] public void Clipboard_SetImage_InvokeBitmap_GetReturnsExpected() { using (var bitmap = new Bitmap(10, 10)) @@ -399,7 +399,7 @@ public void Clipboard_SetImage_InvokeBitmap_GetReturnsExpected() } } - [StaFact] + [WinFormsFact] public void Clipboard_SetImage_InvokeMetafile_GetReturnsExpected() { using (var metafile = new Metafile("bitmaps/telescope_01.wmf")) @@ -410,7 +410,7 @@ public void Clipboard_SetImage_InvokeMetafile_GetReturnsExpected() } } - [StaFact] + [WinFormsFact] public void Clipboard_SetImage_InvokeEnhancedMetafile_GetReturnsExpected() { using (var metafile = new Metafile("bitmaps/milkmateya01.emf")) @@ -421,7 +421,7 @@ public void Clipboard_SetImage_InvokeEnhancedMetafile_GetReturnsExpected() } } - [StaFact] + [WinFormsFact] public void Clipboard_SetImage_NullImage_ThrowsArgumentNullException() { Assert.Throws("image", () => Clipboard.SetImage(null)); @@ -440,7 +440,7 @@ public void Clipboard_SetImage_NotSta_ThrowsThreadStateException() } } - [StaFact] + [WinFormsFact] public void Clipboard_SetText_InvokeString_GetReturnsExpected() { Clipboard.SetText("text"); @@ -448,7 +448,7 @@ public void Clipboard_SetText_InvokeString_GetReturnsExpected() Assert.True(Clipboard.ContainsText()); } - [StaTheory] + [WinFormsTheory] [CommonMemberData(nameof(CommonTestHelper.GetEnumTypeTheoryData), typeof(TextDataFormat))] public void Clipboard_SetText_InvokeStringTextDataFormat_GetReturnsExpected(TextDataFormat format) { @@ -457,7 +457,7 @@ public void Clipboard_SetText_InvokeStringTextDataFormat_GetReturnsExpected(Text Assert.True(Clipboard.ContainsText(format)); } - [StaTheory] + [WinFormsTheory] [CommonMemberData(nameof(CommonTestHelper.GetNullOrEmptyStringTheoryData))] public void Clipboard_SetText_NullOrEmptyText_ThrowsArgumentNullException(string text) { @@ -465,7 +465,7 @@ public void Clipboard_SetText_NullOrEmptyText_ThrowsArgumentNullException(string Assert.Throws("text", () => Clipboard.SetText(text, TextDataFormat.Text)); } - [StaTheory] + [WinFormsTheory] [CommonMemberData(nameof(CommonTestHelper.GetEnumTypeTheoryDataInvalid), typeof(TextDataFormat))] public void Clipboard_SetText_InvalidFormat_ThrowsInvalidEnumArgumentException(TextDataFormat format) { diff --git a/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/ControlTests.Handlers.cs b/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/ControlTests.Handlers.cs index 8064935e61b..f10aae560c3 100644 --- a/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/ControlTests.Handlers.cs +++ b/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/ControlTests.Handlers.cs @@ -2267,7 +2267,7 @@ public void Control_OnHandleCreated_InvokeWithText_CallsHandleCreated(EventArgs Assert.Equal(expectedText, control.Text); } - [StaTheory] + [WinFormsTheory] [CommonMemberData(nameof(CommonTestHelper.GetEventArgsTheoryData))] public void Control_OnHandleCreated_InvokeWithHandleAllowDrop_CallsHandleCreated(EventArgs eventArgs) { @@ -2548,7 +2548,7 @@ public void Control_OnHandleDestroyed_InvokeWithHandleWithText_CallsHandleDestro Assert.Equal(expectedText, control.Text); } - [StaTheory] + [WinFormsTheory] [CommonMemberData(nameof(CommonTestHelper.GetEventArgsTheoryData))] public void Control_OnHandleDestroyed_InvokeWithHandleAllowDrop_CallsHandleDestroyed(EventArgs eventArgs) { diff --git a/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/ControlTests.Methods.cs b/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/ControlTests.Methods.cs index 5f0110d672b..fa6acf481a9 100644 --- a/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/ControlTests.Methods.cs +++ b/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/ControlTests.Methods.cs @@ -477,7 +477,7 @@ public void Control_CreateControl_InvokeWithText_Success(string text, string exp Assert.Equal(expectedText, control.Text); } - [StaFact] + [WinFormsFact] public void Control_CreateControl_InvokeAllowDrop_Success() { using var control = new SubControl @@ -664,7 +664,7 @@ public void Control_CreateHandle_InvokeWithText_Success(string text, string expe Assert.Equal(expectedText, control.Text); } - [StaFact] + [WinFormsFact] public void Control_CreateHandle_InvokeAllowDrop_Success() { using var control = new SubControl @@ -882,7 +882,7 @@ public void Control_DestroyHandle_InvokeWithRegion_Success(Region region) Assert.Same(region, control.Region); } - [StaFact] + [WinFormsFact] public void Control_DestroyHandle_InvokeWithHandleAllowDrop_Success() { using var control = new SubControl @@ -1805,7 +1805,8 @@ public static IEnumerable DoDragDrop_TestData() } } - [WinFormsTheory] + [WinFormsTheory(Skip = "hangs CI, see https://github.com/dotnet/winforms/issues/3336")] + [ActiveIssue("https://github.com/dotnet/winforms/issues/3336")] [MemberData(nameof(DoDragDrop_TestData))] public void Control_DoDragDrop_Invoke_ReturnsNone(object data, DragDropEffects allowedEffects) { @@ -1814,7 +1815,8 @@ public void Control_DoDragDrop_Invoke_ReturnsNone(object data, DragDropEffects a Assert.False(control.IsHandleCreated); } - [WinFormsTheory] + [WinFormsTheory(Skip = "hangs CI, see https://github.com/dotnet/winforms/issues/3336")] + [ActiveIssue("https://github.com/dotnet/winforms/issues/3336")] [MemberData(nameof(DoDragDrop_TestData))] public void Control_DoDragDrop_InvokeWithHandle_ReturnsNone(object data, DragDropEffects allowedEffects) { diff --git a/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/ToolStripItemTests.cs b/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/ToolStripItemTests.cs index 721efe40018..283c7a999da 100644 --- a/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/ToolStripItemTests.cs +++ b/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/ToolStripItemTests.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. @@ -10080,7 +10080,8 @@ public static IEnumerable DoDragDrop_TestData() } } - [WinFormsTheory] + [WinFormsTheory(Skip = "hangs CI, see https://github.com/dotnet/winforms/issues/3336")] + [ActiveIssue("https://github.com/dotnet/winforms/issues/3336")] [MemberData(nameof(DoDragDrop_TestData))] public void ToolStripItem_DoDragDrop_Invoke_ReturnsNone(object data, DragDropEffects allowedEffects) { @@ -10088,7 +10089,8 @@ public void ToolStripItem_DoDragDrop_Invoke_ReturnsNone(object data, DragDropEff Assert.Equal(DragDropEffects.None, item.DoDragDrop(data, allowedEffects)); } - [WinFormsTheory] + [WinFormsTheory(Skip = "hangs CI, see https://github.com/dotnet/winforms/issues/3336")] + [ActiveIssue("https://github.com/dotnet/winforms/issues/3336")] [MemberData(nameof(DoDragDrop_TestData))] public void ToolStripItem_DoDragDrop_InvokeWithParent_ReturnsNone(object data, DragDropEffects allowedEffects) { @@ -10101,7 +10103,8 @@ public void ToolStripItem_DoDragDrop_InvokeWithParent_ReturnsNone(object data, D Assert.False(parent.IsHandleCreated); } - [WinFormsTheory] + [WinFormsTheory(Skip = "hangs CI, see https://github.com/dotnet/winforms/issues/3336")] + [ActiveIssue("https://github.com/dotnet/winforms/issues/3336")] [MemberData(nameof(DoDragDrop_TestData))] public void ToolStripItem_DoDragDrop_InvokeWithParentAllowItemReorder_ReturnsNone(object data, DragDropEffects allowedEffects) { @@ -10117,7 +10120,8 @@ public void ToolStripItem_DoDragDrop_InvokeWithParentAllowItemReorder_ReturnsNon Assert.False(parent.IsHandleCreated); } - [WinFormsTheory] + [WinFormsTheory(Skip = "hangs CI, see https://github.com/dotnet/winforms/issues/3336")] + [ActiveIssue("https://github.com/dotnet/winforms/issues/3336")] [MemberData(nameof(DoDragDrop_TestData))] public void ToolStripItem_DoDragDrop_InvokeWithOwner_ReturnsNone(object data, DragDropEffects allowedEffects) { @@ -10130,7 +10134,8 @@ public void ToolStripItem_DoDragDrop_InvokeWithOwner_ReturnsNone(object data, Dr Assert.False(owner.IsHandleCreated); } - [WinFormsTheory] + [WinFormsTheory(Skip = "hangs CI, see https://github.com/dotnet/winforms/issues/3336")] + [ActiveIssue("https://github.com/dotnet/winforms/issues/3336")] [MemberData(nameof(DoDragDrop_TestData))] public void ToolStripItem_DoDragDrop_InvokeWithOwnerAllowItemReorder_ReturnsNone(object data, DragDropEffects allowedEffects) { @@ -10146,7 +10151,8 @@ public void ToolStripItem_DoDragDrop_InvokeWithOwnerAllowItemReorder_ReturnsNone Assert.False(owner.IsHandleCreated); } - [WinFormsFact] + [WinFormsFact(Skip = "hangs CI, see https://github.com/dotnet/winforms/issues/3336")] + [ActiveIssue("https://github.com/dotnet/winforms/issues/3336")] public void ToolStripItem_DoDragDrop_NullData_ThrowsArgumentNullException() { using var item = new SubToolStripItem(); diff --git a/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/WindowsFormsSynchronizationContextTests.cs b/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/WindowsFormsSynchronizationContextTests.cs index 54009de7faf..b50070bf42e 100644 --- a/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/WindowsFormsSynchronizationContextTests.cs +++ b/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/WindowsFormsSynchronizationContextTests.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. @@ -34,7 +34,8 @@ public void WindowsFormsSynchronizationContext_CreateCopy_Invoke_Success() Assert.Equal(2, callCount); } - [WinFormsFact] + [WinFormsFact(Skip = "WindowsFormsSynchronizationContext disposed of too early. See: https://github.com/dotnet/winforms/issues/3297")] + [ActiveIssue("https://github.com/dotnet/winforms/issues/3297")] public void WindowsFormsSynchronizationContext_Dispose_MultipleTimes_Success() { var context = new WindowsFormsSynchronizationContext(); @@ -91,7 +92,8 @@ public void WindowsFormsSynchronizationContext_Send_InvokeDeletedThread_ThrowsIn Assert.Equal(0, callCount); } - [WinFormsTheory] + [WinFormsTheory(Skip = "WindowsFormsSynchronizationContext disposed of too early. See: https://github.com/dotnet/winforms/issues/3297")] + [ActiveIssue("https://github.com/dotnet/winforms/issues/3297")] [MemberData(nameof(Send_TestData))] public void WindowsFormsSynchronizationContext_Send_InvokeDisposed_Nop(object state) { @@ -133,7 +135,8 @@ public void WindowsFormsSynchronizationContext_Post_InvokeSameThread_Success(obj Assert.Equal(0, callCount); } - [WinFormsTheory] + [WinFormsTheory(Skip = "WindowsFormsSynchronizationContext disposed of too early. See: https://github.com/dotnet/winforms/issues/3297")] + [ActiveIssue("https://github.com/dotnet/winforms/issues/3297")] [MemberData(nameof(Send_TestData))] public void WindowsFormsSynchronizationContext_Post_InvokeDisposed_Nop(object state) { diff --git a/src/System.Windows.Forms/tests/UnitTests/WebBrowserBaseTests.cs b/src/System.Windows.Forms/tests/UnitTests/WebBrowserBaseTests.cs index 72c83f1bf2a..1fc17f5f070 100644 --- a/src/System.Windows.Forms/tests/UnitTests/WebBrowserBaseTests.cs +++ b/src/System.Windows.Forms/tests/UnitTests/WebBrowserBaseTests.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. @@ -285,7 +285,7 @@ public void WebBrowserBase_Site_Set_GetReturnsExpected() Assert.False(control.IsHandleCreated); } - [StaFact] + [WinFormsFact] public void WebBrowserBase_BackColorChanged_AddRemove_ThrowsNotSupportedException() { using var control = new SubWebBrowserBase("8856f961-340a-11d0-a96b-00c04fd705a2"); @@ -294,7 +294,7 @@ public void WebBrowserBase_BackColorChanged_AddRemove_ThrowsNotSupportedExceptio control.BackColorChanged -= handler; } - [StaFact] + [WinFormsFact] public void WebBrowserBase_BackgroundImageChanged_AddRemove_ThrowsNotSupportedException() { using var control = new SubWebBrowserBase("8856f961-340a-11d0-a96b-00c04fd705a2"); @@ -303,7 +303,7 @@ public void WebBrowserBase_BackgroundImageChanged_AddRemove_ThrowsNotSupportedEx control.BackgroundImageChanged -= handler; } - [StaFact] + [WinFormsFact] public void WebBrowserBase_BackgroundImageLayoutChanged_AddRemove_ThrowsNotSupportedException() { using var control = new SubWebBrowserBase("8856f961-340a-11d0-a96b-00c04fd705a2"); @@ -312,7 +312,7 @@ public void WebBrowserBase_BackgroundImageLayoutChanged_AddRemove_ThrowsNotSuppo control.BackgroundImageLayoutChanged -= handler; } - [StaFact] + [WinFormsFact] public void WebBrowserBase_BindingContextChanged_AddRemove_ThrowsNotSupportedException() { using var control = new SubWebBrowserBase("8856f961-340a-11d0-a96b-00c04fd705a2"); @@ -321,7 +321,7 @@ public void WebBrowserBase_BindingContextChanged_AddRemove_ThrowsNotSupportedExc control.BindingContextChanged -= handler; } - [StaFact] + [WinFormsFact] public void WebBrowserBase_UICuesEventHandler_AddRemove_ThrowsNotSupportedException() { using var control = new SubWebBrowserBase("8856f961-340a-11d0-a96b-00c04fd705a2"); @@ -330,7 +330,7 @@ public void WebBrowserBase_UICuesEventHandler_AddRemove_ThrowsNotSupportedExcept control.ChangeUICues -= handler; } - [StaFact] + [WinFormsFact] public void WebBrowserBase_Click_AddRemove_ThrowsNotSupportedException() { using var control = new SubWebBrowserBase("8856f961-340a-11d0-a96b-00c04fd705a2"); @@ -339,7 +339,7 @@ public void WebBrowserBase_Click_AddRemove_ThrowsNotSupportedException() control.Click -= handler; } - [StaFact] + [WinFormsFact] public void WebBrowserBase_CursorChanged_AddRemove_ThrowsNotSupportedException() { using var control = new SubWebBrowserBase("8856f961-340a-11d0-a96b-00c04fd705a2"); @@ -348,7 +348,7 @@ public void WebBrowserBase_CursorChanged_AddRemove_ThrowsNotSupportedException() control.CursorChanged -= handler; } - [StaFact] + [WinFormsFact] public void WebBrowserBase_DoubleClick_AddRemove_ThrowsNotSupportedException() { using var control = new SubWebBrowserBase("8856f961-340a-11d0-a96b-00c04fd705a2"); @@ -357,7 +357,7 @@ public void WebBrowserBase_DoubleClick_AddRemove_ThrowsNotSupportedException() control.DoubleClick -= handler; } - [StaFact] + [WinFormsFact] public void WebBrowserBase_DragDrop_AddRemove_ThrowsNotSupportedException() { using var control = new SubWebBrowserBase("8856f961-340a-11d0-a96b-00c04fd705a2"); @@ -366,7 +366,7 @@ public void WebBrowserBase_DragDrop_AddRemove_ThrowsNotSupportedException() control.DragDrop -= handler; } - [StaFact] + [WinFormsFact] public void WebBrowserBase_DragEnter_AddRemove_ThrowsNotSupportedException() { using var control = new SubWebBrowserBase("8856f961-340a-11d0-a96b-00c04fd705a2"); @@ -375,7 +375,7 @@ public void WebBrowserBase_DragEnter_AddRemove_ThrowsNotSupportedException() control.DragEnter -= handler; } - [StaFact] + [WinFormsFact] public void WebBrowserBase_DragLeave_AddRemove_ThrowsNotSupportedException() { using var control = new SubWebBrowserBase("8856f961-340a-11d0-a96b-00c04fd705a2"); @@ -384,7 +384,7 @@ public void WebBrowserBase_DragLeave_AddRemove_ThrowsNotSupportedException() control.DragLeave -= handler; } - [StaFact] + [WinFormsFact] public void WebBrowserBase_DragOver_AddRemove_ThrowsNotSupportedException() { using var control = new SubWebBrowserBase("8856f961-340a-11d0-a96b-00c04fd705a2"); @@ -393,7 +393,7 @@ public void WebBrowserBase_DragOver_AddRemove_ThrowsNotSupportedException() control.DragOver -= handler; } - [StaFact] + [WinFormsFact] public void WebBrowserBase_EnabledChanged_AddRemove_ThrowsNotSupportedException() { using var control = new SubWebBrowserBase("8856f961-340a-11d0-a96b-00c04fd705a2"); @@ -402,7 +402,7 @@ public void WebBrowserBase_EnabledChanged_AddRemove_ThrowsNotSupportedException( control.EnabledChanged -= handler; } - [StaFact] + [WinFormsFact] public void WebBrowserBase_Enter_AddRemove_ThrowsNotSupportedException() { using var control = new SubWebBrowserBase("8856f961-340a-11d0-a96b-00c04fd705a2"); @@ -411,7 +411,7 @@ public void WebBrowserBase_Enter_AddRemove_ThrowsNotSupportedException() control.Enter -= handler; } - [StaFact] + [WinFormsFact] public void WebBrowserBase_FontChanged_AddRemove_ThrowsNotSupportedException() { using var control = new SubWebBrowserBase("8856f961-340a-11d0-a96b-00c04fd705a2"); @@ -420,7 +420,7 @@ public void WebBrowserBase_FontChanged_AddRemove_ThrowsNotSupportedException() control.FontChanged -= handler; } - [StaFact] + [WinFormsFact] public void WebBrowserBase_ForeColorChanged_AddRemove_ThrowsNotSupportedException() { using var control = new SubWebBrowserBase("8856f961-340a-11d0-a96b-00c04fd705a2"); @@ -429,7 +429,7 @@ public void WebBrowserBase_ForeColorChanged_AddRemove_ThrowsNotSupportedExceptio control.ForeColorChanged -= handler; } - [StaFact] + [WinFormsFact] public void WebBrowserBase_GiveFeedback_AddRemove_ThrowsNotSupportedException() { using var control = new SubWebBrowserBase("8856f961-340a-11d0-a96b-00c04fd705a2"); @@ -438,7 +438,7 @@ public void WebBrowserBase_GiveFeedback_AddRemove_ThrowsNotSupportedException() control.GiveFeedback -= handler; } - [StaFact] + [WinFormsFact] public void WebBrowserBase_HelpRequested_AddRemove_ThrowsNotSupportedException() { using var control = new SubWebBrowserBase("8856f961-340a-11d0-a96b-00c04fd705a2"); @@ -447,7 +447,7 @@ public void WebBrowserBase_HelpRequested_AddRemove_ThrowsNotSupportedException() control.HelpRequested -= handler; } - [StaFact] + [WinFormsFact] public void WebBrowserBase_ImeModeChanged_AddRemove_ThrowsNotSupportedException() { using var control = new SubWebBrowserBase("8856f961-340a-11d0-a96b-00c04fd705a2"); @@ -456,7 +456,7 @@ public void WebBrowserBase_ImeModeChanged_AddRemove_ThrowsNotSupportedException( control.ImeModeChanged -= handler; } - [StaFact] + [WinFormsFact] public void WebBrowserBase_KeyDown_AddRemove_ThrowsNotSupportedException() { using var control = new SubWebBrowserBase("8856f961-340a-11d0-a96b-00c04fd705a2"); @@ -465,7 +465,7 @@ public void WebBrowserBase_KeyDown_AddRemove_ThrowsNotSupportedException() control.KeyDown -= handler; } - [StaFact] + [WinFormsFact] public void WebBrowserBase_KeyPress_AddRemove_ThrowsNotSupportedException() { using var control = new SubWebBrowserBase("8856f961-340a-11d0-a96b-00c04fd705a2"); @@ -474,7 +474,7 @@ public void WebBrowserBase_KeyPress_AddRemove_ThrowsNotSupportedException() control.KeyPress -= handler; } - [StaFact] + [WinFormsFact] public void WebBrowserBase_KeyUp_AddRemove_ThrowsNotSupportedException() { using var control = new SubWebBrowserBase("8856f961-340a-11d0-a96b-00c04fd705a2"); @@ -483,7 +483,7 @@ public void WebBrowserBase_KeyUp_AddRemove_ThrowsNotSupportedException() control.KeyUp -= handler; } - [StaFact] + [WinFormsFact] public void WebBrowserBase_Layout_AddRemove_ThrowsNotSupportedException() { using var control = new SubWebBrowserBase("8856f961-340a-11d0-a96b-00c04fd705a2"); @@ -492,7 +492,7 @@ public void WebBrowserBase_Layout_AddRemove_ThrowsNotSupportedException() ((Control)control).Layout -= handler; } - [StaFact] + [WinFormsFact] public void WebBrowserBase_Leave_AddRemove_ThrowsNotSupportedException() { using var control = new SubWebBrowserBase("8856f961-340a-11d0-a96b-00c04fd705a2"); @@ -501,7 +501,7 @@ public void WebBrowserBase_Leave_AddRemove_ThrowsNotSupportedException() control.Leave -= handler; } - [StaFact] + [WinFormsFact] public void WebBrowserBase_MouseCaptureChanged_AddRemove_ThrowsNotSupportedException() { using var control = new SubWebBrowserBase("8856f961-340a-11d0-a96b-00c04fd705a2"); @@ -510,7 +510,7 @@ public void WebBrowserBase_MouseCaptureChanged_AddRemove_ThrowsNotSupportedExcep control.MouseCaptureChanged -= handler; } - [StaFact] + [WinFormsFact] public void WebBrowserBase_MouseClick_AddRemove_ThrowsNotSupportedException() { using var control = new SubWebBrowserBase("8856f961-340a-11d0-a96b-00c04fd705a2"); @@ -519,7 +519,7 @@ public void WebBrowserBase_MouseClick_AddRemove_ThrowsNotSupportedException() control.MouseClick -= handler; } - [StaFact] + [WinFormsFact] public void WebBrowserBase_MouseDoubleClick_AddRemove_ThrowsNotSupportedException() { using var control = new SubWebBrowserBase("8856f961-340a-11d0-a96b-00c04fd705a2"); @@ -528,7 +528,7 @@ public void WebBrowserBase_MouseDoubleClick_AddRemove_ThrowsNotSupportedExceptio control.MouseDoubleClick -= handler; } - [StaFact] + [WinFormsFact] public void WebBrowserBase_MouseDown_AddRemove_ThrowsNotSupportedException() { using var control = new SubWebBrowserBase("8856f961-340a-11d0-a96b-00c04fd705a2"); @@ -537,7 +537,7 @@ public void WebBrowserBase_MouseDown_AddRemove_ThrowsNotSupportedException() control.MouseDown -= handler; } - [StaFact] + [WinFormsFact] public void WebBrowserBase_MouseEnter_AddRemove_ThrowsNotSupportedException() { using var control = new SubWebBrowserBase("8856f961-340a-11d0-a96b-00c04fd705a2"); @@ -546,7 +546,7 @@ public void WebBrowserBase_MouseEnter_AddRemove_ThrowsNotSupportedException() control.MouseEnter -= handler; } - [StaFact] + [WinFormsFact] public void WebBrowserBase_MouseHover_AddRemove_ThrowsNotSupportedException() { using var control = new SubWebBrowserBase("8856f961-340a-11d0-a96b-00c04fd705a2"); @@ -555,7 +555,7 @@ public void WebBrowserBase_MouseHover_AddRemove_ThrowsNotSupportedException() control.MouseHover -= handler; } - [StaFact] + [WinFormsFact] public void WebBrowserBase_MouseLeave_AddRemove_ThrowsNotSupportedException() { using var control = new SubWebBrowserBase("8856f961-340a-11d0-a96b-00c04fd705a2"); @@ -564,7 +564,7 @@ public void WebBrowserBase_MouseLeave_AddRemove_ThrowsNotSupportedException() control.MouseLeave -= handler; } - [StaFact] + [WinFormsFact] public void WebBrowserBase_MouseMove_AddRemove_ThrowsNotSupportedException() { using var control = new SubWebBrowserBase("8856f961-340a-11d0-a96b-00c04fd705a2"); @@ -573,7 +573,7 @@ public void WebBrowserBase_MouseMove_AddRemove_ThrowsNotSupportedException() control.MouseMove -= handler; } - [StaFact] + [WinFormsFact] public void WebBrowserBase_MouseUp_AddRemove_ThrowsNotSupportedException() { using var control = new SubWebBrowserBase("8856f961-340a-11d0-a96b-00c04fd705a2"); @@ -582,7 +582,7 @@ public void WebBrowserBase_MouseUp_AddRemove_ThrowsNotSupportedException() control.MouseUp -= handler; } - [StaFact] + [WinFormsFact] public void WebBrowserBase_MouseWheel_AddRemove_ThrowsNotSupportedException() { using var control = new SubWebBrowserBase("8856f961-340a-11d0-a96b-00c04fd705a2"); @@ -591,7 +591,7 @@ public void WebBrowserBase_MouseWheel_AddRemove_ThrowsNotSupportedException() control.MouseWheel -= handler; } - [StaFact] + [WinFormsFact] public void WebBrowserBase_Paint_AddRemove_ThrowsNotSupportedException() { using var control = new SubWebBrowserBase("8856f961-340a-11d0-a96b-00c04fd705a2"); @@ -600,7 +600,7 @@ public void WebBrowserBase_Paint_AddRemove_ThrowsNotSupportedException() control.Paint -= handler; } - [StaFact] + [WinFormsFact] public void WebBrowserBase_QueryAccessibilityHelp__AddRemove_ThrowsNotSupportedException() { using var control = new SubWebBrowserBase("8856f961-340a-11d0-a96b-00c04fd705a2"); @@ -609,7 +609,7 @@ public void WebBrowserBase_QueryAccessibilityHelp__AddRemove_ThrowsNotSupportedE control.QueryAccessibilityHelp -= handler; } - [StaFact] + [WinFormsFact] public void WebBrowserBase_QueryContinueDrag__AddRemove_ThrowsNotSupportedException() { using var control = new SubWebBrowserBase("8856f961-340a-11d0-a96b-00c04fd705a2"); @@ -618,7 +618,7 @@ public void WebBrowserBase_QueryContinueDrag__AddRemove_ThrowsNotSupportedExcept control.QueryContinueDrag -= handler; } - [StaFact] + [WinFormsFact] public void WebBrowserBase_RightToLeftChanged_AddRemove_ThrowsNotSupportedException() { using var control = new SubWebBrowserBase("8856f961-340a-11d0-a96b-00c04fd705a2"); @@ -627,7 +627,7 @@ public void WebBrowserBase_RightToLeftChanged_AddRemove_ThrowsNotSupportedExcept control.RightToLeftChanged -= handler; } - [StaFact] + [WinFormsFact] public void WebBrowserBase_StyleChanged_AddRemove_ThrowsNotSupportedException() { using var control = new SubWebBrowserBase("8856f961-340a-11d0-a96b-00c04fd705a2"); @@ -636,7 +636,7 @@ public void WebBrowserBase_StyleChanged_AddRemove_ThrowsNotSupportedException() control.StyleChanged -= handler; } - [StaFact] + [WinFormsFact] public void WebBrowserBase_TextChanged_AddRemove_ThrowsNotSupportedException() { using var control = new SubWebBrowserBase("8856f961-340a-11d0-a96b-00c04fd705a2");