public ClientWebSocketOptionsTests(ITestOutputHelper output) : base(output) { }
[ConditionalFact(nameof(WebSocketsSupported))]
+ [PlatformSpecific(~TestPlatforms.Browser)] // Credentials not supported on browser
public static void UseDefaultCredentials_Roundtrips()
{
var cws = new ClientWebSocket();
}
[ConditionalFact(nameof(WebSocketsSupported))]
+ [PlatformSpecific(~TestPlatforms.Browser)] // Proxy not supported on browser
public static void Proxy_Roundtrips()
{
var cws = new ClientWebSocket();
}
[ConditionalFact(nameof(WebSocketsSupported))]
+ [PlatformSpecific(~TestPlatforms.Browser)] // Buffer not supported on browser
public static void SetBuffer_InvalidArgs_Throws()
{
// Recreate the minimum WebSocket buffer size values from the .NET Framework version of WebSocket,
}
[ConditionalFact(nameof(WebSocketsSupported))]
+ [PlatformSpecific(~TestPlatforms.Browser)] // KeepAlive not supported on browser
public static void KeepAliveInterval_Roundtrips()
{
var cws = new ClientWebSocket();
}
[ConditionalFact(nameof(WebSocketsSupported))]
+ [PlatformSpecific(~TestPlatforms.Browser)] // Certificates not supported on browser
public void RemoteCertificateValidationCallback_Roundtrips()
{
using (var cws = new ClientWebSocket())
[ConditionalTheory(nameof(WebSocketsSupported))]
[InlineData(false)]
[InlineData(true)]
+ [PlatformSpecific(~TestPlatforms.Browser)] // Certificates not supported on browser
public async Task RemoteCertificateValidationCallback_PassedRemoteCertificateInfo(bool secure)
{
if (PlatformDetection.IsWindows7)
[OuterLoop("Connects to remote service")]
[ConditionalFact(nameof(WebSocketsSupported))]
+ [PlatformSpecific(~TestPlatforms.Browser)] // Credentials not supported on browser
public async Task ClientCertificates_ValidCertificate_ServerReceivesCertificateAndConnectAsyncSucceeds()
{
if (PlatformDetection.IsWindows7)
[ActiveIssue("https://github.com/dotnet/runtime/issues/34690", TestPlatforms.Windows, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)]
[InlineData("ws://")]
[InlineData("wss://")]
+ [PlatformSpecific(~TestPlatforms.Browser)] // Credentials not supported on browser
public async Task NonSecureConnect_ConnectThruProxy_CONNECTisUsed(string connectionType)
{
if (PlatformDetection.IsWindows7)
[ConditionalFact(nameof(WebSocketsSupported))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/34690", TestPlatforms.Windows, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/42852", TestPlatforms.Browser)]
public async Task CloseAsync_CancelableEvenWhenPendingReceive_Throws()
{
var tcs = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously);
[ConditionalFact(nameof(WebSocketsSupported))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/34690", TestPlatforms.Windows, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/42852", TestPlatforms.Browser)]
public async Task ConnectAsync_AddHostHeader_Success()
{
string expectedHost = null;
[ConditionalFact(nameof(WebSocketsSupported))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/34690", TestPlatforms.Windows, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/42852", TestPlatforms.Browser)]
public async Task ConnectAsync_NonStandardRequestHeaders_HeadersAddedWithoutValidation()
{
await LoopbackServer.CreateClientAndServerAsync(async uri =>
}
[ConditionalFact(nameof(WebSocketsSupported))]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/44720", TestPlatforms.Browser)]
public async Task ConnectAsync_CancellationRequestedBeforeConnect_ThrowsOperationCanceledException()
{
using (var clientSocket = new ClientWebSocket())
[ConditionalFact(nameof(WebSocketsSupported))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/34690", TestPlatforms.Windows, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/42852", TestPlatforms.Browser)]
public async Task ConnectAsync_CancellationRequestedAfterConnect_ThrowsOperationCanceledException()
{
var releaseServer = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously);
[OuterLoop("Uses external servers")]
[ConditionalFact(nameof(WebSocketsSupported))]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/42852", TestPlatforms.Browser)]
public async Task SendReceive_ConnectionClosedPrematurely_ReceiveAsyncFailsAndWebSocketStateUpdated()
{
var options = new LoopbackServer.Options { WebSocketEndpoint = true };
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Linq.Parallel\tests\System.Linq.Parallel.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Net.Http\tests\FunctionalTests\System.Net.Http.Functional.Tests.csproj" />
- <ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Net.WebSockets.Client\tests\System.Net.WebSockets.Client.Tests.csproj" />
</ItemGroup>
<ItemGroup>