diff --git a/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.Cancellation.cs b/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.Cancellation.cs index c5bed9f456739..654defa50b45e 100644 --- a/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.Cancellation.cs +++ b/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.Cancellation.cs @@ -274,6 +274,7 @@ await ValidateClientCancellationAsync(async () => [InlineData(CancellationMode.CancelPendingRequests, true)] [InlineData(CancellationMode.DisposeHttpClient, true)] [SkipOnPlatform(TestPlatforms.Browser, "Browser doesn't have blocking synchronous Stream.ReadByte and so it waits for whole body")] + [SkipOnPlatform(TestPlatforms.Wasi, "Wasi doesn't have blocking synchronous Stream.ReadByte and so it waits for whole body")] public async Task GetAsync_CancelPendingRequests_DoesntCancelReadAsyncOnResponseStream(CancellationMode mode, bool copyToAsync) { if (IsWinHttpHandler && UseVersion >= HttpVersion20.Value) @@ -347,6 +348,7 @@ await LoopbackServerFactory.CreateServerAsync(async (server, url) => [Fact] [SkipOnPlatform(TestPlatforms.Browser, "MaxConnectionsPerServer is not supported on Browser")] + [SkipOnPlatform(TestPlatforms.Wasi, "MaxConnectionsPerServer is not supported on Wasi")] public async Task MaxConnectionsPerServer_WaitingConnectionsAreCancelable() { if (LoopbackServerFactory.Version >= HttpVersion20.Value) diff --git a/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.Cookies.cs b/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.Cookies.cs index 73ef6a591a2be..b926ed50c6113 100644 --- a/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.Cookies.cs +++ b/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.Cookies.cs @@ -64,6 +64,7 @@ await LoopbackServerFactory.CreateClientAndServerAsync( [Theory] [MemberData(nameof(CookieNamesValuesAndUseCookies))] [SkipOnPlatform(TestPlatforms.Browser, "CookieContainer is not supported on Browser")] + [SkipOnPlatform(TestPlatforms.Wasi, "CookieContainer is not supported on Wasi")] public async Task GetAsync_SetCookieContainer_CookieSent(string cookieName, string cookieValue, bool useCookies) { await LoopbackServerFactory.CreateClientAndServerAsync( @@ -94,6 +95,7 @@ await LoopbackServerFactory.CreateClientAndServerAsync( [Fact] [SkipOnPlatform(TestPlatforms.Browser, "CookieContainer is not supported on Browser")] + [SkipOnPlatform(TestPlatforms.Wasi, "CookieContainer is not supported on Wasi")] public async Task GetAsync_SetCookieContainerMultipleCookies_CookiesSent() { var cookies = new Cookie[] @@ -230,6 +232,7 @@ private string GetCookieValue(HttpRequestData request) [Fact] [SkipOnPlatform(TestPlatforms.Browser, "CookieContainer is not supported on Browser")] + [SkipOnPlatform(TestPlatforms.Wasi, "CookieContainer is not supported on Wasi")] public async Task GetAsync_SetCookieContainerAndCookieHeader_BothCookiesSent() { await LoopbackServerFactory.CreateServerAsync(async (server, url) => @@ -258,6 +261,7 @@ await LoopbackServerFactory.CreateServerAsync(async (server, url) => [Fact] [SkipOnPlatform(TestPlatforms.Browser, "CookieContainer is not supported on Browser")] + [SkipOnPlatform(TestPlatforms.Wasi, "CookieContainer is not supported on Wasi")] public async Task GetAsync_SetCookieContainerAndMultipleCookieHeaders_BothCookiesSent() { await LoopbackServerFactory.CreateServerAsync(async (server, url) => @@ -298,6 +302,7 @@ await LoopbackServerFactory.CreateServerAsync(async (server, url) => [Fact] [SkipOnPlatform(TestPlatforms.Browser, "CookieContainer is not supported on Browser")] + [SkipOnPlatform(TestPlatforms.Wasi, "CookieContainer is not supported on Wasi")] public async Task GetAsyncWithRedirect_SetCookieContainer_CorrectCookiesSent() { if (UseVersion == HttpVersion30) @@ -345,6 +350,7 @@ await LoopbackServerFactory.CreateClientAndServerAsync(async url => [Theory] [MemberData(nameof(CookieNamesValuesAndUseCookies))] [SkipOnPlatform(TestPlatforms.Browser, "CookieContainer is not supported on Browser")] + [SkipOnPlatform(TestPlatforms.Wasi, "CookieContainer is not supported on Wasi")] public async Task GetAsync_ReceiveSetCookieHeader_CookieAdded(string cookieName, string cookieValue, bool useCookies) { await LoopbackServerFactory.CreateServerAsync(async (server, url) => @@ -377,6 +383,7 @@ await LoopbackServerFactory.CreateServerAsync(async (server, url) => [Fact] [SkipOnPlatform(TestPlatforms.Browser, "CookieContainer is not supported on Browser")] + [SkipOnPlatform(TestPlatforms.Wasi, "CookieContainer is not supported on Wasi")] public async Task GetAsync_ReceiveMultipleSetCookieHeaders_CookieAdded() { await LoopbackServerFactory.CreateServerAsync(async (server, url) => @@ -417,6 +424,7 @@ await LoopbackServerFactory.CreateServerAsync(async (server, url) => // ConditionalFact: CookieContainer does not follow RFC6265 on .NET Framework, therefore the (WinHttpHandler) test is expected to fail [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotNetFramework))] [SkipOnPlatform(TestPlatforms.Browser, "CookieContainer is not supported on Browser")] + [SkipOnPlatform(TestPlatforms.Wasi, "CookieContainer is not supported on Wasi")] public async Task GetAsync_NoPathDefined_CookieAddedWithDefaultPath() { await LoopbackServerFactory.CreateServerAsync(async (server, serverUrl) => @@ -447,6 +455,7 @@ await LoopbackServerFactory.CreateServerAsync(async (server, serverUrl) => // ConditionalFact: CookieContainer does not follow RFC6265 on .NET Framework, therefore the (WinHttpHandler) test is expected to fail [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotNetFramework))] [SkipOnPlatform(TestPlatforms.Browser, "CookieContainer is not supported on Browser")] + [SkipOnPlatform(TestPlatforms.Wasi, "CookieContainer is not supported on Wasi")] public async Task GetAsync_CookiePathDoesNotMatchRequestPath_CookieAccepted() { await LoopbackServerFactory.CreateServerAsync(async (server, serverUrl) => @@ -479,6 +488,7 @@ await LoopbackServerFactory.CreateServerAsync(async (server, serverUrl) => // ConditionalFact: CookieContainer does not follow RFC6265 on .NET Framework, therefore the (WinHttpHandler) test is expected to fail [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotNetFramework))] [SkipOnPlatform(TestPlatforms.Browser, "CookieContainer is not supported on Browser")] + [SkipOnPlatform(TestPlatforms.Wasi, "CookieContainer is not supported on Wasi")] public async Task GetAsync_Redirect_CookiesArePreserved() { if (UseVersion == HttpVersion30) @@ -528,6 +538,7 @@ await LoopbackServerFactory.CreateClientAndServerAsync(async serverUrl => [Fact] [SkipOnPlatform(TestPlatforms.Browser, "CookieContainer is not supported on Browser")] + [SkipOnPlatform(TestPlatforms.Wasi, "CookieContainer is not supported on Wasi")] public async Task GetAsync_ReceiveSetCookieHeader_CookieUpdated() { const string newCookieValue = "789"; @@ -556,6 +567,7 @@ await LoopbackServerFactory.CreateServerAsync(async (server, url) => [Fact] [SkipOnPlatform(TestPlatforms.Browser, "CookieContainer is not supported on Browser")] + [SkipOnPlatform(TestPlatforms.Wasi, "CookieContainer is not supported on Wasi")] public async Task GetAsync_ReceiveSetCookieHeader_CookieRemoved() { await LoopbackServerFactory.CreateServerAsync(async (server, url) => @@ -580,6 +592,7 @@ await LoopbackServerFactory.CreateServerAsync(async (server, url) => [Fact] [SkipOnPlatform(TestPlatforms.Browser, "CookieContainer is not supported on Browser")] + [SkipOnPlatform(TestPlatforms.Wasi, "CookieContainer is not supported on Wasi")] public async Task GetAsync_ReceiveInvalidSetCookieHeader_ValidCookiesAdded() { await LoopbackServerFactory.CreateServerAsync(async (server, url) => @@ -615,6 +628,7 @@ await LoopbackServerFactory.CreateServerAsync(async (server, url) => [Fact] [SkipOnPlatform(TestPlatforms.Browser, "CookieContainer is not supported on Browser")] + [SkipOnPlatform(TestPlatforms.Wasi, "CookieContainer is not supported on Wasi")] public async Task GetAsyncWithRedirect_ReceiveSetCookie_CookieSent() { if (UseVersion == HttpVersion30) @@ -675,6 +689,7 @@ await LoopbackServerFactory.CreateClientAndServerAsync(async url => [Fact] [SkipOnPlatform(TestPlatforms.Browser, "CookieContainer is not supported on Browser")] + [SkipOnPlatform(TestPlatforms.Wasi, "CookieContainer is not supported on Wasi")] public async Task GetAsyncWithBasicAuth_ReceiveSetCookie_CookieSent() { if (UseVersion == HttpVersion30) @@ -801,6 +816,7 @@ public HttpClientHandlerTest_Cookies_Http11(ITestOutputHelper output) : base(out [Fact] [SkipOnPlatform(TestPlatforms.Browser, "CookieContainer is not supported on Browser")] + [SkipOnPlatform(TestPlatforms.Wasi, "CookieContainer is not supported on Wasi")] public async Task GetAsync_ReceiveMultipleSetCookieHeaders_CookieAdded() { await LoopbackServer.CreateServerAsync(async (server, url) => diff --git a/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.Decompression.cs b/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.Decompression.cs index f45206e9941df..a6682b29a5815 100644 --- a/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.Decompression.cs +++ b/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.Decompression.cs @@ -37,6 +37,7 @@ public static IEnumerable DecompressedResponse_MethodSpecified_Decompr [Theory] [MemberData(nameof(DecompressedResponse_MethodSpecified_DecompressedContentReturned_MemberData))] [SkipOnPlatform(TestPlatforms.Browser, "AutomaticDecompression not supported on Browser")] + [SkipOnPlatform(TestPlatforms.Wasi, "AutomaticDecompression not supported on Wasi")] public async Task DecompressedResponse_MethodSpecified_DecompressedContentReturned(string compressionName, bool all, bool useCopyTo, int contentLength) { if (IsWinHttpHandler && @@ -140,6 +141,7 @@ public static IEnumerable DecompressedResponse_MethodNotSpecified_Orig [Theory] [MemberData(nameof(DecompressedResponse_MethodNotSpecified_OriginalContentReturned_MemberData))] [SkipOnPlatform(TestPlatforms.Browser, "AutomaticDecompression not supported on Browser")] + [SkipOnPlatform(TestPlatforms.Wasi, "AutomaticDecompression not supported on Wasi")] public async Task DecompressedResponse_MethodNotSpecified_OriginalContentReturned( string encodingName, Func compress, DecompressionMethods methods, bool useCopyTo) { @@ -179,6 +181,7 @@ await server.AcceptConnectionAsync(async connection => [InlineData("br", DecompressionMethods.Brotli)] #endif [SkipOnPlatform(TestPlatforms.Browser, "AutomaticDecompression not supported on Browser")] + [SkipOnPlatform(TestPlatforms.Wasi, "AutomaticDecompression not supported on Wasi")] public async Task DecompressedResponse_EmptyBody_Success(string encodingName, DecompressionMethods methods) { await LoopbackServer.CreateClientAndServerAsync(async uri => @@ -270,6 +273,7 @@ await LoopbackServer.CreateServerAsync(async (server, url) => [InlineData(DecompressionMethods.GZip | DecompressionMethods.Deflate, "gzip; q=1.0, deflate; q=1.0", "")] [InlineData(DecompressionMethods.GZip | DecompressionMethods.Deflate, "gzip; q=1.0", "deflate")] [SkipOnPlatform(TestPlatforms.Browser, "AutomaticDecompression not supported on Browser")] + [SkipOnPlatform(TestPlatforms.Wasi, "AutomaticDecompression not supported on Wasi")] public async Task GetAsync_SetAutomaticDecompression_AcceptEncodingHeaderSentWithQualityWeightingsNoDuplicates( DecompressionMethods methods, string manualAcceptEncodingHeaderValues, diff --git a/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.RemoteServer.cs b/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.RemoteServer.cs index f01e2a59c29c7..c7375e4c86daa 100644 --- a/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.RemoteServer.cs +++ b/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.RemoteServer.cs @@ -63,6 +63,7 @@ public HttpClientHandler_RemoteServerTest(ITestOutputHelper output) : base(outpu [InlineData(false)] [InlineData(true)] [SkipOnPlatform(TestPlatforms.Browser, "UseProxy not supported on Browser")] + [SkipOnPlatform(TestPlatforms.Wasi, "UseProxy not supported on Wasi")] public async Task UseDefaultCredentials_SetToFalseAndServerNeedsAuth_StatusCodeUnauthorized(bool useProxy) { HttpClientHandler handler = CreateHttpClientHandler(); @@ -131,6 +132,7 @@ public async Task GetAsync_ResponseContentAfterClientAndHandlerDispose_Success(C [OuterLoop("Uses external servers")] [Theory, MemberData(nameof(RemoteServersMemberData))] [SkipOnPlatform(TestPlatforms.Browser, "Credentials is not supported on Browser")] + [SkipOnPlatform(TestPlatforms.Wasi, "Credentials is not supported on Wasi")] public async Task GetAsync_ServerNeedsBasicAuthAndSetDefaultCredentials_StatusCodeUnauthorized(Configuration.Http.RemoteServer remoteServer) { HttpClientHandler handler = CreateHttpClientHandler(); @@ -148,6 +150,7 @@ public async Task GetAsync_ServerNeedsBasicAuthAndSetDefaultCredentials_StatusCo [OuterLoop("Uses external servers")] [Theory, MemberData(nameof(RemoteServersMemberData))] [SkipOnPlatform(TestPlatforms.Browser, "Credentials is not supported on Browser")] + [SkipOnPlatform(TestPlatforms.Wasi, "Credentials is not supported on Wasi")] public async Task GetAsync_ServerNeedsAuthAndSetCredential_StatusCodeOK(Configuration.Http.RemoteServer remoteServer) { HttpClientHandler handler = CreateHttpClientHandler(); @@ -611,6 +614,7 @@ public static IEnumerable ExpectContinueVersion() [Theory] [MemberData(nameof(ExpectContinueVersion))] [SkipOnPlatform(TestPlatforms.Browser, "ExpectContinue not supported on Browser")] + [SkipOnPlatform(TestPlatforms.Wasi, "ExpectContinue not supported on Wasi")] public async Task PostAsync_ExpectContinue_Success(bool? expectContinue, Version version) { // Sync API supported only up to HTTP/1.1 @@ -1052,6 +1056,7 @@ public async Task GetAsync_AllowAutoRedirectTrue_RedirectToUriWithParams_Request [InlineData(3, 3)] [InlineData(3, 4)] [SkipOnPlatform(TestPlatforms.Browser, "MaxConnectionsPerServer not supported on Browser")] + [SkipOnPlatform(TestPlatforms.Wasi, "MaxConnectionsPerServer not supported on Wasi")] public async Task GetAsync_MaxAutomaticRedirectionsNServerHops_ThrowsIfTooMany(int maxHops, int hops) { if (IsWinHttpHandler && !PlatformDetection.IsWindows10Version1703OrGreater) @@ -1122,6 +1127,7 @@ public async Task GetAsync_AllowAutoRedirectTrue_RedirectWithRelativeLocation(Co [Theory, MemberData(nameof(RemoteServersMemberData))] [OuterLoop("Uses external servers")] [SkipOnPlatform(TestPlatforms.Browser, "Credentials is not supported on Browser")] + [SkipOnPlatform(TestPlatforms.Wasi, "Credentials is not supported on Wasi")] public async Task GetAsync_CredentialIsNetworkCredentialUriRedirect_StatusCodeUnauthorized(Configuration.Http.RemoteServer remoteServer) { HttpClientHandler handler = CreateHttpClientHandler(); @@ -1142,6 +1148,7 @@ public async Task GetAsync_CredentialIsNetworkCredentialUriRedirect_StatusCodeUn [Theory, MemberData(nameof(RemoteServersMemberData))] [OuterLoop("Uses external servers")] [SkipOnPlatform(TestPlatforms.Browser, "Credentials is not supported on Browser")] + [SkipOnPlatform(TestPlatforms.Wasi, "Credentials is not supported on Wasi")] public async Task HttpClientHandler_CredentialIsNotCredentialCacheAfterRedirect_StatusCodeOK(Configuration.Http.RemoteServer remoteServer) { HttpClientHandler handler = CreateHttpClientHandler(); @@ -1169,6 +1176,7 @@ public async Task HttpClientHandler_CredentialIsNotCredentialCacheAfterRedirect_ [OuterLoop("Uses external servers")] [Theory, MemberData(nameof(RemoteServersAndRedirectStatusCodes))] [SkipOnPlatform(TestPlatforms.Browser, "Credentials is not supported on Browser")] + [SkipOnPlatform(TestPlatforms.Wasi, "Credentials is not supported on Wasi")] public async Task GetAsync_CredentialIsCredentialCacheUriRedirect_StatusCodeOK(Configuration.Http.RemoteServer remoteServer, int statusCode) { if (statusCode == 308 && (IsWinHttpHandler && PlatformDetection.WindowsVersion < 10)) @@ -1242,6 +1250,7 @@ public static IEnumerable RemoteServersAndCompressionUris() [OuterLoop("Uses external servers")] [SkipOnPlatform(TestPlatforms.Browser, "AutomaticDecompression not supported on Browser")] + [SkipOnPlatform(TestPlatforms.Wasi, "AutomaticDecompression not supported on Wasi")] [Theory, MemberData(nameof(RemoteServersAndCompressionUris))] public async Task GetAsync_SetAutomaticDecompression_ContentDecompressed_GZip(Configuration.Http.RemoteServer remoteServer, Uri uri) { @@ -1274,6 +1283,7 @@ public async Task GetAsync_SetAutomaticDecompression_ContentDecompressed_GZip(Co [InlineData("http://httpbin.org/deflate", "\"deflated\": true")] [InlineData("https://httpbin.org/deflate", "\"deflated\": true")] [SkipOnPlatform(TestPlatforms.Browser, "AutomaticDecompression not supported on Browser")] + [SkipOnPlatform(TestPlatforms.Wasi, "AutomaticDecompression not supported on Wasi")] public async Task GetAsync_SetAutomaticDecompression_ContentDecompressed_Deflate(string uri, string expectedContent) { if (IsWinHttpHandler) @@ -1308,6 +1318,7 @@ public async Task GetAsync_SetAutomaticDecompression_ContentDecompressed_Deflate [OuterLoop("Uses external servers")] [Theory, MemberData(nameof(RemoteServersAndCompressionUris))] [SkipOnPlatform(TestPlatforms.Browser, "AutomaticDecompression not supported on Browser")] + [SkipOnPlatform(TestPlatforms.Wasi, "AutomaticDecompression not supported on Wasi")] public async Task GetAsync_SetAutomaticDecompression_HeadersRemoved(Configuration.Http.RemoteServer remoteServer, Uri uri) { // Sync API supported only up to HTTP/1.1 diff --git a/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.cs b/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.cs index b45f2a5b232b7..2354a1b9707de 100644 --- a/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.cs +++ b/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.cs @@ -45,6 +45,7 @@ public void CookieContainer_SetNull_ThrowsArgumentNullException() } [SkipOnPlatform(TestPlatforms.Browser, "Credentials is not supported on Browser")] + [SkipOnPlatform(TestPlatforms.Wasi, "Credentials not supported on Wasi")] public void Ctor_ExpectedDefaultPropertyValues_CommonPlatform() { using (HttpClientHandler handler = CreateHttpClientHandler()) @@ -68,6 +69,7 @@ public void Ctor_ExpectedDefaultPropertyValues_CommonPlatform() [Fact] [SkipOnPlatform(TestPlatforms.Browser, "MaxResponseHeadersLength is not supported on Browser")] + [SkipOnPlatform(TestPlatforms.Wasi, "MaxResponseHeadersLength not supported on Wasi")] public void Ctor_ExpectedDefaultPropertyValues() { using (HttpClientHandler handler = CreateHttpClientHandler()) @@ -86,6 +88,7 @@ public void Ctor_ExpectedDefaultPropertyValues() [Fact] [SkipOnPlatform(TestPlatforms.Browser, "Credentials is not supported on Browser")] + [SkipOnPlatform(TestPlatforms.Wasi, "Credentials not supported on Wasi")] public void Credentials_SetGet_Roundtrips() { using (HttpClientHandler handler = CreateHttpClientHandler()) @@ -107,6 +110,7 @@ public void Credentials_SetGet_Roundtrips() [InlineData(-1)] [InlineData(0)] [SkipOnPlatform(TestPlatforms.Browser, "MaxAutomaticRedirections not supported on Browser")] + [SkipOnPlatform(TestPlatforms.Wasi, "MaxAutomaticRedirections not supported on Wasi")] public void MaxAutomaticRedirections_InvalidValue_Throws(int redirects) { using (HttpClientHandler handler = CreateHttpClientHandler()) @@ -157,6 +161,7 @@ public void Properties_AddItemToDictionary_ItemPresent() [ConditionalFact] [SkipOnPlatform(TestPlatforms.Browser, "ServerCertificateCustomValidationCallback not supported on Browser")] + [SkipOnPlatform(TestPlatforms.Wasi, "ServerCertificateCustomValidationCallback not supported on Wasi")] public async Task GetAsync_IPv6LinkLocalAddressUri_Success() { if (IsWinHttpHandler && UseVersion >= HttpVersion20.Value) @@ -231,6 +236,7 @@ public static IEnumerable GetAsync_IPBasedUri_Success_MemberData() [InlineData("[::1234]:8080", "[::1234]:8080")] [InlineData("[fe80::9c3a:b64d:6249:1de8%2]", "[fe80::9c3a:b64d:6249:1de8]")] [SkipOnPlatform(TestPlatforms.Browser, "Proxy not supported on Browser")] + [SkipOnPlatform(TestPlatforms.Wasi, "Proxy not supported on Wasi")] public async Task GetAsync_IPv6AddressInHostHeader_CorrectlyFormatted(string host, string hostHeader) { string ipv6Address = "http://" + host; @@ -263,7 +269,7 @@ public static IEnumerable SecureAndNonSecure_IPBasedUri_MemberData() = from address in new[] { IPAddress.Loopback, IPAddress.IPv6Loopback } from useSsl in BoolValues // we could not create SslStream in browser, [ActiveIssue("https://github.com/dotnet/runtime/issues/37669", TestPlatforms.Browser)] - where PlatformDetection.IsNotBrowser || !useSsl + where PlatformDetection.IsNotWasm || !useSsl select new object[] { address, useSsl }; [ConditionalTheory] @@ -287,7 +293,7 @@ await LoopbackServer.CreateClientAndServerAsync(async url => using (HttpClientHandler handler = CreateHttpClientHandler()) using (HttpClient client = CreateHttpClient(handler)) { - if (useSsl && PlatformDetection.IsNotBrowser) + if (useSsl && PlatformDetection.IsNotWasm) { // we could not create SslStream in browser, [ActiveIssue("https://github.com/dotnet/runtime/issues/37669", TestPlatforms.Browser)] handler.ServerCertificateCustomValidationCallback = TestHelper.AllowAllCertificates; @@ -309,6 +315,7 @@ await LoopbackServer.CreateClientAndServerAsync(async url => [InlineData("WWW-Authenticate", "CustomAuth")] [InlineData("", "")] // RFC7235 requires servers to send this header with 401 but some servers don't. [SkipOnPlatform(TestPlatforms.Browser, "Credentials is not supported on Browser")] + [SkipOnPlatform(TestPlatforms.Wasi, "Credentials is not supported on Wasi")] public async Task GetAsync_ServerNeedsNonStandardAuthAndSetCredential_StatusCodeUnauthorized(string authHeadrName, string authHeaderValue) { if (IsWinHttpHandler && UseVersion >= HttpVersion20.Value) @@ -1590,6 +1597,7 @@ public static IEnumerable Interim1xxStatusCode() [Theory] [MemberData(nameof(Interim1xxStatusCode))] [SkipOnPlatform(TestPlatforms.Browser, "CookieContainer is not supported on Browser")] + [SkipOnPlatform(TestPlatforms.Wasi, "CookieContainer is not supported on Wasi")] public async Task SendAsync_1xxResponsesWithHeaders_InterimResponsesHeadersIgnored(HttpStatusCode responseStatusCode) { if (IsWinHttpHandler && UseVersion >= HttpVersion20.Value) @@ -1859,6 +1867,7 @@ await server.AcceptConnectionAsync(async connection => [Fact] [SkipOnPlatform(TestPlatforms.Browser, "Switching protocol is not supported on Browser")] + [SkipOnPlatform(TestPlatforms.Wasi, "Switching protocol is not supported on Wasi")] public async Task SendAsync_101SwitchingProtocolsResponse_Success() { // WinHttpHandler and CurlHandler will hang, waiting for additional response. @@ -1986,6 +1995,7 @@ await LoopbackServer.CreateClientAndServerAsync(async uri => #region Version tests [SkipOnPlatform(TestPlatforms.Browser, "Version is not supported on Browser")] + [SkipOnPlatform(TestPlatforms.Wasi, "Version is not supported on Wasi")] [Fact] public async Task SendAsync_RequestVersion10_ServerReceivesVersion10Request() { @@ -1999,7 +2009,7 @@ public async Task SendAsync_RequestVersion10_ServerReceivesVersion10Request() Assert.Equal(new Version(1, 0), receivedRequestVersion); } - [SkipOnPlatform(TestPlatforms.Browser, "Version is not supported on Browser")] + [SkipOnPlatform(TestPlatforms.Wasi, "Version is not supported on Wasi")] [Fact] public async Task SendAsync_RequestVersion11_ServerReceivesVersion11Request() { diff --git a/src/libraries/Common/tests/System/Net/Http/PostScenarioTest.cs b/src/libraries/Common/tests/System/Net/Http/PostScenarioTest.cs index 6f465ff0e998c..b56ddf5e7fec2 100644 --- a/src/libraries/Common/tests/System/Net/Http/PostScenarioTest.cs +++ b/src/libraries/Common/tests/System/Net/Http/PostScenarioTest.cs @@ -162,6 +162,7 @@ public async Task PostLargeContentUsingContentLengthSemantics_Success(Configurat [OuterLoop("Uses external servers")] [SkipOnPlatform(TestPlatforms.Browser, "PreAuthenticate not supported on Browser")] + [SkipOnPlatform(TestPlatforms.Wasi, "PreAuthenticate not supported on Wasi")] [Theory, MemberData(nameof(RemoteServersMemberData))] public async Task PostRewindableContentUsingAuth_NoPreAuthenticate_Success(Configuration.Http.RemoteServer remoteServer) { @@ -179,6 +180,7 @@ public async Task PostRewindableContentUsingAuth_NoPreAuthenticate_Success(Confi [OuterLoop("Uses external servers")] [Theory, MemberData(nameof(RemoteServersMemberData))] [SkipOnPlatform(TestPlatforms.Browser, "PreAuthenticate not supported on Browser")] + [SkipOnPlatform(TestPlatforms.Wasi, "PreAuthenticate not supported on Wasi")] public async Task PostNonRewindableContentUsingAuth_NoPreAuthenticate_ThrowsHttpRequestException(Configuration.Http.RemoteServer remoteServer) { // Sync API supported only up to HTTP/1.1 @@ -196,6 +198,7 @@ await Assert.ThrowsAsync(() => [OuterLoop("Uses external servers")] [Theory, MemberData(nameof(RemoteServersMemberData))] [SkipOnPlatform(TestPlatforms.Browser, "PreAuthenticate not supported on Browser")] + [SkipOnPlatform(TestPlatforms.Wasi, "PreAuthenticate not supported on Wasi")] public async Task PostNonRewindableContentUsingAuth_PreAuthenticate_Success(Configuration.Http.RemoteServer remoteServer) { // Sync API supported only up to HTTP/1.1 diff --git a/src/libraries/Common/tests/System/Net/Http/TestHelper.cs b/src/libraries/Common/tests/System/Net/Http/TestHelper.cs index 8ff0e437526ba..40f4a8a18d743 100644 --- a/src/libraries/Common/tests/System/Net/Http/TestHelper.cs +++ b/src/libraries/Common/tests/System/Net/Http/TestHelper.cs @@ -155,7 +155,7 @@ public static SocketsHttpHandler CreateSocketsHttpHandler(bool allowAllCertifica var handler = new SocketsHttpHandler(); // Browser doesn't support ServerCertificateCustomValidationCallback - if (allowAllCertificates && PlatformDetection.IsNotBrowser) + if (allowAllCertificates && PlatformDetection.IsNotWasm) { handler.SslOptions.RemoteCertificateValidationCallback = delegate { return true; }; } diff --git a/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs b/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs index d35885ae25508..b08a8a87e509f 100644 --- a/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs +++ b/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs @@ -50,6 +50,7 @@ public static partial class PlatformDetection public static bool IsBrowser => RuntimeInformation.IsOSPlatform(OSPlatform.Create("BROWSER")); public static bool IsWasi => RuntimeInformation.IsOSPlatform(OSPlatform.Create("WASI")); public static bool IsNotBrowser => !IsBrowser; + public static bool IsNotWasm => !IsBrowser && !IsWasi; public static bool IsNotWasi => !IsWasi; public static bool IsMobile => IsBrowser || IsWasi || IsAppleMobile || IsAndroid; public static bool IsNotMobile => !IsMobile; diff --git a/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.General.cs b/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.General.cs index b356aa3a4030b..5e973be83b82a 100644 --- a/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.General.cs +++ b/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.General.cs @@ -17,7 +17,7 @@ public HttpClientHandlerTest_General(ITestOutputHelper output) : base(output) public Task SendAsync_Null_ThrowsArgumentNullException() => Assert.ThrowsAsync(() => new TestHttpClientHandler().SendNullAsync()); - public static bool SupportsSyncSend => PlatformDetection.IsNotMobile && PlatformDetection.IsNotBrowser; + public static bool SupportsSyncSend => PlatformDetection.IsNotMobile && PlatformDetection.IsNotWasm; [ConditionalFact(nameof(SupportsSyncSend))] public void Send_Null_ThrowsArgumentNullException() => Assert.Throws(() => new TestHttpClientHandler().SendNull()); diff --git a/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.Headers.cs b/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.Headers.cs index 48d72d4888013..258d1646a63a3 100644 --- a/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.Headers.cs +++ b/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.Headers.cs @@ -49,6 +49,7 @@ await LoopbackServerFactory.CreateClientAndServerAsync(async uri => [Fact] [SkipOnPlatform(TestPlatforms.Browser, "User-Agent is not supported on Browser")] + [SkipOnPlatform(TestPlatforms.Wasi, "TODO WASI")] public async Task SendAsync_UserAgent_CorrectlyWritten() { string userAgent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.18 Safari/537.36"; @@ -139,6 +140,7 @@ await LoopbackServerFactory.CreateClientAndServerAsync(async uri => [InlineData("\u05D1\u05F1")] [InlineData("jp\u30A5")] [SkipOnPlatform(TestPlatforms.Browser, "Browser is relaxed about validating HTTP headers")] + [SkipOnPlatform(TestPlatforms.Wasi, "TODO WASI")] public async Task SendAsync_InvalidCharactersInHeader_Throw(string value) { await LoopbackServerFactory.CreateClientAndServerAsync(async uri => @@ -388,6 +390,7 @@ public async Task SendAsync_GetWithValidHostHeader_Success(bool withPort) [OuterLoop("Uses external servers", typeof(PlatformDetection), nameof(PlatformDetection.LocalEchoServerIsNotAvailable))] [Fact] [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")] + [SkipOnPlatform(TestPlatforms.Wasi, "TODO WASI")] public async Task SendAsync_GetWithInvalidHostHeader_ThrowsException() { if (LoopbackServerFactory.Version >= HttpVersion.Version20) @@ -408,6 +411,7 @@ public async Task SendAsync_GetWithInvalidHostHeader_ThrowsException() [Fact] [SkipOnPlatform(TestPlatforms.Browser, "Browser is relaxed about validating HTTP headers")] + [SkipOnPlatform(TestPlatforms.Wasi, "TODO WASI")] public async Task SendAsync_WithZeroLengthHeaderName_Throws() { await LoopbackServerFactory.CreateClientAndServerAsync( @@ -452,6 +456,7 @@ private static readonly (string Name, Encoding ValueEncoding, string Separator, [Fact] [SkipOnPlatform(TestPlatforms.Browser, "Socket is not supported on Browser")] + [SkipOnPlatform(TestPlatforms.Wasi, "TODO WASI")] public async Task SendAsync_CustomRequestEncodingSelector_CanSendNonAsciiHeaderValues() { await LoopbackServerFactory.CreateClientAndServerAsync( @@ -507,6 +512,7 @@ await LoopbackServerFactory.CreateClientAndServerAsync( [Fact] [SkipOnPlatform(TestPlatforms.Browser, "Socket is not supported on Browser")] + [SkipOnPlatform(TestPlatforms.Wasi, "TODO WASI")] public async Task SendAsync_CustomResponseEncodingSelector_CanReceiveNonAsciiHeaderValues() { await LoopbackServerFactory.CreateClientAndServerAsync( diff --git a/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTestBase.SocketsHttpHandler.cs b/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTestBase.SocketsHttpHandler.cs index 088e57294d54b..4312a00ba36c1 100644 --- a/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTestBase.SocketsHttpHandler.cs +++ b/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTestBase.SocketsHttpHandler.cs @@ -52,7 +52,7 @@ protected static HttpClientHandler CreateHttpClientHandler(Version useVersion = HttpClientHandler handler = (PlatformDetection.SupportsAlpn && useVersion != HttpVersion.Version30) ? new HttpClientHandler() : new VersionHttpClientHandler(useVersion); // Browser doesn't support ServerCertificateCustomValidationCallback - if (allowAllCertificates && PlatformDetection.IsNotBrowser) + if (allowAllCertificates && PlatformDetection.IsNotWasm) { handler.ServerCertificateCustomValidationCallback = TestHelper.AllowAllCertificates; } diff --git a/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientMiniStressTest.cs b/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientMiniStressTest.cs index a0844444705d7..c2a61c07a03c3 100644 --- a/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientMiniStressTest.cs +++ b/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientMiniStressTest.cs @@ -89,6 +89,7 @@ await server.AcceptConnectionAsync(async connection => [Collection(nameof(HttpClientMiniStress))] [SkipOnPlatform(TestPlatforms.Browser, "System.Net.Security is not supported on Browser")] + [SkipOnPlatform(TestPlatforms.Wasi, "TODO WASI")] public abstract class HttpClientMiniStress : HttpClientHandlerTestBase { public HttpClientMiniStress(ITestOutputHelper output) : base(output) { } diff --git a/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientTest.cs b/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientTest.cs index 47fb4f3de6c78..dfe7ea62d1aca 100644 --- a/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientTest.cs +++ b/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientTest.cs @@ -222,6 +222,7 @@ public async Task GetContentAsync_ErrorStatusCode_ExpectedExceptionThrown(bool w [Fact] [SkipOnPlatform(TestPlatforms.Browser, "Socket is not supported on Browser")] + [SkipOnPlatform(TestPlatforms.Wasi, "TODO WASI")] public async Task GetContentAsync_WhenCannotConnect_ExceptionContainsHostInfo() { const string Host = "localhost:1234"; @@ -692,6 +693,7 @@ public void Dispose_UseAfterDispose_Throws() [InlineData(false)] [InlineData(true)] [SkipOnPlatform(TestPlatforms.Browser, "System.Net.Sockets is not supported on this platform")] + [SkipOnPlatform(TestPlatforms.Wasi, "TODO WASI")] public void CancelAllPending_AllPendingOperationsCanceled(bool withInfiniteTimeout) { using (var client = new HttpClient(new CustomResponseHandler((r, c) => WhenCanceled(c)))) @@ -710,6 +712,7 @@ public void CancelAllPending_AllPendingOperationsCanceled(bool withInfiniteTimeo [InlineData(HttpCompletionOption.ResponseContentRead)] [InlineData(HttpCompletionOption.ResponseHeadersRead)] [SkipOnPlatform(TestPlatforms.Browser, "System.Net.Sockets is not supported on this platform")] + [SkipOnPlatform(TestPlatforms.Wasi, "TODO WASI")] public void Timeout_TooShort_AllPendingOperationsCanceled(HttpCompletionOption completionOption) { using (var client = new HttpClient(new CustomResponseHandler((r, c) => WhenCanceled(c)))) @@ -747,6 +750,7 @@ public async Task Timeout_CallerCanceledTokenAfterTimeout_TimeoutIsNotDetected(H [InlineData(HttpCompletionOption.ResponseContentRead)] [InlineData(HttpCompletionOption.ResponseHeadersRead)] [SkipOnPlatform(TestPlatforms.Browser, "System.Net.Sockets is not supported on this platform")] + [SkipOnPlatform(TestPlatforms.Wasi, "TODO WASI")] public void Timeout_CallerCanceledTokenBeforeTimeout_TimeoutIsNotDetected(HttpCompletionOption completionOption) { using (var client = new HttpClient(new CustomResponseHandler((r, c) => WhenCanceled(c)))) @@ -943,6 +947,7 @@ public void Send_SingleThread_Succeeds(HttpCompletionOption completionOption) [InlineData(HttpCompletionOption.ResponseHeadersRead)] [SkipOnPlatform(TestPlatforms.Browser, "Synchronous Send is not supported on Browser")] [SkipOnPlatform(TestPlatforms.Android, "Synchronous Send is not supported on Android")] + [SkipOnPlatform(TestPlatforms.Wasi, "TODO WASI")] public async Task Send_SingleThread_Loopback_Succeeds(HttpCompletionOption completionOption) { string content = "Test content"; @@ -998,6 +1003,7 @@ await server.AcceptConnectionAsync(async connection => [OuterLoop] [SkipOnPlatform(TestPlatforms.Browser, "Synchronous Send is not supported on Browser")] [SkipOnPlatform(TestPlatforms.Android, "Synchronous Send is not supported on Android")] + [SkipOnPlatform(TestPlatforms.Wasi, "TODO WASI")] public async Task Send_CancelledRequestContent_Throws() { CancellationTokenSource cts = new CancellationTokenSource(); @@ -1087,6 +1093,7 @@ await server.AcceptConnectionAsync(async connection => [OuterLoop] [SkipOnPlatform(TestPlatforms.Browser, "Synchronous Send is not supported on Browser")] [SkipOnPlatform(TestPlatforms.Android, "Synchronous Send is not supported on Android")] + [SkipOnPlatform(TestPlatforms.Wasi, "TODO WASI")] public async Task Send_CancelledResponseContent_Throws() { string content = "Test content"; @@ -1139,6 +1146,7 @@ await IgnoreExceptions(async () => [OuterLoop] [SkipOnPlatform(TestPlatforms.Browser, "Synchronous Send is not supported on Browser")] [SkipOnPlatform(TestPlatforms.Android, "Synchronous Send is not supported on Android")] + [SkipOnPlatform(TestPlatforms.Wasi, "TODO WASI")] public async Task Send_TimeoutResponseContent_Throws() { const string Content = "Test content"; @@ -1197,6 +1205,7 @@ public static IEnumerable VersionSelectionMemberData() [Theory] [MemberData(nameof(VersionSelectionMemberData))] [SkipOnPlatform(TestPlatforms.Browser, "Version is ignored on Browser")] + [SkipOnPlatform(TestPlatforms.Wasi, "TODO WASI")] public async Task SendAsync_CorrectVersionSelected_LoopbackServer(Version requestVersion, HttpVersionPolicy versionPolicy, Version serverVersion, bool useSsl, object expectedResult) { await HttpAgnosticLoopbackServer.CreateClientAndServerAsync( @@ -1247,6 +1256,7 @@ await HttpAgnosticLoopbackServer.CreateClientAndServerAsync( [OuterLoop("Uses external servers")] [MemberData(nameof(VersionSelectionMemberData))] [SkipOnPlatform(TestPlatforms.Browser, "Version is ignored on Browser")] + [SkipOnPlatform(TestPlatforms.Wasi, "TODO WASI")] public async Task SendAsync_CorrectVersionSelected_ExternalServer(Version requestVersion, HttpVersionPolicy versionPolicy, Version serverVersion, bool useSsl, object expectedResult) { RemoteServer remoteServer = null; diff --git a/src/libraries/System.Net.Http/tests/FunctionalTests/HttpContentTest.cs b/src/libraries/System.Net.Http/tests/FunctionalTests/HttpContentTest.cs index 01c364f87175a..8ec537fc446b8 100644 --- a/src/libraries/System.Net.Http/tests/FunctionalTests/HttpContentTest.cs +++ b/src/libraries/System.Net.Http/tests/FunctionalTests/HttpContentTest.cs @@ -299,6 +299,7 @@ public async Task ReadAsStreamAsync_FirstGetFromUnbufferedContentThenGetFromBuff } [SkipOnPlatform(TestPlatforms.Browser, "Browser doesn't support Synchronous reads")] + [SkipOnPlatform(TestPlatforms.Wasi, "TODO WASI")] [Theory] [InlineData(true)] [InlineData(false)] diff --git a/src/libraries/System.Net.Http/tests/FunctionalTests/MetricsTest.cs b/src/libraries/System.Net.Http/tests/FunctionalTests/MetricsTest.cs index 6a8d156cdfc41..d44c0a6624b77 100644 --- a/src/libraries/System.Net.Http/tests/FunctionalTests/MetricsTest.cs +++ b/src/libraries/System.Net.Http/tests/FunctionalTests/MetricsTest.cs @@ -948,6 +948,7 @@ public Task RequestDuration_ErrorStatus_ErrorTypeRecorded(int statusCode) [Fact] [SkipOnPlatform(TestPlatforms.Browser, "Browser is relaxed about validating HTTP headers")] + [SkipOnPlatform(TestPlatforms.Wasi, "TODO WASI")] public async Task RequestDuration_ConnectionClosedWhileReceivingHeaders_Recorded() { using CancellationTokenSource cancelServerCts = new CancellationTokenSource(); diff --git a/src/libraries/System.Net.Http/tests/FunctionalTests/NtAuthTests.FakeServer.cs b/src/libraries/System.Net.Http/tests/FunctionalTests/NtAuthTests.FakeServer.cs index e0e08021cd866..7b5f0986f1bde 100644 --- a/src/libraries/System.Net.Http/tests/FunctionalTests/NtAuthTests.FakeServer.cs +++ b/src/libraries/System.Net.Http/tests/FunctionalTests/NtAuthTests.FakeServer.cs @@ -116,6 +116,7 @@ internal static async Task HandleAuthenticationRequestWithFakeServer(LoopbackSer [InlineData(true)] [InlineData(false)] [SkipOnPlatform(TestPlatforms.Browser, "Credentials and HttpListener is not supported on Browser")] + [SkipOnPlatform(TestPlatforms.Wasi, "TODO WASI")] public async Task DefaultHandler_FakeServer_Success(bool useNtlm) { await LoopbackServer.CreateClientAndServerAsync( @@ -142,6 +143,7 @@ await server.AcceptConnectionAsync(async connection => [Fact] [SkipOnPlatform(TestPlatforms.Browser | TestPlatforms.Windows, "DefaultCredentials are unsupported for NTLM on Unix / Managed implementation")] + [SkipOnPlatform(TestPlatforms.Wasi, "TODO WASI")] public async Task DefaultHandler_FakeServer_DefaultCredentials() { await LoopbackServer.CreateClientAndServerAsync( diff --git a/src/libraries/System.Net.Http/tests/FunctionalTests/ResponseStreamZeroByteReadTests.cs b/src/libraries/System.Net.Http/tests/FunctionalTests/ResponseStreamZeroByteReadTests.cs index 8fe520464e578..38990d38b7fb3 100644 --- a/src/libraries/System.Net.Http/tests/FunctionalTests/ResponseStreamZeroByteReadTests.cs +++ b/src/libraries/System.Net.Http/tests/FunctionalTests/ResponseStreamZeroByteReadTests.cs @@ -81,6 +81,7 @@ public static IEnumerable ZeroByteRead_IssuesZeroByteReadOnUnderlyingS [Theory] [MemberData(nameof(ZeroByteRead_IssuesZeroByteReadOnUnderlyingStream_MemberData))] [SkipOnPlatform(TestPlatforms.Browser, "ConnectCallback is not supported on Browser")] + [SkipOnPlatform(TestPlatforms.Wasi, "TODO WASI")] public async Task ZeroByteRead_IssuesZeroByteReadOnUnderlyingStream(StreamConformanceTests.ReadWriteMode readMode, bool useSsl) { (Stream httpConnection, Stream server) = ConnectedStreams.CreateBidirectional(4096, int.MaxValue); diff --git a/src/libraries/System.Net.Http/tests/FunctionalTests/SocketsHttpHandlerTest.cs b/src/libraries/System.Net.Http/tests/FunctionalTests/SocketsHttpHandlerTest.cs index 7a82f848e78a9..7d438239e2864 100644 --- a/src/libraries/System.Net.Http/tests/FunctionalTests/SocketsHttpHandlerTest.cs +++ b/src/libraries/System.Net.Http/tests/FunctionalTests/SocketsHttpHandlerTest.cs @@ -312,24 +312,28 @@ public SocketsHttpHandler_HttpClientEKUTest(ITestOutputHelper output) : base(out #endif [SkipOnPlatform(TestPlatforms.Browser, "AutomaticDecompression not supported on Browser")] + [SkipOnPlatform(TestPlatforms.Wasi, "TODO WASI")] public sealed class SocketsHttpHandler_HttpClientHandler_Decompression_Tests : HttpClientHandler_Decompression_Test { public SocketsHttpHandler_HttpClientHandler_Decompression_Tests(ITestOutputHelper output) : base(output) { } } [SkipOnPlatform(TestPlatforms.Browser, "Certificates are not supported on Browser")] + [SkipOnPlatform(TestPlatforms.Wasi, "TODO WASI")] public sealed class SocketsHttpHandler_HttpClientHandler_DangerousAcceptAllCertificatesValidator_Test : HttpClientHandler_DangerousAcceptAllCertificatesValidator_Test { public SocketsHttpHandler_HttpClientHandler_DangerousAcceptAllCertificatesValidator_Test(ITestOutputHelper output) : base(output) { } } [SkipOnPlatform(TestPlatforms.Browser, "Certificates are not supported on Browser")] + [SkipOnPlatform(TestPlatforms.Wasi, "TODO WASI")] public sealed class SocketsHttpHandler_HttpClientHandler_ClientCertificates_Test : HttpClientHandler_ClientCertificates_Test { public SocketsHttpHandler_HttpClientHandler_ClientCertificates_Test(ITestOutputHelper output) : base(output) { } } [SkipOnPlatform(TestPlatforms.Browser, "Proxy is not supported on Browser")] + [SkipOnPlatform(TestPlatforms.Wasi, "TODO WASI")] public sealed class SocketsHttpHandler_HttpClientHandler_DefaultProxyCredentials_Test : HttpClientHandler_DefaultProxyCredentials_Test { public SocketsHttpHandler_HttpClientHandler_DefaultProxyCredentials_Test(ITestOutputHelper output) : base(output) { } @@ -347,6 +351,7 @@ public SocketsHttpHandler_HttpClientHandler_Finalization_Http2_Test(ITestOutputH } [SkipOnPlatform(TestPlatforms.Browser, "MaxConnectionsPerServer not supported on Browser")] + [SkipOnPlatform(TestPlatforms.Wasi, "TODO WASI")] public sealed class SocketsHttpHandler_HttpClientHandler_MaxConnectionsPerServer_Test : HttpClientHandler_MaxConnectionsPerServer_Test { public SocketsHttpHandler_HttpClientHandler_MaxConnectionsPerServer_Test(ITestOutputHelper output) : base(output) { } @@ -411,12 +416,14 @@ await server.AcceptConnectionAsync(async connection => } [SkipOnPlatform(TestPlatforms.Browser, "Certificates are not supported on Browser")] + [SkipOnPlatform(TestPlatforms.Wasi, "TODO WASI")] public sealed class SocketsHttpHandler_HttpClientHandler_ServerCertificates_Test : HttpClientHandler_ServerCertificates_Test { public SocketsHttpHandler_HttpClientHandler_ServerCertificates_Test(ITestOutputHelper output) : base(output) { } } [SkipOnPlatform(TestPlatforms.Browser, "ResponseDrainTimeout is not supported on Browser")] + [SkipOnPlatform(TestPlatforms.Wasi, "TODO WASI")] public sealed class SocketsHttpHandler_HttpClientHandler_ResponseDrain_Test : HttpClientHandler_ResponseDrain_Test { protected override void SetResponseDrainTimeout(HttpClientHandler handler, TimeSpan time) @@ -729,6 +736,7 @@ public SocketsHttpHandler_HttpClientHandler_SslProtocols_Test(ITestOutputHelper } [SkipOnPlatform(TestPlatforms.Browser, "UseProxy not supported on Browser")] + [SkipOnPlatform(TestPlatforms.Wasi, "TODO WASI")] public sealed class SocketsHttpHandler_HttpClientHandler_Proxy_Test : HttpClientHandler_Proxy_Test { public SocketsHttpHandler_HttpClientHandler_Proxy_Test(ITestOutputHelper output) : base(output) { } @@ -1298,12 +1306,14 @@ public SocketsHttpHandlerTest_RequestRetry(ITestOutputHelper output) : base(outp } [SkipOnPlatform(TestPlatforms.Browser, "UseCookies is not supported on Browser")] + [SkipOnPlatform(TestPlatforms.Wasi, "TODO WASI")] public sealed class SocketsHttpHandlerTest_Cookies : HttpClientHandlerTest_Cookies { public SocketsHttpHandlerTest_Cookies(ITestOutputHelper output) : base(output) { } } [SkipOnPlatform(TestPlatforms.Browser, "UseCookies is not supported on Browser")] + [SkipOnPlatform(TestPlatforms.Wasi, "TODO WASI")] public sealed class SocketsHttpHandlerTest_Cookies_Http11 : HttpClientHandlerTest_Cookies_Http11 { public SocketsHttpHandlerTest_Cookies_Http11(ITestOutputHelper output) : base(output) { } @@ -1717,6 +1727,7 @@ public SocketsHttpHandler_HttpClientHandler_MaxResponseHeadersLength_Http3(ITest } [SkipOnPlatform(TestPlatforms.Browser, "Socket is not supported on Browser")] + [SkipOnPlatform(TestPlatforms.Wasi, "TODO WASI")] public sealed class SocketsHttpHandler_HttpClientHandler_Authentication_Test : HttpClientHandler_Authentication_Test { public SocketsHttpHandler_HttpClientHandler_Authentication_Test(ITestOutputHelper output) : base(output) { } @@ -1849,6 +1860,7 @@ public SocketsHttpHandler_Connect_Test(ITestOutputHelper output) : base(output) } [SkipOnPlatform(TestPlatforms.Browser, "Socket is not supported on Browser")] + [SkipOnPlatform(TestPlatforms.Wasi, "TODO WASI")] public sealed class SocketsHttpHandler_HttpClientHandler_ConnectionPooling_Test : HttpClientHandlerTestBase { public SocketsHttpHandler_HttpClientHandler_ConnectionPooling_Test(ITestOutputHelper output) : base(output) { } @@ -2600,6 +2612,7 @@ await Assert.ThrowsAnyAsync(() => } [SkipOnPlatform(TestPlatforms.Browser, "Headers.Location are not supported on Browser")] + [SkipOnPlatform(TestPlatforms.Wasi, "TODO WASI")] public sealed class SocketsHttpHandlerTest_LocationHeader { private static readonly byte[] s_redirectResponseBefore = Encoding.ASCII.GetBytes( @@ -3597,6 +3610,7 @@ public override int ReadByte() => } [SkipOnPlatform(TestPlatforms.Browser, "Socket is not supported on Browser")] + [SkipOnPlatform(TestPlatforms.Wasi, "TODO WASI")] public sealed class SocketsHttpHandlerTest_ConnectCallback_Http11 : SocketsHttpHandlerTest_ConnectCallback { public SocketsHttpHandlerTest_ConnectCallback_Http11(ITestOutputHelper output) : base(output) { } diff --git a/src/libraries/System.Net.Http/tests/FunctionalTests/SocksProxyTest.cs b/src/libraries/System.Net.Http/tests/FunctionalTests/SocksProxyTest.cs index 300ed02aff41c..479de5a87c3ba 100644 --- a/src/libraries/System.Net.Http/tests/FunctionalTests/SocksProxyTest.cs +++ b/src/libraries/System.Net.Http/tests/FunctionalTests/SocksProxyTest.cs @@ -115,6 +115,7 @@ public async Task TestExceptionalAsync(string scheme, string host, bool useAuth, [SkipOnPlatform(TestPlatforms.Browser, "UseProxy not supported on Browser")] + [SkipOnPlatform(TestPlatforms.Wasi, "TODO WASI")] public sealed class SocksProxyTest_Http1_Async : SocksProxyTest { public SocksProxyTest_Http1_Async(ITestOutputHelper helper) : base(helper) { } @@ -123,6 +124,7 @@ public SocksProxyTest_Http1_Async(ITestOutputHelper helper) : base(helper) { } [SkipOnPlatform(TestPlatforms.Browser, "UseProxy not supported on Browser")] [SkipOnPlatform(TestPlatforms.Android, "The sync Send method is not supported on mobile platforms")] + [SkipOnPlatform(TestPlatforms.Wasi, "TODO WASI")] public sealed class SocksProxyTest_Http1_Sync : SocksProxyTest { public SocksProxyTest_Http1_Sync(ITestOutputHelper helper) : base(helper) { } @@ -131,6 +133,7 @@ public SocksProxyTest_Http1_Sync(ITestOutputHelper helper) : base(helper) { } } [SkipOnPlatform(TestPlatforms.Browser, "UseProxy not supported on Browser")] + [SkipOnPlatform(TestPlatforms.Wasi, "TODO WASI")] public sealed class SocksProxyTest_Http2 : SocksProxyTest { public SocksProxyTest_Http2(ITestOutputHelper helper) : base(helper) { } diff --git a/src/libraries/System.Net.Http/tests/FunctionalTests/SyncHttpHandlerTest.cs b/src/libraries/System.Net.Http/tests/FunctionalTests/SyncHttpHandlerTest.cs index 87c44e4ba6b3d..a2f2b15120378 100644 --- a/src/libraries/System.Net.Http/tests/FunctionalTests/SyncHttpHandlerTest.cs +++ b/src/libraries/System.Net.Http/tests/FunctionalTests/SyncHttpHandlerTest.cs @@ -6,7 +6,7 @@ namespace System.Net.Http.Functional.Tests { - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWasm))] [SkipOnPlatform(TestPlatforms.Android, "Synchronous Send method is not supported on Android.")] public sealed class SyncHttpHandler_HttpProtocolTests : HttpProtocolTests { @@ -14,7 +14,7 @@ public SyncHttpHandler_HttpProtocolTests(ITestOutputHelper output) : base(output protected override bool TestAsync => false; } - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWasm))] [SkipOnPlatform(TestPlatforms.Android, "Synchronous Send method is not supported on Android.")] public sealed class SyncHttpHandler_HttpProtocolTests_Dribble : HttpProtocolTests_Dribble { @@ -37,7 +37,7 @@ public SyncHttpHandler_PostScenarioTest(ITestOutputHelper output) : base(output) protected override bool TestAsync => false; } - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWasm))] [SkipOnPlatform(TestPlatforms.Android, "Synchronous Send method is not supported on Android.")] public sealed class SyncHttpHandler_HttpClientHandlerTest : HttpClientHandlerTest { @@ -45,7 +45,7 @@ public SyncHttpHandler_HttpClientHandlerTest(ITestOutputHelper output) : base(ou protected override bool TestAsync => false; } - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWasm))] [SkipOnPlatform(TestPlatforms.Android, "Synchronous Send method is not supported on Android.")] public sealed class SyncHttpHandlerTest_AutoRedirect : HttpClientHandlerTest_AutoRedirect { @@ -60,7 +60,7 @@ public SyncHttpHandler_HttpClientHandler_Decompression_Tests(ITestOutputHelper o protected override bool TestAsync => false; } - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWasm))] [SkipOnPlatform(TestPlatforms.Android, "Synchronous Send method is not supported on Android.")] public sealed class SyncHttpHandler_IdnaProtocolTests : IdnaProtocolTests { @@ -69,7 +69,7 @@ public SyncHttpHandler_IdnaProtocolTests(ITestOutputHelper output) : base(output protected override bool SupportsIdna => true; } - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWasm))] [SkipOnPlatform(TestPlatforms.Android, "Synchronous Send method is not supported on Android.")] public sealed class SyncHttpHandlerTest_RequestRetry : HttpClientHandlerTest_RequestRetry { @@ -77,7 +77,7 @@ public SyncHttpHandlerTest_RequestRetry(ITestOutputHelper output) : base(output) protected override bool TestAsync => false; } - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWasm))] [SkipOnPlatform(TestPlatforms.Android, "Synchronous Send method is not supported on Android.")] public sealed class SyncHttpHandlerTest_Cookies : HttpClientHandlerTest_Cookies { @@ -85,7 +85,7 @@ public SyncHttpHandlerTest_Cookies(ITestOutputHelper output) : base(output) { } protected override bool TestAsync => false; } - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWasm))] [SkipOnPlatform(TestPlatforms.Android, "Synchronous Send method is not supported on Android.")] public sealed class SyncHttpHandlerTest_Cookies_Http11 : HttpClientHandlerTest_Cookies_Http11 { @@ -93,7 +93,7 @@ public SyncHttpHandlerTest_Cookies_Http11(ITestOutputHelper output) : base(outpu protected override bool TestAsync => false; } - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWasm))] [SkipOnPlatform(TestPlatforms.Android, "Synchronous Send method is not supported on Android.")] public sealed class SyncHttpHandler_HttpClientHandler_Cancellation_Test : SocketsHttpHandler_Cancellation_Test { @@ -101,7 +101,7 @@ public SyncHttpHandler_HttpClientHandler_Cancellation_Test(ITestOutputHelper out protected override bool TestAsync => false; } - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWasm))] [SkipOnPlatform(TestPlatforms.Android, "Synchronous Send method is not supported on Android.")] public sealed class SyncHttpHandler_HttpClientHandler_Authentication_Test : HttpClientHandler_Authentication_Test { @@ -109,7 +109,7 @@ public SyncHttpHandler_HttpClientHandler_Authentication_Test(ITestOutputHelper o protected override bool TestAsync => false; } - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWasm))] [SkipOnPlatform(TestPlatforms.Android, "Synchronous Send method is not supported on Android.")] public sealed class SyncHttpHandler_Connect_Test : HttpClientHandler_Connect_Test { @@ -119,6 +119,7 @@ public SyncHttpHandler_Connect_Test(ITestOutputHelper output) : base(output) { } [SkipOnPlatform(TestPlatforms.Browser, "System.Net.Sockets is not supported on this platform.")] [SkipOnPlatform(TestPlatforms.Android, "Synchronous Send method is not supported on Android.")] + [SkipOnPlatform(TestPlatforms.Wasi, "TODO WASI")] public sealed class SyncHttpHandlerTest_HttpClientHandlerTest_Headers : HttpClientHandlerTest_Headers { public SyncHttpHandlerTest_HttpClientHandlerTest_Headers(ITestOutputHelper output) : base(output) { } diff --git a/src/libraries/System.Net.WebSockets.Client/tests/ClientWebSocketTestBase.cs b/src/libraries/System.Net.WebSockets.Client/tests/ClientWebSocketTestBase.cs index 4e4fb4b3d87c7..ff37b17eb89a4 100644 --- a/src/libraries/System.Net.WebSockets.Client/tests/ClientWebSocketTestBase.cs +++ b/src/libraries/System.Net.WebSockets.Client/tests/ClientWebSocketTestBase.cs @@ -130,7 +130,7 @@ protected static async Task ReceiveEntireMessageAsync(We { var handler = new HttpClientHandler(); - if (PlatformDetection.IsNotBrowser) + if (PlatformDetection.IsNotWasm) { handler.ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator; } diff --git a/src/libraries/tests.proj b/src/libraries/tests.proj index 02a004f4ed62f..2c0c0d733639b 100644 --- a/src/libraries/tests.proj +++ b/src/libraries/tests.proj @@ -585,6 +585,7 @@ + diff --git a/src/mono/sample/wasi/sockets-p2/Program.cs b/src/mono/sample/wasi/sockets-p2/Program.cs index c26cc8eb52e7e..2211c8a2cce0b 100644 --- a/src/mono/sample/wasi/sockets-p2/Program.cs +++ b/src/mono/sample/wasi/sockets-p2/Program.cs @@ -35,7 +35,6 @@ public static async Task MainAsync(string[] args) while (start < messageBytes.Length) { start += await client.SendAsync(messageBytes.AsMemory(start), SocketFlags.None); - Console.WriteLine("TODO poll here"); } Console.WriteLine("GET sent");