From ad6d25acfe816edcdd8693b84f761ee092d57e70 Mon Sep 17 00:00:00 2001 From: Kevin Pilch-Bisson Date: Tue, 15 Sep 2015 19:51:14 -0700 Subject: [PATCH] Start getting tests running --- .../Core/Shared/Utilities/ForegroundThreadAffinitizedObject.cs | 3 --- src/EditorFeatures/TestUtilities/Async/WaitHelper.cs | 3 +-- src/EditorFeatures/TestUtilities/DispatcherExtensions.cs | 2 +- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/EditorFeatures/Core/Shared/Utilities/ForegroundThreadAffinitizedObject.cs b/src/EditorFeatures/Core/Shared/Utilities/ForegroundThreadAffinitizedObject.cs index c6f61138ea6..26b6dcc6f2b 100644 --- a/src/EditorFeatures/Core/Shared/Utilities/ForegroundThreadAffinitizedObject.cs +++ b/src/EditorFeatures/Core/Shared/Utilities/ForegroundThreadAffinitizedObject.cs @@ -14,10 +14,7 @@ namespace Microsoft.CodeAnalysis.Editor.Shared.Utilities /// internal class ForegroundThreadAffinitizedObject { - [ThreadStatic] private static Thread s_foregroundThread; - - [ThreadStatic] private static TaskScheduler s_foregroundTaskScheduler; internal static Thread ForegroundThread diff --git a/src/EditorFeatures/TestUtilities/Async/WaitHelper.cs b/src/EditorFeatures/TestUtilities/Async/WaitHelper.cs index 14f79597cb1..3702b228c8a 100644 --- a/src/EditorFeatures/TestUtilities/Async/WaitHelper.cs +++ b/src/EditorFeatures/TestUtilities/Async/WaitHelper.cs @@ -13,8 +13,7 @@ public static class WaitHelper { public static void WaitForDispatchedOperationsToComplete(DispatcherPriority priority) { - Action action = delegate { }; - new FrameworkElement().Dispatcher.Invoke(action, priority); + new FrameworkElement().Dispatcher.DoEvents(); } public static void PumpingWait(this Task task) diff --git a/src/EditorFeatures/TestUtilities/DispatcherExtensions.cs b/src/EditorFeatures/TestUtilities/DispatcherExtensions.cs index 267e5ce7e4f..661c7e6404e 100644 --- a/src/EditorFeatures/TestUtilities/DispatcherExtensions.cs +++ b/src/EditorFeatures/TestUtilities/DispatcherExtensions.cs @@ -18,7 +18,7 @@ public static void DoEvents(this Dispatcher dispatcher) // complete mark the frame as complete so the dispatcher loop // pops out (stops). var operation = dispatcher.BeginInvoke( - DispatcherPriority.Background, callback, frame); + DispatcherPriority.SystemIdle, callback, frame); // Start the loop. It will process all items in the queue, then // will process the above callback. That callback will tell the -- GitLab