From bb70e7077f5749608994b2d590c5df7ef7258a7c Mon Sep 17 00:00:00 2001 From: Ryan Brandenburg Date: Tue, 8 May 2018 12:00:27 -0700 Subject: [PATCH] Handle ifdefs --- .../Autobahn/AutobahnTester.cs | 8 +++----- .../WebSocketMiddlewareTests.cs | 4 ++-- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/test/Microsoft.AspNetCore.WebSockets.ConformanceTest/Autobahn/AutobahnTester.cs b/test/Microsoft.AspNetCore.WebSockets.ConformanceTest/Autobahn/AutobahnTester.cs index 752573f9fc..b6775db4e4 100644 --- a/test/Microsoft.AspNetCore.WebSockets.ConformanceTest/Autobahn/AutobahnTester.cs +++ b/test/Microsoft.AspNetCore.WebSockets.ConformanceTest/Autobahn/AutobahnTester.cs @@ -136,10 +136,8 @@ namespace Microsoft.AspNetCore.WebSockets.ConformanceTest.Autobahn var appPath = Helpers.GetApplicationPath("AutobahnTestApp"); var configPath = Path.Combine(Directory.GetCurrentDirectory(), "..", "..", "..", "Http.config"); var targetFramework = -#if NETCOREAPP2_1 - "netcoreapp2.1"; -#elif NETCOREAPP2_0 - "netcoreapp2.0"; +#if NETCOREAPP2_2 + "netcoreapp2.2"; #else #error Target frameworks need to be updated #endif @@ -160,7 +158,7 @@ namespace Microsoft.AspNetCore.WebSockets.ConformanceTest.Autobahn cancellationToken.ThrowIfCancellationRequested(); var handler = new HttpClientHandler(); - // Win7 HttpClient on NetCoreApp2.1 defaults to TLS 1.0 and won't connect to Kestrel. https://github.com/dotnet/corefx/issues/28733 + // Win7 HttpClient on NetCoreApp2.2 defaults to TLS 1.0 and won't connect to Kestrel. https://github.com/dotnet/corefx/issues/28733 // Mac HttpClient on NetCoreApp2.0 doesn't alow you to set some combinations. // https://github.com/dotnet/corefx/blob/586cffcdfdf23ad6c193a4bf37fce88a1bf69508/src/System.Net.Http/src/System/Net/Http/CurlHandler/CurlHandler.SslProvider.OSX.cs#L104-L106 handler.SslProtocols = SslProtocols.Tls12 | SslProtocols.Tls11 | SslProtocols.Tls; diff --git a/test/Microsoft.AspNetCore.WebSockets.Test/WebSocketMiddlewareTests.cs b/test/Microsoft.AspNetCore.WebSockets.Test/WebSocketMiddlewareTests.cs index e966aea6b4..fd2fbc8d51 100644 --- a/test/Microsoft.AspNetCore.WebSockets.Test/WebSocketMiddlewareTests.cs +++ b/test/Microsoft.AspNetCore.WebSockets.Test/WebSocketMiddlewareTests.cs @@ -13,10 +13,10 @@ using Xunit.Abstractions; namespace Microsoft.AspNetCore.WebSockets.Test { -#if NET461 || NETCOREAPP2_0 +#if NET461 // ClientWebSocket does not support WebSockets on these platforms and OS. Kestrel does support it. [OSSkipCondition(OperatingSystems.Windows, WindowsVersions.Win7, SkipReason = "No WebSockets Client for this platform")] -#elif NETCOREAPP2_1 +#elif NETCOREAPP2_2 // ClientWebSocket has added support for WebSockets on Win7. #else #error Unknown TFM