From 79f1931fb9fc146ede2703e6de2348b091fc7219 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Mon, 4 Nov 2019 17:04:56 -0700 Subject: [PATCH] Replace DESKTOP symbol with NETFRAMEWORK --- .../AsyncLocalTests.cs | 4 ++-- .../AsyncReaderWriterLockTests.cs | 4 ++-- .../DispatcherExtensionsTests.cs | 2 +- .../Microsoft.VisualStudio.Threading.Tests.csproj | 5 ++--- .../SingleThreadedTestSynchronizationContext.cs | 4 ++-- src/Microsoft.VisualStudio.Threading.Tests/TestUtilities.cs | 6 +++--- .../DispatcherExtensions.cs | 2 +- .../Microsoft.VisualStudio.Threading.csproj | 5 +---- 8 files changed, 14 insertions(+), 18 deletions(-) diff --git a/src/Microsoft.VisualStudio.Threading.Tests/AsyncLocalTests.cs b/src/Microsoft.VisualStudio.Threading.Tests/AsyncLocalTests.cs index 58e2e6eb6..adb9e7ce7 100644 --- a/src/Microsoft.VisualStudio.Threading.Tests/AsyncLocalTests.cs +++ b/src/Microsoft.VisualStudio.Threading.Tests/AsyncLocalTests.cs @@ -190,7 +190,7 @@ public void AsyncLocalPerfTest() this.Logger.WriteLine("Reading {0} values took {1} ms", values.Length, reads.ElapsedMilliseconds); } -#if DESKTOP +#if NETFRAMEWORK [Fact] public void CallAcrossAppDomainBoundariesWithNonSerializableData() { @@ -255,7 +255,7 @@ await Task.WhenAll( Assert.Null(asyncLocal.Value); } -#if DESKTOP +#if NETFRAMEWORK private class OtherDomainProxy : MarshalByRefObject { internal void SomeMethod(int callingAppDomainId) diff --git a/src/Microsoft.VisualStudio.Threading.Tests/AsyncReaderWriterLockTests.cs b/src/Microsoft.VisualStudio.Threading.Tests/AsyncReaderWriterLockTests.cs index 0ec71b27e..a44b28975 100644 --- a/src/Microsoft.VisualStudio.Threading.Tests/AsyncReaderWriterLockTests.cs +++ b/src/Microsoft.VisualStudio.Threading.Tests/AsyncReaderWriterLockTests.cs @@ -261,7 +261,7 @@ public async Task NoMemoryLeakForManyLocks() } } -#if DESKTOP +#if NETFRAMEWORK [Fact, Trait("TestCategory", "FailsInCloudTest")] public async Task CallAcrossAppDomainBoundariesWithLock() { @@ -4868,7 +4868,7 @@ private async Task MitigationAgainstAccidentalLockForkingHelper(Functrue true - true - $(DefineConstants);DESKTOP;ISOLATED_TEST_SUPPORT + $(DefineConstants);ISOLATED_TEST_SUPPORT @@ -40,7 +39,7 @@ - + diff --git a/src/Microsoft.VisualStudio.Threading.Tests/SingleThreadedTestSynchronizationContext.cs b/src/Microsoft.VisualStudio.Threading.Tests/SingleThreadedTestSynchronizationContext.cs index eeb3f72eb..3299a0ca9 100644 --- a/src/Microsoft.VisualStudio.Threading.Tests/SingleThreadedTestSynchronizationContext.cs +++ b/src/Microsoft.VisualStudio.Threading.Tests/SingleThreadedTestSynchronizationContext.cs @@ -1,4 +1,4 @@ -#if DESKTOP +#if NETFRAMEWORK #define UseWpfContext #endif @@ -8,7 +8,7 @@ namespace Microsoft.VisualStudio.Threading.Tests using System.Collections.Generic; using System.Reflection; using System.Threading; -#if DESKTOP +#if NETFRAMEWORK using System.Windows.Threading; #endif diff --git a/src/Microsoft.VisualStudio.Threading.Tests/TestUtilities.cs b/src/Microsoft.VisualStudio.Threading.Tests/TestUtilities.cs index fecdf607f..54c2d504d 100644 --- a/src/Microsoft.VisualStudio.Threading.Tests/TestUtilities.cs +++ b/src/Microsoft.VisualStudio.Threading.Tests/TestUtilities.cs @@ -93,7 +93,7 @@ internal static T[] ConcurrencyTest(Func action, int concurrency = -1) internal static DebugAssertionRevert DisableAssertionDialog() { -#if DESKTOP +#if NETFRAMEWORK var listener = Debug.Listeners.OfType().FirstOrDefault(); if (listener != null) { @@ -194,7 +194,7 @@ internal static Task ExecuteInIsolationAsync(string testClassName, string Requires.NotNullOrEmpty(testClassName, nameof(testClassName)); Requires.NotNullOrEmpty(testMethodName, nameof(testMethodName)); -#if DESKTOP +#if NETFRAMEWORK const string testHostProcessName = "IsolatedTestHost.exe"; if (Process.GetCurrentProcess().ProcessName == Path.GetFileNameWithoutExtension(testHostProcessName)) { @@ -370,7 +370,7 @@ public void GetResult() { public void Dispose() { -#if DESKTOP +#if NETFRAMEWORK var listener = Debug.Listeners.OfType().FirstOrDefault(); if (listener != null) { diff --git a/src/Microsoft.VisualStudio.Threading/DispatcherExtensions.cs b/src/Microsoft.VisualStudio.Threading/DispatcherExtensions.cs index a2cdfe7cb..3d55f085a 100644 --- a/src/Microsoft.VisualStudio.Threading/DispatcherExtensions.cs +++ b/src/Microsoft.VisualStudio.Threading/DispatcherExtensions.cs @@ -4,7 +4,7 @@ * * *********************************************************/ -#if DESKTOP +#if NETFRAMEWORK namespace Microsoft.VisualStudio.Threading { diff --git a/src/Microsoft.VisualStudio.Threading/Microsoft.VisualStudio.Threading.csproj b/src/Microsoft.VisualStudio.Threading/Microsoft.VisualStudio.Threading.csproj index 9371f4711..c430f6231 100644 --- a/src/Microsoft.VisualStudio.Threading/Microsoft.VisualStudio.Threading.csproj +++ b/src/Microsoft.VisualStudio.Threading/Microsoft.VisualStudio.Threading.csproj @@ -4,9 +4,6 @@ true FxCopRules.ruleset - true - $(DefineConstants);DESKTOP - Async synchronization primitives, async collections, TPL and dataflow extensions. Async synchronization primitives, async collections, TPL and dataflow extensions. The JoinableTaskFactory allows synchronously blocking the UI thread for async work. This package is applicable to any .NET application (not just Visual Studio). Threading Async Lock Synchronization Threadsafe @@ -38,7 +35,7 @@ - +