Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Conversation

@geoffkizer
Copy link

}
}

public sealed class ManagedHandler_HttpProtocolTests : HttpProtocolTests, IDisposable
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like we should have non-ManagedHandler versions of these to ensure the exceptions we get back match the existing behavior.

public override Stream GetStream(Stream s)
{
return new DribbleStream(s);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: could be

public override Stream GetStream(Stream s) => new DribbleStream(s);

[InlineData(555, "we just don't like you")]
[InlineData(600, "still valid")]
[InlineData(999, "this\ttoo\t")]
public async Task ValidStatusLine(int statusCode, string reason)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any benefit https://github.com/dotnet/corefx/blob/master/src/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.cs#L1292 provides over this? Seems like we need one or the other but not both.

[InlineData(600, "still valid")]
[InlineData(999, "this\ttoo\t")]
public async Task ValidStatusLine(int statusCode, string reason)
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please follow the current naming convention for networking tests which use a three part name separated by underscores.

[InlineData("HTTP/A.1 200 OK")]
[InlineData("HTTP/X.Y.Z 200 OK")]
[InlineData("HTTP\\1.1 200 OK")]
[InlineData("HTTP 1.1 200 OK")]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


namespace System.Net.Http.Functional.Tests
{
public abstract class HttpProtocolTests
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please follow the naming convention for class name and filename regarding test classes which use a singular "Test" as the suffix.

await s.WriteAsync(responseBytes, 0, responseBytes.Length);
accept.Close();
listen.Close();
}, TaskContinuationOptions.ExecuteSynchronously);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is now the 3rd or 4th loopback server we have in these tests :) Can we augment one of the existing ones however is needed rather than adding another?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. We already have a LoopbackServer that we use extensively in Http tests. And you can have whatever status line you want returned to enable "fuzzer" type tests.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I'll use the existing LoopbackServer.


[Theory]
[InlineData(200, "OK")]
[InlineData(200, "Sure why not?")]
Copy link
Contributor

@Priya91 Priya91 Aug 18, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about obs-text chars in range %x80-FF, also percent encoded chars, like "Is this valid? %FF"

Copy link
Contributor

@Priya91 Priya91 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test cases LGTM!

@benaadams
Copy link
Member

@dotnet-bot Test Outerloop Windows x64 Debug Build
@dotnet-bot Test Outerloop UWP CoreCLR x64 Debug Build
@dotnet-bot Test Outerloop Linux x64 Release Build

@karelz
Copy link
Member

karelz commented Sep 6, 2017

@geoffkizer what is status of this PR? 2.5 weeks no update ...

@karelz
Copy link
Member

karelz commented Oct 2, 2017

@geoffkizer ping?

@stephentoub
Copy link
Member

I'll finish this.

@stephentoub stephentoub merged commit 08802ff into dotnet:master Oct 18, 2017
@karelz karelz added this to the 2.1.0 milestone Oct 28, 2017
Dotnet-GitSync-Bot pushed a commit to Dotnet-GitSync-Bot/corefx that referenced this pull request Apr 30, 2019
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
GrabYourPitchforks added a commit to Dotnet-GitSync-Bot/corefx that referenced this pull request May 1, 2019
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
stephentoub pushed a commit that referenced this pull request May 1, 2019
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
Managed Handler: add some basic protocol tests for status line handling

Commit migrated from dotnet/corefx@08802ff
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants