|
@@ -43,8 +43,7 @@ namespace Avalonia.UnitTests
|
|
public static IDisposable Start(TestServices services = null)
|
|
public static IDisposable Start(TestServices services = null)
|
|
{
|
|
{
|
|
var scope = AvaloniaLocator.EnterScope();
|
|
var scope = AvaloniaLocator.EnterScope();
|
|
- SynchronizationContext.SetSynchronizationContext(null);
|
|
|
|
- AvaloniaSynchronizationContext.InstallIfNeeded();
|
|
|
|
|
|
+ var oldContext = SynchronizationContext.Current;
|
|
_ = new UnitTestApplication(services);
|
|
_ = new UnitTestApplication(services);
|
|
Dispatcher.ResetForUnitTests();
|
|
Dispatcher.ResetForUnitTests();
|
|
return Disposable.Create(() =>
|
|
return Disposable.Create(() =>
|
|
@@ -56,7 +55,7 @@ namespace Avalonia.UnitTests
|
|
|
|
|
|
scope.Dispose();
|
|
scope.Dispose();
|
|
Dispatcher.ResetForUnitTests();
|
|
Dispatcher.ResetForUnitTests();
|
|
- SynchronizationContext.SetSynchronizationContext(null);
|
|
|
|
|
|
+ SynchronizationContext.SetSynchronizationContext(oldContext);
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|