Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync shared code from runtime #57136

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 0 additions & 78 deletions src/Shared/test/Shared.Tests/runtime/Http2/HPackDecoderTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,6 @@ public class HPackDecoderTests
.Concat(_headerValueHuffmanBytes)
.ToArray();

private static readonly byte[] _literalEmptyString = new byte[] { 0x00 };

private static readonly byte[] _literalEmptyStringHuffman = new byte[] { 0x80 };

// & *
// 11111000 11111111
private static readonly byte[] _huffmanLongPadding = new byte[] { 0x82, 0xf8, 0xff };
Expand Down Expand Up @@ -247,43 +243,6 @@ public void DecodesLiteralHeaderFieldWithoutIndexing_NewName()
TestDecodeWithoutIndexing(encoded, _headerNameString, _headerValueString);
}

[Fact]
public void DecodesLiteralHeaderFieldWithoutIndexing_NewName_EmptyName()
{
byte[] encoded = _literalHeaderFieldWithoutIndexingNewName
.Concat(_literalEmptyString)
.Concat(_headerValue)
.ToArray();

HPackDecodingException exception = Assert.Throws<HPackDecodingException>(() => _decoder.Decode(encoded, endHeaders: true, handler: _handler));
Assert.Equal(SR.Format(SR.net_http_invalid_header_name, string.Empty), exception.Message);
Assert.Empty(_handler.DecodedHeaders);
}

[Fact]
public void DecodesLiteralHeaderFieldWithoutIndexing_NewName_EmptyValue()
{
byte[] encoded = _literalHeaderFieldWithoutIndexingNewName
.Concat(_headerName)
.Concat(_literalEmptyString)
.ToArray();

TestDecodeWithoutIndexing(encoded, _headerNameString, string.Empty);
}

[Fact]
public void DecodesLiteralHeaderFieldWithoutIndexing_NewName_EmptyNameAndValue()
{
byte[] encoded = _literalHeaderFieldWithoutIndexingNewName
.Concat(_literalEmptyString)
.Concat(_literalEmptyString)
.ToArray();

HPackDecodingException exception = Assert.Throws<HPackDecodingException>(() => _decoder.Decode(encoded, endHeaders: true, handler: _handler));
Assert.Equal(SR.Format(SR.net_http_invalid_header_name, string.Empty), exception.Message);
Assert.Empty(_handler.DecodedHeaders);
}

[Fact]
public void DecodesLiteralHeaderFieldWithoutIndexing_NewName_HuffmanEncodedName()
{
Expand All @@ -295,19 +254,6 @@ public void DecodesLiteralHeaderFieldWithoutIndexing_NewName_HuffmanEncodedName(
TestDecodeWithoutIndexing(encoded, _headerNameString, _headerValueString);
}

[Fact]
public void DecodesLiteralHeaderFieldWithoutIndexing_NewName_HuffmanEncodedName_Empty()
{
byte[] encoded = _literalHeaderFieldWithoutIndexingNewName
.Concat(_literalEmptyStringHuffman)
.Concat(_headerValue)
.ToArray();

HPackDecodingException exception = Assert.Throws<HPackDecodingException>(() => _decoder.Decode(encoded, endHeaders: true, handler: _handler));
Assert.Equal(SR.Format(SR.net_http_invalid_header_name, string.Empty), exception.Message);
Assert.Empty(_handler.DecodedHeaders);
}

[Fact]
public void DecodesLiteralHeaderFieldWithoutIndexing_NewName_HuffmanEncodedValue()
{
Expand All @@ -319,17 +265,6 @@ public void DecodesLiteralHeaderFieldWithoutIndexing_NewName_HuffmanEncodedValue
TestDecodeWithoutIndexing(encoded, _headerNameString, _headerValueString);
}

[Fact]
public void DecodesLiteralHeaderFieldWithoutIndexing_NewName_HuffmanEncodedValue_Empty()
{
byte[] encoded = _literalHeaderFieldWithoutIndexingNewName
.Concat(_headerName)
.Concat(_literalEmptyStringHuffman)
.ToArray();

TestDecodeWithoutIndexing(encoded, _headerNameString, string.Empty);
}

[Fact]
public void DecodesLiteralHeaderFieldWithoutIndexing_NewName_HuffmanEncodedNameAndValue()
{
Expand All @@ -341,19 +276,6 @@ public void DecodesLiteralHeaderFieldWithoutIndexing_NewName_HuffmanEncodedNameA
TestDecodeWithoutIndexing(encoded, _headerNameString, _headerValueString);
}

[Fact]
public void DecodesLiteralHeaderFieldWithoutIndexing_NewName_HuffmanEncodedNameAndValue_Empty()
{
byte[] encoded = _literalHeaderFieldWithoutIndexingNewName
.Concat(_literalEmptyStringHuffman)
.Concat(_literalEmptyStringHuffman)
.ToArray();

HPackDecodingException exception = Assert.Throws<HPackDecodingException>(() => _decoder.Decode(encoded, endHeaders: true, handler: _handler));
Assert.Equal(SR.Format(SR.net_http_invalid_header_name, string.Empty), exception.Message);
Assert.Empty(_handler.DecodedHeaders);
}

[Fact]
public void DecodesLiteralHeaderFieldWithoutIndexing_IndexedName()
{
Expand Down
Loading