Skip to content

Commit

Permalink
- disable tests with PreAuthenticate not supported on Browser
Browse files Browse the repository at this point in the history
- disable tests with Credentials is not supported on Browser
- disable tests with Loopback server
  • Loading branch information
pavelsavara committed Jun 2, 2021
1 parent 2bbb61b commit ca37463
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,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")]
public async Task GetAsync_ServerNeedsBasicAuthAndSetDefaultCredentials_StatusCodeUnauthorized(Configuration.Http.RemoteServer remoteServer)
{
HttpClientHandler handler = CreateHttpClientHandler();
Expand All @@ -142,6 +143,7 @@ public async Task GetAsync_ServerNeedsBasicAuthAndSetDefaultCredentials_StatusCo

[OuterLoop("Uses external servers")]
[Theory, MemberData(nameof(RemoteServersMemberData))]
[SkipOnPlatform(TestPlatforms.Browser, "Credentials is not supported on Browser")]
public async Task GetAsync_ServerNeedsAuthAndSetCredential_StatusCodeOK(Configuration.Http.RemoteServer remoteServer)
{
HttpClientHandler handler = CreateHttpClientHandler();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ public async Task PostLargeContentUsingContentLengthSemantics_Success(Configurat
}

[OuterLoop("Uses external servers")]
[SkipOnPlatform(TestPlatforms.Browser, "PreAuthenticate not supported on Browser")]
[Theory, MemberData(nameof(RemoteServersMemberData))]
public async Task PostRewindableContentUsingAuth_NoPreAuthenticate_Success(Configuration.Http.RemoteServer remoteServer)
{
Expand All @@ -178,6 +179,7 @@ public async Task PostRewindableContentUsingAuth_NoPreAuthenticate_Success(Confi

[OuterLoop("Uses external servers")]
[Theory, MemberData(nameof(RemoteServersMemberData))]
[SkipOnPlatform(TestPlatforms.Browser, "PreAuthenticate not supported on Browser")]
public async Task PostNonRewindableContentUsingAuth_NoPreAuthenticate_ThrowsHttpRequestException(Configuration.Http.RemoteServer remoteServer)
{
// Sync API supported only up to HTTP/1.1
Expand All @@ -194,6 +196,7 @@ await Assert.ThrowsAsync<HttpRequestException>(() =>

[OuterLoop("Uses external servers")]
[Theory, MemberData(nameof(RemoteServersMemberData))]
[SkipOnPlatform(TestPlatforms.Browser, "PreAuthenticate not supported on Browser")]
public async Task PostNonRewindableContentUsingAuth_PreAuthenticate_Success(Configuration.Http.RemoteServer remoteServer)
{
// Sync API supported only up to HTTP/1.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ await client.GetAsync(remoteServer.EchoUri, HttpCompletionOption.ResponseHeaders
}
}
#if NETCOREAPP
[ActiveIssue("https://github.com/dotnet/runtime/issues/42852", TestPlatforms.Browser)]
[Theory]
[InlineData(TransferType.ContentLength, TransferError.ContentLengthTooLarge)]
[InlineData(TransferType.Chunked, TransferError.MissingChunkTerminator)]
Expand All @@ -241,6 +242,7 @@ await StartTransferTypeAndErrorServer(transferType, transferError, async uri =>
});
}

[ActiveIssue("https://github.com/dotnet/runtime/issues/42852", TestPlatforms.Browser)]
[Theory]
[InlineData(TransferType.None, TransferError.None)]
[InlineData(TransferType.ContentLength, TransferError.None)]
Expand All @@ -255,6 +257,7 @@ await StartTransferTypeAndErrorServer(transferType, transferError, async uri =>
});
}

[ActiveIssue("https://github.com/dotnet/runtime/issues/42852", TestPlatforms.Browser)]
[Theory]
[InlineData(TransferType.None, TransferError.None)]
[InlineData(TransferType.ContentLength, TransferError.None)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public HttpClientHandlerTest_Headers(ITestOutputHelper output) : base(output) {
private sealed class DerivedHttpHeaders : HttpHeaders { }

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/42852", TestPlatforms.Browser)]
public async Task SendAsync_RequestWithSimpleHeader_ResponseReferencesUnmodifiedRequestHeaders()
{
const string HeaderKey = "some-header-123", HeaderValue = "this is the expected header value";
Expand All @@ -46,6 +47,7 @@ await LoopbackServerFactory.CreateClientAndServerAsync(async uri =>
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/42852", TestPlatforms.Browser)]
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";
Expand All @@ -69,6 +71,7 @@ await LoopbackServerFactory.CreateClientAndServerAsync(async uri =>
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/42852", TestPlatforms.Browser)]
public async Task SendAsync_LargeHeaders_CorrectlyWritten()
{
if (UseVersion == HttpVersion.Version30)
Expand Down Expand Up @@ -104,6 +107,7 @@ await LoopbackServerFactory.CreateClientAndServerAsync(async uri =>
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/42852", TestPlatforms.Browser)]
public async Task SendAsync_DefaultHeaders_CorrectlyWritten()
{
const string Version = "2017-04-17";
Expand Down Expand Up @@ -133,6 +137,7 @@ await LoopbackServerFactory.CreateClientAndServerAsync(async uri =>
[Theory]
[InlineData("\u05D1\u05F1")]
[InlineData("jp\u30A5")]
[ActiveIssue("https://github.com/dotnet/runtime/issues/42852", TestPlatforms.Browser)]
public async Task SendAsync_InvalidCharactersInHeader_Throw(string value)
{
await LoopbackServerFactory.CreateClientAndServerAsync(async uri =>
Expand Down Expand Up @@ -164,6 +169,7 @@ await LoopbackServerFactory.CreateClientAndServerAsync(async uri =>
[InlineData("Accept-CharSet", "text/plain, text/json", false)] // invalid format for header but added with TryAddWithoutValidation
[InlineData("Content-Location", "", false)] // invalid format for header but added with TryAddWithoutValidation
[InlineData("Max-Forwards", "NotAnInteger", false)] // invalid format for header but added with TryAddWithoutValidation
[ActiveIssue("https://github.com/dotnet/runtime/issues/42852", TestPlatforms.Browser)]
public async Task SendAsync_SpecialHeaderKeyOrValue_Success(string key, string value, bool parsable)
{
await LoopbackServerFactory.CreateClientAndServerAsync(async uri =>
Expand Down Expand Up @@ -203,6 +209,7 @@ await LoopbackServerFactory.CreateClientAndServerAsync(async uri =>
[Theory]
[InlineData("Content-Security-Policy", 4618)]
[InlineData("RandomCustomHeader", 12345)]
[ActiveIssue("https://github.com/dotnet/runtime/issues/42852", TestPlatforms.Browser)]
public async Task GetAsync_LargeHeader_Success(string headerName, int headerValueLength)
{
var rand = new Random(42);
Expand All @@ -227,6 +234,7 @@ await LoopbackServerFactory.CreateClientAndServerAsync(async uri =>
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/42852", TestPlatforms.Browser)]
public async Task GetAsync_EmptyResponseHeader_Success()
{
IList<HttpHeaderData> headers = new HttpHeaderData[] {
Expand Down Expand Up @@ -254,6 +262,7 @@ await server.AcceptConnectionAsync(async connection =>
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/42852", TestPlatforms.Browser)]
public async Task GetAsync_MissingExpires_ReturnNull()
{
await LoopbackServerFactory.CreateClientAndServerAsync(async uri =>
Expand All @@ -274,6 +283,7 @@ await LoopbackServerFactory.CreateClientAndServerAsync(async uri =>
[InlineData("Thu, 01 Dec 1994 16:00:00 GMT", true)]
[InlineData("-1", false)]
[InlineData("0", false)]
[ActiveIssue("https://github.com/dotnet/runtime/issues/42852", TestPlatforms.Browser)]
public async Task SendAsync_Expires_Success(string value, bool isValid)
{
await LoopbackServerFactory.CreateClientAndServerAsync(async uri =>
Expand Down Expand Up @@ -312,6 +322,7 @@ public void HeadersAdd_CustomExpires_Success(string value, bool isValid)

[Theory]
[InlineData("Accept-Encoding", "identity,gzip")]
[ActiveIssue("https://github.com/dotnet/runtime/issues/42852", TestPlatforms.Browser)]
public async Task SendAsync_RequestHeaderInResponse_Success(string name, string value)
{
await LoopbackServerFactory.CreateClientAndServerAsync(async uri =>
Expand All @@ -336,6 +347,7 @@ await LoopbackServerFactory.CreateClientAndServerAsync(async uri =>
[Theory]
[InlineData(false)]
[InlineData(true)]
[ActiveIssue("https://github.com/dotnet/runtime/issues/53018", TestPlatforms.Browser)]
public async Task SendAsync_GetWithValidHostHeader_Success(bool withPort)
{
if (UseVersion == HttpVersion.Version30)
Expand Down Expand Up @@ -381,6 +393,7 @@ public async Task SendAsync_GetWithInvalidHostHeader_ThrowsException()
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/42852", TestPlatforms.Browser)]
public async Task SendAsync_WithZeroLengthHeaderName_Throws()
{
await LoopbackServerFactory.CreateClientAndServerAsync(
Expand Down Expand Up @@ -423,6 +436,7 @@ private static readonly (string Name, Encoding ValueEncoding, string[] Values)[]
};

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/42852", TestPlatforms.Browser)]
public async Task SendAsync_CustomRequestEncodingSelector_CanSendNonAsciiHeaderValues()
{
await LoopbackServerFactory.CreateClientAndServerAsync(
Expand Down Expand Up @@ -477,6 +491,7 @@ await LoopbackServerFactory.CreateClientAndServerAsync(
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/42852", TestPlatforms.Browser)]
public async Task SendAsync_CustomResponseEncodingSelector_CanReceiveNonAsciiHeaderValues()
{
await LoopbackServerFactory.CreateClientAndServerAsync(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public abstract class HttpClientHandlerTest_RequestRetry : HttpClientHandlerTest
public HttpClientHandlerTest_RequestRetry(ITestOutputHelper output) : base(output) { }

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/42852", TestPlatforms.Browser)]
public async Task GetAsyncOnNewConnection_RetryOnConnectionClosed_Success()
{
await LoopbackServer.CreateClientAndServerAsync(async url =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,7 @@ public async Task GetAsync_CustomException_Asynchronous_ThrowsException()

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)]
[ActiveIssue("https://github.com/dotnet/runtime/issues/42852", TestPlatforms.Browser)]
public async Task GetStringAsync_Success()
{
string content = Guid.NewGuid().ToString();
Expand All @@ -378,6 +379,7 @@ await LoopbackServer.CreateClientAndServerAsync(

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)]
[ActiveIssue("https://github.com/dotnet/runtime/issues/42852", TestPlatforms.Browser)]
public async Task GetStringAsync_CanBeCanceled_AlreadyCanceledCts()
{
var onClientFinished = new SemaphoreSlim(0, 1);
Expand All @@ -403,6 +405,7 @@ await LoopbackServer.CreateClientAndServerAsync(

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)]
[ActiveIssue("https://github.com/dotnet/runtime/issues/42852", TestPlatforms.Browser)]
public async Task GetStringAsync_CanBeCanceled()
{
var cts = new CancellationTokenSource();
Expand Down Expand Up @@ -437,6 +440,7 @@ await server.AcceptConnectionAsync(async connection =>
[InlineData(1, 0)]
[InlineData(1, 1)]
[InlineData(1, 2)]
[ActiveIssue("https://github.com/dotnet/runtime/issues/42852", TestPlatforms.Browser)]
public async Task GetAsync_ContentCanBeCanceled(int getMode, int cancelMode)
{
// cancelMode:
Expand Down Expand Up @@ -527,6 +531,7 @@ await LoopbackServerFactory.CreateClientAndServerAsync(

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)]
[ActiveIssue("https://github.com/dotnet/runtime/issues/42852", TestPlatforms.Browser)]
public async Task GetByteArrayAsync_Success()
{
string content = Guid.NewGuid().ToString();
Expand All @@ -548,6 +553,7 @@ await LoopbackServer.CreateClientAndServerAsync(

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)]
[ActiveIssue("https://github.com/dotnet/runtime/issues/42852", TestPlatforms.Browser)]
public async Task GetByteArrayAsync_CanBeCanceled_AlreadyCanceledCts()
{
var onClientFinished = new SemaphoreSlim(0, 1);
Expand All @@ -573,6 +579,7 @@ await LoopbackServer.CreateClientAndServerAsync(

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)]
[ActiveIssue("https://github.com/dotnet/runtime/issues/42852", TestPlatforms.Browser)]
public async Task GetByteArrayAsync_CanBeCanceled()
{
var cts = new CancellationTokenSource();
Expand Down Expand Up @@ -601,6 +608,7 @@ await server.AcceptConnectionAsync(async connection =>

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)]
[ActiveIssue("https://github.com/dotnet/runtime/issues/42852", TestPlatforms.Browser)]
public async Task GetStreamAsync_Success()
{
string content = Guid.NewGuid().ToString();
Expand All @@ -625,6 +633,7 @@ await LoopbackServer.CreateClientAndServerAsync(

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)]
[ActiveIssue("https://github.com/dotnet/runtime/issues/42852", TestPlatforms.Browser)]
public async Task GetStreamAsync_CanBeCanceled_AlreadyCanceledCts()
{
var onClientFinished = new SemaphoreSlim(0, 1);
Expand All @@ -650,6 +659,7 @@ await LoopbackServer.CreateClientAndServerAsync(

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)]
[ActiveIssue("https://github.com/dotnet/runtime/issues/42852", TestPlatforms.Browser)]
public async Task GetStreamAsync_CanBeCanceled()
{
var cts = new CancellationTokenSource();
Expand Down Expand Up @@ -907,6 +917,7 @@ public void Send_SingleThread_Succeeds(HttpCompletionOption completionOption)
[InlineData(HttpCompletionOption.ResponseContentRead)]
[InlineData(HttpCompletionOption.ResponseHeadersRead)]
[ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)]
[ActiveIssue("https://github.com/dotnet/runtime/issues/42852", TestPlatforms.Browser)]
public async Task Send_SingleThread_Loopback_Succeeds(HttpCompletionOption completionOption)
{
string content = "Test content";
Expand Down Expand Up @@ -959,6 +970,7 @@ await server.AcceptConnectionAsync(async connection =>

[Fact]
[OuterLoop]
[ActiveIssue("https://github.com/dotnet/runtime/issues/42852", TestPlatforms.Browser)]
public async Task Send_CancelledRequestContent_Throws()
{
CancellationTokenSource cts = new CancellationTokenSource();
Expand Down Expand Up @@ -1005,6 +1017,7 @@ await server.AcceptConnectionAsync(async connection =>
[Fact]
[OuterLoop]
[ActiveIssue("https://github.com/dotnet/runtime/issues/39056")]
[ActiveIssue("https://github.com/dotnet/runtime/issues/42852", TestPlatforms.Browser)]
public async Task Send_TimeoutRequestContent_Throws()
{
await LoopbackServer.CreateClientAndServerAsync(
Expand Down Expand Up @@ -1047,6 +1060,7 @@ await server.AcceptConnectionAsync(async connection =>

[Fact]
[OuterLoop]
[ActiveIssue("https://github.com/dotnet/runtime/issues/42852", TestPlatforms.Browser)]
public async Task Send_CancelledResponseContent_Throws()
{
string content = "Test content";
Expand Down Expand Up @@ -1096,6 +1110,7 @@ await server.AcceptConnectionAsync(async connection =>

[Fact]
[OuterLoop]
[ActiveIssue("https://github.com/dotnet/runtime/issues/42852", TestPlatforms.Browser)]
public void Send_TimeoutResponseContent_Throws()
{
const string Content = "Test content";
Expand Down Expand Up @@ -1149,6 +1164,7 @@ public static IEnumerable<object[]> VersionSelectionMemberData()
[Theory]
[MemberData(nameof(VersionSelectionMemberData))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)]
[ActiveIssue("https://github.com/dotnet/runtime/issues/42852", TestPlatforms.Browser)]
public async Task SendAsync_CorrectVersionSelected_LoopbackServer(Version requestVersion, HttpVersionPolicy versionPolicy, Version serverVersion, bool useSsl, object expectedResult)
{
await HttpAgnosticLoopbackServer.CreateClientAndServerAsync(
Expand Down
Loading

0 comments on commit ca37463

Please sign in to comment.