|
proxygen
|
#include <proxygen/lib/http/codec/test/HTTP2FramerTest.h>#include <folly/Random.h>#include <folly/portability/GTest.h>#include <proxygen/lib/http/HTTPHeaderSize.h>#include <proxygen/lib/http/HTTPMessage.h>#include <proxygen/lib/http/codec/test/TestUtils.h>#include <random>#include <proxygen/lib/http/codec/HTTP2Framer.h>Go to the source code of this file.
Classes | |
| class | HTTP2FramerTest |
Functions | |
| void | writeFrameHeaderManual (IOBufQueue &queue, uint32_t length, uint8_t type, uint8_t flags, uint32_t stream) |
| TEST_F (HTTP2FramerTest, WriteAndParseSmallDataNoPad) | |
| TEST_F (HTTP2FramerTest, WriteAndParseSmallDataZeroPad) | |
| TEST_F (HTTP2FramerTest, WriteAndParseSmallDataSmallPad) | |
| TEST_F (HTTP2FramerTest, ManyDataFrameSizes) | |
| TEST_F (HTTP2FramerTest, BadStreamData) | |
| TEST_F (HTTP2FramerTest, BadStreamSettings) | |
| TEST_F (HTTP2FramerTest, BadPad) | |
| TEST_F (HTTP2FramerTest, NoHeadroomOptimization) | |
| TEST_F (HTTP2FramerTest, UseHeadroomOptimization) | |
| TEST_F (HTTP2FramerTest, BadStreamId) | |
| TEST_F (HTTP2FramerTest, RstStream) | |
| TEST_F (HTTP2FramerTest, Goaway) | |
| TEST_F (HTTP2FramerTest, GoawayDebugData) | |
| TEST_F (HTTP2FramerTest, GoawayDoubleRead) | |
| TEST_F (HTTP2FramerTest, Priority) | |
| TEST_F (HTTP2FramerTest, HeadersWithPaddingAndPriority) | |
| TEST_F (HTTP2FramerTest, Ping) | |
| TEST_F (HTTP2FramerTest, WindowUpdate) | |
| TEST_F (HTTP2FramerTest, CertificateRequest) | |
| TEST_F (HTTP2FramerTest, EmptyCertificateRequest) | |
| TEST_F (HTTP2FramerTest, ShortCertificateRequest) | |
| TEST_F (HTTP2FramerTest, CertificateRequestOnNonzeroStream) | |
| TEST_F (HTTP2FramerTest, EndingCertificate) | |
| TEST_F (HTTP2FramerTest, Certificate) | |
| TEST_F (HTTP2FramerTest, EmptyCertificate) | |
| TEST_F (HTTP2FramerTest, ShortCertificate) | |
| TEST_F (HTTP2FramerTest, CertificateOnNonzeroStream) | |
| TEST_F (HTTP2FramerTest, ShortWindowUpdate) | |
| TEST_F (HTTP2FramerTest, Uint32MaxWindowUpdate) | |
| TEST_F (HTTP2FramerTest, AltSvc) | |
| TEST_F (HTTP2FramerTest, Settings) | |
| TEST_F (HTTP2FramerTest, SettingsAck) | |
| TEST_F (HTTP2FramerTest, BadSettingsAck) | |
| TEST_F (HTTP2FramerTest, UnknownSetting) | |
| TEST_F (HTTP2FramerTest, PushPromise) | |
| TEST_F (HTTP2FramerTest, Continuation) | |
| TEST_F (HTTP2FramerTest, ExHeaders) | |
| TEST_F (HTTP2FramerTest, ExHeadersWithFlagsSet) | |
| TEST_F | ( | HTTP2FramerTest | , |
| WriteAndParseSmallDataNoPad | |||
| ) |
| TEST_F | ( | HTTP2FramerTest | , |
| WriteAndParseSmallDataZeroPad | |||
| ) |
Definition at line 90 of file HTTP2FramerTest.cpp.
| TEST_F | ( | HTTP2FramerTest | , |
| WriteAndParseSmallDataSmallPad | |||
| ) |
Definition at line 94 of file HTTP2FramerTest.cpp.
| TEST_F | ( | HTTP2FramerTest | , |
| ManyDataFrameSizes | |||
| ) |
Definition at line 98 of file HTTP2FramerTest.cpp.
References proxygen::http2::kMaxFramePayloadLength, proxygen::http2::kNoPadding, makeBuf(), uint32_t, and uint8_t.
| TEST_F | ( | HTTP2FramerTest | , |
| BadStreamData | |||
| ) |
Definition at line 110 of file HTTP2FramerTest.cpp.
References EXPECT_EQ, proxygen::http2::parseData(), proxygen::http2::parseFrameHeader(), uint16_t, and writeFrameHeaderManual().
| TEST_F | ( | HTTP2FramerTest | , |
| BadStreamSettings | |||
| ) |
Definition at line 123 of file HTTP2FramerTest.cpp.
References proxygen::http2::ACK, EXPECT_EQ, proxygen::http2::parseFrameHeader(), proxygen::http2::parseSettings(), proxygen::spdy::SETTINGS, and writeFrameHeaderManual().
| TEST_F | ( | HTTP2FramerTest | , |
| BadPad | |||
| ) |
Definition at line 135 of file HTTP2FramerTest.cpp.
References EXPECT_EQ, makeBuf(), proxygen::http2::parseData(), proxygen::http2::parseFrameHeader(), uint16_t, and proxygen::http2::writeData().
| TEST_F | ( | HTTP2FramerTest | , |
| NoHeadroomOptimization | |||
| ) |
Definition at line 150 of file HTTP2FramerTest.cpp.
References folly::IOBuf::create(), EXPECT_EQ, EXPECT_TRUE, proxygen::http2::kFrameHeaderSize, proxygen::http2::kFramePrioritySize, folly::gen::move, and proxygen::http2::writeData().
| TEST_F | ( | HTTP2FramerTest | , |
| UseHeadroomOptimization | |||
| ) |
Definition at line 169 of file HTTP2FramerTest.cpp.
References folly::IOBuf::create(), EXPECT_FALSE, EXPECT_LT, proxygen::http2::kFrameHeaderSize, proxygen::http2::kFramePrioritySize, folly::gen::move, and proxygen::http2::writeData().
| TEST_F | ( | HTTP2FramerTest | , |
| BadStreamId | |||
| ) |
Definition at line 185 of file HTTP2FramerTest.cpp.
References EXPECT_DEATH_NO_CORE, and proxygen::http2::writeRstStream().
| TEST_F | ( | HTTP2FramerTest | , |
| RstStream | |||
| ) |
Definition at line 192 of file HTTP2FramerTest.cpp.
References ASSERT_EQ, proxygen::http2::FrameHeader::flags, proxygen::http2::kFrameRstStreamSize, proxygen::http2::FrameHeader::length, parse(), proxygen::http2::parseRstStream(), proxygen::spdy::RST_STREAM, proxygen::http2::FrameHeader::stream, proxygen::http2::FrameHeader::type, and proxygen::http2::writeRstStream().
| TEST_F | ( | HTTP2FramerTest | , |
| Goaway | |||
| ) |
Definition at line 206 of file HTTP2FramerTest.cpp.
References ASSERT_EQ, ASSERT_FALSE, proxygen::http2::FrameHeader::flags, proxygen::spdy::GOAWAY, proxygen::http2::kFrameGoawaySize, proxygen::http2::FrameHeader::length, parse(), proxygen::http2::parseGoaway(), proxygen::http2::FrameHeader::stream, proxygen::http2::FrameHeader::type, uint32_t, and proxygen::http2::writeGoaway().
| TEST_F | ( | HTTP2FramerTest | , |
| GoawayDebugData | |||
| ) |
Definition at line 224 of file HTTP2FramerTest.cpp.
References ASSERT_EQ, folly::IOBuf::computeChainDataLength(), folly::data(), EXPECT_EQ, proxygen::http2::FrameHeader::flags, proxygen::spdy::GOAWAY, proxygen::http2::kFrameGoawaySize, proxygen::http2::FrameHeader::length, makeBuf(), folly::gen::move, folly::IOBuf::moveToFbString(), parse(), proxygen::http2::parseGoaway(), proxygen::http2::FrameHeader::stream, proxygen::http2::FrameHeader::type, uint32_t, and proxygen::http2::writeGoaway().
| TEST_F | ( | HTTP2FramerTest | , |
| GoawayDoubleRead | |||
| ) |
Definition at line 248 of file HTTP2FramerTest.cpp.
References ASSERT_EQ, proxygen::spdy::GOAWAY, proxygen::http2::kFrameGoawaySize, proxygen::http2::parseFrameHeader(), proxygen::http2::parseGoaway(), proxygen::http2::FrameHeader::type, uint32_t, folly::io::detail::Writable< Derived >::writeBE(), and writeFrameHeaderManual().
| TEST_F | ( | HTTP2FramerTest | , |
| Priority | |||
| ) |
Definition at line 275 of file HTTP2FramerTest.cpp.
References ASSERT_EQ, ASSERT_FALSE, proxygen::http2::PriorityUpdate::exclusive, parse(), proxygen::http2::parsePriority(), proxygen::http2::PRIORITY, proxygen::http2::PriorityUpdate::streamDependency, proxygen::http2::PriorityUpdate::weight, and proxygen::http2::writePriority().
| TEST_F | ( | HTTP2FramerTest | , |
| HeadersWithPaddingAndPriority | |||
| ) |
Definition at line 290 of file HTTP2FramerTest.cpp.
References ASSERT_EQ, ASSERT_FALSE, ASSERT_TRUE, proxygen::http2::END_HEADERS, proxygen::http2::END_STREAM, proxygen::http2::PriorityUpdate::exclusive, EXPECT_EQ, proxygen::spdy::HEADERS, makeBuf(), folly::IOBuf::moveToFbString(), parse(), proxygen::http2::parseHeaders(), proxygen::http2::PRIORITY, proxygen::http2::PriorityUpdate::streamDependency, proxygen::http2::PriorityUpdate::weight, and proxygen::http2::writeHeaders().
| TEST_F | ( | HTTP2FramerTest | , |
| Ping | |||
| ) |
Definition at line 311 of file HTTP2FramerTest.cpp.
References ASSERT_EQ, folly::data(), EXPECT_EQ, proxygen::http2::FrameHeader::flags, parse(), proxygen::http2::parsePing(), proxygen::spdy::PING, folly::Random::rand64(), proxygen::http2::FrameHeader::stream, proxygen::http2::FrameHeader::type, uint64_t, and proxygen::http2::writePing().
| TEST_F | ( | HTTP2FramerTest | , |
| WindowUpdate | |||
| ) |
Definition at line 325 of file HTTP2FramerTest.cpp.
References ASSERT_EQ, EXPECT_EQ, proxygen::http2::FrameHeader::flags, parse(), proxygen::http2::parseWindowUpdate(), proxygen::http2::FrameHeader::stream, proxygen::http2::FrameHeader::type, uint32_t, proxygen::spdy::WINDOW_UPDATE, and proxygen::http2::writeWindowUpdate().
| TEST_F | ( | HTTP2FramerTest | , |
| CertificateRequest | |||
| ) |
Definition at line 338 of file HTTP2FramerTest.cpp.
References ASSERT_EQ, folly::IOBuf::computeChainDataLength(), folly::data(), EXPECT_EQ, proxygen::http2::FrameHeader::flags, proxygen::http2::kFrameCertificateRequestSizeBase, proxygen::http2::FrameHeader::length, makeBuf(), folly::gen::move, folly::IOBuf::moveToFbString(), parse(), proxygen::http2::parseCertificateRequest(), proxygen::http2::FrameHeader::stream, proxygen::http2::FrameHeader::type, uint16_t, and proxygen::http2::writeCertificateRequest().
| TEST_F | ( | HTTP2FramerTest | , |
| EmptyCertificateRequest | |||
| ) |
Definition at line 359 of file HTTP2FramerTest.cpp.
References ASSERT_EQ, ASSERT_FALSE, proxygen::http2::FrameHeader::flags, proxygen::http2::kFrameCertificateRequestSizeBase, proxygen::http2::FrameHeader::length, parse(), proxygen::http2::parseCertificateRequest(), proxygen::http2::FrameHeader::stream, proxygen::http2::FrameHeader::type, uint16_t, and proxygen::http2::writeCertificateRequest().
| TEST_F | ( | HTTP2FramerTest | , |
| ShortCertificateRequest | |||
| ) |
Definition at line 376 of file HTTP2FramerTest.cpp.
References ASSERT_EQ, proxygen::http2::parseCertificateRequest(), proxygen::http2::parseFrameHeader(), uint16_t, uint8_t, folly::io::detail::Writable< Derived >::writeBE(), and writeFrameHeaderManual().
| TEST_F | ( | HTTP2FramerTest | , |
| CertificateRequestOnNonzeroStream | |||
| ) |
Definition at line 393 of file HTTP2FramerTest.cpp.
References ASSERT_EQ, proxygen::http2::parseCertificateRequest(), proxygen::http2::parseFrameHeader(), uint16_t, folly::io::detail::Writable< Derived >::writeBE(), and writeFrameHeaderManual().
| TEST_F | ( | HTTP2FramerTest | , |
| EndingCertificate | |||
| ) |
Definition at line 410 of file HTTP2FramerTest.cpp.
References ASSERT_EQ, folly::IOBuf::computeChainDataLength(), folly::data(), EXPECT_EQ, proxygen::http2::FrameHeader::flags, proxygen::http2::kFrameCertificateSizeBase, proxygen::http2::FrameHeader::length, makeBuf(), folly::gen::move, folly::IOBuf::moveToFbString(), parse(), proxygen::http2::parseCertificate(), proxygen::http2::FrameHeader::stream, proxygen::http2::FrameHeader::type, uint16_t, and proxygen::http2::writeCertificate().
| TEST_F | ( | HTTP2FramerTest | , |
| Certificate | |||
| ) |
Definition at line 432 of file HTTP2FramerTest.cpp.
References ASSERT_EQ, ASSERT_TRUE, folly::IOBuf::computeChainDataLength(), folly::data(), EXPECT_EQ, proxygen::http2::FrameHeader::flags, proxygen::http2::kFrameCertificateSizeBase, proxygen::http2::FrameHeader::length, makeBuf(), folly::gen::move, folly::IOBuf::moveToFbString(), parse(), proxygen::http2::parseCertificate(), proxygen::http2::FrameHeader::stream, proxygen::http2::TO_BE_CONTINUED, proxygen::http2::FrameHeader::type, uint16_t, and proxygen::http2::writeCertificate().
| TEST_F | ( | HTTP2FramerTest | , |
| EmptyCertificate | |||
| ) |
Definition at line 455 of file HTTP2FramerTest.cpp.
References ASSERT_EQ, ASSERT_FALSE, ASSERT_TRUE, proxygen::http2::FrameHeader::flags, proxygen::http2::kFrameCertificateSizeBase, proxygen::http2::FrameHeader::length, parse(), proxygen::http2::parseCertificate(), proxygen::http2::FrameHeader::stream, proxygen::http2::TO_BE_CONTINUED, proxygen::http2::FrameHeader::type, uint16_t, and proxygen::http2::writeCertificate().
| TEST_F | ( | HTTP2FramerTest | , |
| ShortCertificate | |||
| ) |
Definition at line 472 of file HTTP2FramerTest.cpp.
References ASSERT_EQ, proxygen::http2::parseCertificate(), proxygen::http2::parseFrameHeader(), uint16_t, uint8_t, folly::io::detail::Writable< Derived >::writeBE(), and writeFrameHeaderManual().
| TEST_F | ( | HTTP2FramerTest | , |
| CertificateOnNonzeroStream | |||
| ) |
Definition at line 488 of file HTTP2FramerTest.cpp.
References ASSERT_EQ, proxygen::http2::parseCertificate(), proxygen::http2::parseFrameHeader(), uint16_t, folly::io::detail::Writable< Derived >::writeBE(), and writeFrameHeaderManual().
| TEST_F | ( | HTTP2FramerTest | , |
| ShortWindowUpdate | |||
| ) |
Definition at line 505 of file HTTP2FramerTest.cpp.
References ASSERT_EQ, proxygen::http2::parseFrameHeader(), proxygen::http2::parseWindowUpdate(), uint32_t, proxygen::spdy::WINDOW_UPDATE, and writeFrameHeaderManual().
| TEST_F | ( | HTTP2FramerTest | , |
| Uint32MaxWindowUpdate | |||
| ) |
Definition at line 519 of file HTTP2FramerTest.cpp.
References ASSERT_EQ, EXPECT_EQ, i, proxygen::http2::kFrameHeaderSize, parse(), proxygen::http2::parseWindowUpdate(), uint32_t, proxygen::spdy::WINDOW_UPDATE, and proxygen::http2::writeWindowUpdate().
| TEST_F | ( | HTTP2FramerTest | , |
| AltSvc | |||
| ) |
Definition at line 540 of file HTTP2FramerTest.cpp.
References ASSERT_EQ, EXPECT_EQ, proxygen::http2::FrameHeader::flags, parse(), proxygen::http2::parseAltSvc(), proxygen::http2::FrameHeader::stream, proxygen::http2::FrameHeader::type, uint32_t, and proxygen::http2::writeAltSvc().
| TEST_F | ( | HTTP2FramerTest | , |
| Settings | |||
| ) |
Definition at line 565 of file HTTP2FramerTest.cpp.
References ASSERT_EQ, proxygen::http2::FrameHeader::flags, proxygen::http2::FrameHeader::length, parse(), proxygen::http2::parseSettings(), proxygen::spdy::SETTINGS, settings, proxygen::http2::FrameHeader::stream, proxygen::http2::FrameHeader::type, and proxygen::http2::writeSettings().
| TEST_F | ( | HTTP2FramerTest | , |
| SettingsAck | |||
| ) |
Definition at line 581 of file HTTP2FramerTest.cpp.
References proxygen::http2::ACK, ASSERT_EQ, EXPECT_EQ, proxygen::http2::parseFrameHeader(), proxygen::http2::parseSettings(), proxygen::spdy::SETTINGS, and proxygen::http2::writeSettingsAck().
| TEST_F | ( | HTTP2FramerTest | , |
| BadSettingsAck | |||
| ) |
Definition at line 597 of file HTTP2FramerTest.cpp.
References proxygen::http2::ACK, ASSERT_EQ, EXPECT_EQ, proxygen::http2::parseFrameHeader(), proxygen::http2::parseSettings(), proxygen::spdy::SETTINGS, uint32_t, uint8_t, and proxygen::http2::writeSettingsAck().
| TEST_F | ( | HTTP2FramerTest | , |
| UnknownSetting | |||
| ) |
Definition at line 617 of file HTTP2FramerTest.cpp.
References ASSERT_EQ, proxygen::http2::FrameHeader::flags, proxygen::http2::FrameHeader::length, parse(), proxygen::http2::parseSettings(), proxygen::spdy::SETTINGS, settings, proxygen::http2::FrameHeader::stream, proxygen::http2::FrameHeader::type, and proxygen::http2::writeSettings().
| TEST_F | ( | HTTP2FramerTest | , |
| PushPromise | |||
| ) |
Definition at line 633 of file HTTP2FramerTest.cpp.
References ASSERT_EQ, EXPECT_EQ, makeBuf(), folly::IOBuf::moveToFbString(), parse(), proxygen::http2::parsePushPromise(), uint32_t, and proxygen::http2::writePushPromise().
| TEST_F | ( | HTTP2FramerTest | , |
| Continuation | |||
| ) |
Definition at line 648 of file HTTP2FramerTest.cpp.
References ASSERT_EQ, ASSERT_FALSE, ASSERT_TRUE, proxygen::http2::END_HEADERS, EXPECT_EQ, makeBuf(), folly::IOBuf::moveToFbString(), proxygen::http2::PADDED, parse(), proxygen::http2::parseContinuation(), and proxygen::http2::writeContinuation().
| TEST_F | ( | HTTP2FramerTest | , |
| ExHeaders | |||
| ) |
Definition at line 663 of file HTTP2FramerTest.cpp.
References ASSERT_EQ, ASSERT_FALSE, ASSERT_TRUE, proxygen::HTTPCodec::ExAttributes::controlStream, proxygen::http2::END_HEADERS, proxygen::http2::END_STREAM, proxygen::http2::PriorityUpdate::exclusive, EXPECT_EQ, makeBuf(), folly::IOBuf::moveToFbString(), parse(), proxygen::http2::parseExHeaders(), proxygen::http2::PRIORITY, folly::Random::rand32(), proxygen::http2::PriorityUpdate::streamDependency, streamID, uint32_t, proxygen::HTTPCodec::ExAttributes::unidirectional, proxygen::http2::UNIDIRECTIONAL, proxygen::http2::PriorityUpdate::weight, and proxygen::http2::writeExHeaders().
| TEST_F | ( | HTTP2FramerTest | , |
| ExHeadersWithFlagsSet | |||
| ) |
Definition at line 691 of file HTTP2FramerTest.cpp.
References ASSERT_EQ, ASSERT_FALSE, ASSERT_TRUE, proxygen::HTTPCodec::ExAttributes::controlStream, proxygen::http2::END_HEADERS, proxygen::http2::END_STREAM, EXPECT_EQ, makeBuf(), folly::IOBuf::moveToFbString(), folly::none, parse(), proxygen::http2::parseExHeaders(), proxygen::http2::PRIORITY, folly::Random::rand32(), streamID, uint32_t, proxygen::HTTPCodec::ExAttributes::unidirectional, proxygen::http2::UNIDIRECTIONAL, and proxygen::http2::writeExHeaders().
| void writeFrameHeaderManual | ( | IOBufQueue & | queue, |
| uint32_t | length, | ||
| uint8_t | type, | ||
| uint8_t | flags, | ||
| uint32_t | stream | ||
| ) |
Definition at line 27 of file HTTP2FramerTest.cpp.
References proxygen::http2::kFrameHeaderSize, stream, type, uint32_t, uint8_t, and folly::io::detail::Writable< Derived >::writeBE().
Referenced by TEST_F().