proxygen
|
#include <folly/portability/GTest.h>
#include <proxygen/lib/http/HTTPHeaderSize.h>
#include <proxygen/lib/http/HTTPMessage.h>
#include <proxygen/lib/http/codec/SPDYCodec.h>
#include <proxygen/lib/http/codec/SPDYConstants.h>
#include <proxygen/lib/http/codec/SPDYVersionSettings.h>
#include <proxygen/lib/http/codec/test/HTTPParallelCodecTest.h>
#include <proxygen/lib/http/codec/test/TestUtils.h>
#include <proxygen/lib/http/codec/compress/Logging.h>
#include <random>
Go to the source code of this file.
Classes | |
class | SPDYCodecTestF |
Macros | |
#define | copyForMe(F, C, V) |
#define | permuteTest(f) |
Functions | |
size_t | parseSPDY (SPDYCodec *codec, const uint8_t *inputData, uint32_t length, int32_t atOnce, FakeHTTPCodecCallback &callbacks) |
TEST (SPDYCodecTest, SPDYVersionSettingsCommonHeaderNameCheck) | |
TEST (SPDYCodecTest, JunkSPDY) | |
TEST (SPDYCodecTest, LongPing) | |
TEST (SPDYCodecTest, BadType) | |
TEST (SPDYCodecTest, SynStreamBoundaries) | |
TEST (SPDYCodecTest, SetSettings) | |
TEST (SPDYCodecTest, FrameTooLarge) | |
TEST (SPDYCodecTest, FrameUncompressedTooLarge) | |
TEST (SPDYCodecTest, UnsupportedVersion) | |
TEST (SPDYCodecTest, UnsupportedFrameType) | |
template<typename Codec > | |
unique_ptr< folly::IOBuf > | getSynStream (Codec &egressCodec, uint32_t streamID, const HTTPMessage &msg, uint32_t assocStreamId=SPDYCodec::NoStream, bool eom=false, HTTPHeaderSize *size=nullptr) |
template<typename Codec > | |
unique_ptr< folly::IOBuf > | getSynStream (Codec &egressCodec, uint32_t streamID) |
template<typename Codec , typename F , typename V > | |
void | callFunction (F f, V version) |
unique_ptr< folly::IOBuf > | getVersionedSpdyFrame (const uint8_t *bytes, size_t len, uint8_t version) |
template<typename Codec1 , typename Codec2 > | |
void | maxTransactionHelper (Codec1 &ingressCodec, Codec2 &egressCodec, uint32_t parallel) |
template<typename Codec1 , typename Codec2 > | |
void | doDefaultMaxTransactionTest (Codec1 &ingressCodec, Codec2 &egressCodec) |
template<typename Codec1 , typename Codec2 > | |
void | doNonDefaultMaxTransactionTest (Codec1 &ingressCodec, Codec2 &egressCodec) |
TEST (SPDYCodecTest, DefaultMaxTransactions) | |
TEST (SPDYCodecTest, NonDefaultMaxTransactions) | |
template<typename Codec1 , typename Codec2 > | |
void | doEmptyHeaderValueTest (Codec1 &ingressCodec, Codec2 &egressCodec) |
TEST (SPDYCodecTest, EmptyHeaderValue) | |
TEST (SPDYCodecTest, SynStreamWrongVersion) | |
template<typename Codec1 , typename Codec2 > | |
void | doShortSynReplyTest (Codec1 &, Codec2 &egressCodec) |
TEST (SPDYCodecTest, ShortSynReply) | |
TEST (SPDYCodecTest, SupportsSessionFlowControl) | |
TEST (SPDYCodecTest, HeaderWithManyValues) | |
TEST (SPDYCodecTest, MultiplePaths) | |
TEST (SPDYCodecTest, LargeFrameEncoding) | |
TEST (SPDYCodecTest, InvalidSettings) | |
TEST (SPDYCodecTest, HeaderWithFin) | |
TEST (SPDYCodecTest, ServerPush) | |
TEST (SPDYCodecTest, ServerPushWithStatus) | |
TEST (SPDYCodecTest, ServerPushHostMissing) | |
TEST (SPDYCodecTest, ServerPushInvalidId) | |
TEST (SPDYCodecTest, ServerPushInvalidFlags) | |
TEST (SPDYCodecTest, ServerPushWithoutAssoc) | |
TEST (SPDYCodecTest, StatusReason) | |
TEST (SPDYCodecTest, UpstreamPing) | |
TEST (SPDYCodecTest, DownstreamPing) | |
TEST (SPDYCodecTest, DateHeader) | |
TEST (SPDYCodecTest, HeaderDoS) | |
TEST (SPDYCodecTest, DoubleGoawayServer) | |
TEST (SPDYCodecTest, DoubleGoawayClient) | |
TEST (SPDYCodecTest, SingleGoawayClient) | |
TEST (SPDYCodecTest, OddHeaderListTest) | |
TEST (SPDYCodecTest, SendRstParsingFrame) | |
TEST (SPDYCodecTest, BadNumNameValues) | |
TEST (SPDYCodecTest, ShortSettings) | |
TEST (SPDYCodecTest, SegmentedHeaderBlock) | |
TEST (SPDYCodecTest, ColonHeaders) | |
TEST (SPDYCodecTest, StreamIdOverflow) | |
TEST (SPDYCodecTest, BadNVBlock) | |
TEST_F (SPDYCodecTestF, GoawayHandling) | |
Variables | |
uint8_t | shortSynStream [] |
uint8_t | longPing [] |
uint8_t | badType [] |
uint8_t | synStream [] |
uint8_t | spdy3UnknownCtlFrame [] |
uint8_t | shortSynReply [] |
uint8_t | multiple_path_headers [] |
uint8_t | pushStreamWithHostMissing [] |
uint8_t | pushStreamWithOddId [] |
uint8_t | pushStreamWithoutUnidirectional [] |
uint8_t | pushStreamWithoutAssoc [] |
uint8_t | multiValuedHeaderAttack [] |
uint8_t | invalidHeaderPlusEmptyBlock [] |
uint8_t | invalidNumNameValuesBlock [] |
const uint8_t | kShortSettings [] |
const uint8_t | kColonHeaders [] |
const uint8_t | kBufBadNVBlock [] |
#define copyForMe | ( | F, | |
C, | |||
V | |||
) |
Definition at line 380 of file SPDYCodecTest.cpp.
#define permuteTest | ( | f | ) |
Definition at line 383 of file SPDYCodecTest.cpp.
Referenced by TEST().
void callFunction | ( | F | f, |
V | version | ||
) |
void doDefaultMaxTransactionTest | ( | Codec1 & | ingressCodec, |
Codec2 & | egressCodec | ||
) |
Definition at line 419 of file SPDYCodecTest.cpp.
References maxTransactionHelper().
Referenced by TEST().
void doEmptyHeaderValueTest | ( | Codec1 & | ingressCodec, |
Codec2 & | egressCodec | ||
) |
Definition at line 437 of file SPDYCodecTest.cpp.
References ASSERT_NE, wangle::HTTPHeaderSize::compressed, EXPECT_EQ, EXPECT_TRUE, proxygen::HTTPMessage::getHeaders(), getSynStream(), proxygen::HTTP_HEADER_HOST, proxygen::HTTP_HEADER_PRAGMA, i, proxygen::FakeHTTPCodecCallback::msg, proxygen::FakeHTTPCodecCallback::sessionErrors, proxygen::HTTPHeaders::set(), proxygen::HTTPMessage::setMethod(), proxygen::HTTPMessage::setURL(), folly::size(), proxygen::FakeHTTPCodecCallback::streamErrors, string, uint8_t, wangle::HTTPHeaderSize::uncompressed, and version.
Referenced by TEST().
void doNonDefaultMaxTransactionTest | ( | Codec1 & | ingressCodec, |
Codec2 & | egressCodec | ||
) |
Definition at line 424 of file SPDYCodecTest.cpp.
References maxTransactionHelper().
Referenced by TEST().
void doShortSynReplyTest | ( | Codec1 & | , |
Codec2 & | egressCodec | ||
) |
Definition at line 521 of file SPDYCodecTest.cpp.
References EXPECT_EQ, getVersionedSpdyFrame(), proxygen::FakeHTTPCodecCallback::sessionErrors, shortSynReply, and proxygen::FakeHTTPCodecCallback::streamErrors.
Referenced by TEST().
unique_ptr<folly::IOBuf> getSynStream | ( | Codec & | egressCodec, |
uint32_t | streamID, | ||
const HTTPMessage & | msg, | ||
uint32_t | assocStreamId = SPDYCodec::NoStream , |
||
bool | eom = false , |
||
HTTPHeaderSize * | size = nullptr |
||
) |
Definition at line 345 of file SPDYCodecTest.cpp.
References folly::IOBufQueue::cacheChainLength(), folly::IOBufQueue::move(), gmock_output_test::output, and folly::size().
Referenced by doEmptyHeaderValueTest(), getSynStream(), maxTransactionHelper(), and TEST().
unique_ptr<folly::IOBuf> getSynStream | ( | Codec & | egressCodec, |
uint32_t | streamID | ||
) |
Definition at line 363 of file SPDYCodecTest.cpp.
References proxygen::HTTPMessage::getHeaders(), getSynStream(), proxygen::HTTPHeaders::set(), proxygen::HTTPMessage::setMethod(), and proxygen::HTTPMessage::setURL().
unique_ptr<folly::IOBuf> getVersionedSpdyFrame | ( | const uint8_t * | bytes, |
size_t | len, | ||
uint8_t | version | ||
) |
Returns a SPDY frame with the specified version
Definition at line 389 of file SPDYCodecTest.cpp.
References folly::IOBuf::copyBuffer(), folly::data(), uint8_t, and version.
Referenced by doShortSynReplyTest(), and TEST().
void maxTransactionHelper | ( | Codec1 & | ingressCodec, |
Codec2 & | egressCodec, | ||
uint32_t | parallel | ||
) |
Definition at line 399 of file SPDYCodecTest.cpp.
References EXPECT_EQ, getSynStream(), i, proxygen::FakeHTTPCodecCallback::sessionErrors, proxygen::FakeHTTPCodecCallback::streamErrors, and uint16_t.
Referenced by doDefaultMaxTransactionTest(), and doNonDefaultMaxTransactionTest().
size_t parseSPDY | ( | SPDYCodec * | codec, |
const uint8_t * | inputData, | ||
uint32_t | length, | ||
int32_t | atOnce, | ||
FakeHTTPCodecCallback & | callbacks | ||
) |
Definition at line 26 of file SPDYCodecTest.cpp.
References proxygen::FakeHTTPCodecCallback::getStopFn(), parse(), and proxygen::HTTPParallelCodec::setCallback().
Referenced by TEST().
TEST | ( | SPDYCodecTest | , |
SPDYVersionSettingsCommonHeaderNameCheck | |||
) |
Definition at line 38 of file SPDYCodecTest.cpp.
References EXPECT_EQ, proxygen::HTTP_HEADER_COLON_METHOD, proxygen::HTTP_HEADER_COLON_PATH, proxygen::HTTP_HEADER_COLON_SCHEME, proxygen::HTTP_HEADER_COLON_STATUS, proxygen::HTTP_HEADER_OTHER, proxygen::spdy::kNameHostv3, proxygen::spdy::kNameMethodv3, proxygen::spdy::kNamePathv3, proxygen::spdy::kNameSchemev3, proxygen::spdy::kNameStatusv3, and proxygen::spdy::kNameVersionv3.
TEST | ( | SPDYCodecTest | , |
JunkSPDY | |||
) |
Definition at line 59 of file SPDYCodecTest.cpp.
References codec, EXPECT_EQ, parseSPDY(), proxygen::FakeHTTPCodecCallback::sessionErrors, shortSynStream, and proxygen::FakeHTTPCodecCallback::streamErrors.
TEST | ( | SPDYCodecTest | , |
LongPing | |||
) |
Definition at line 76 of file SPDYCodecTest.cpp.
References codec, EXPECT_EQ, longPing, parseSPDY(), proxygen::FakeHTTPCodecCallback::sessionErrors, and proxygen::FakeHTTPCodecCallback::streamErrors.
TEST | ( | SPDYCodecTest | , |
BadType | |||
) |
Definition at line 93 of file SPDYCodecTest.cpp.
References badType, codec, EXPECT_EQ, parseSPDY(), proxygen::FakeHTTPCodecCallback::sessionErrors, and proxygen::FakeHTTPCodecCallback::streamErrors.
TEST | ( | SPDYCodecTest | , |
SynStreamBoundaries | |||
) |
Definition at line 245 of file SPDYCodecTest.cpp.
References codec, EXPECT_EQ, proxygen::FakeHTTPCodecCallback::headersComplete, i, proxygen::FakeHTTPCodecCallback::messageBegin, proxygen::FakeHTTPCodecCallback::messageComplete, parseSPDY(), proxygen::FakeHTTPCodecCallback::sessionErrors, proxygen::FakeHTTPCodecCallback::streamErrors, and synStream.
TEST | ( | SPDYCodecTest | , |
SetSettings | |||
) |
Definition at line 260 of file SPDYCodecTest.cpp.
References codec, EXPECT_EQ, proxygen::SPDYCodec::getEgressSettings(), proxygen::HTTPSettings::getNumSettings(), proxygen::HTTPSettings::getSetting(), proxygen::http2::kInitialWindow, proxygen::spdy::kMaxConcurrentStreams, proxygen::HTTPSettings::setSetting(), settings, proxygen::HTTPSettings::unsetSetting(), and proxygen::HTTPSetting::value.
TEST | ( | SPDYCodecTest | , |
FrameTooLarge | |||
) |
Definition at line 291 of file SPDYCodecTest.cpp.
References codec, EXPECT_EQ, parseSPDY(), proxygen::FakeHTTPCodecCallback::sessionErrors, proxygen::SPDYCodec::setMaxFrameLength(), proxygen::FakeHTTPCodecCallback::streamErrors, and synStream.
TEST | ( | SPDYCodecTest | , |
FrameUncompressedTooLarge | |||
) |
Definition at line 302 of file SPDYCodecTest.cpp.
References codec, EXPECT_EQ, parseSPDY(), proxygen::FakeHTTPCodecCallback::sessionErrors, proxygen::SPDYCodec::setMaxUncompressedHeaders(), proxygen::FakeHTTPCodecCallback::streamErrors, and synStream.
TEST | ( | SPDYCodecTest | , |
UnsupportedVersion | |||
) |
Definition at line 319 of file SPDYCodecTest.cpp.
References codec, EXPECT_EQ, proxygen::FakeHTTPCodecCallback::lastParseError, parseSPDY(), proxygen::spdy::RST_PROTOCOL_ERROR, proxygen::spdy::rstToErrorCode(), proxygen::FakeHTTPCodecCallback::sessionErrors, shortSynStream, and proxygen::FakeHTTPCodecCallback::streamErrors.
TEST | ( | SPDYCodecTest | , |
UnsupportedFrameType | |||
) |
Definition at line 333 of file SPDYCodecTest.cpp.
References codec, EXPECT_EQ, parseSPDY(), proxygen::FakeHTTPCodecCallback::sessionErrors, spdy3UnknownCtlFrame, and proxygen::FakeHTTPCodecCallback::streamErrors.
TEST | ( | SPDYCodecTest | , |
DefaultMaxTransactions | |||
) |
Definition at line 428 of file SPDYCodecTest.cpp.
References doDefaultMaxTransactionTest(), and permuteTest.
TEST | ( | SPDYCodecTest | , |
NonDefaultMaxTransactions | |||
) |
Definition at line 432 of file SPDYCodecTest.cpp.
References doNonDefaultMaxTransactionTest(), and permuteTest.
TEST | ( | SPDYCodecTest | , |
EmptyHeaderValue | |||
) |
Definition at line 487 of file SPDYCodecTest.cpp.
References doEmptyHeaderValueTest(), and permuteTest.
TEST | ( | SPDYCodecTest | , |
SynStreamWrongVersion | |||
) |
Tests a syn stream request containing the wrong version. This frame is generated by using the v3 synStream firefox frame specified above and changing the version field to 2. The dictionary used for the zlib compression will be different and the session will be rejected.
Definition at line 497 of file SPDYCodecTest.cpp.
References codec, EXPECT_EQ, getVersionedSpdyFrame(), proxygen::FakeHTTPCodecCallback::lastParseError, parseSPDY(), proxygen::spdy::RST_PROTOCOL_ERROR, proxygen::spdy::rstToErrorCode(), proxygen::FakeHTTPCodecCallback::sessionErrors, proxygen::FakeHTTPCodecCallback::streamErrors, and synStream.
TEST | ( | SPDYCodecTest | , |
ShortSynReply | |||
) |
Definition at line 531 of file SPDYCodecTest.cpp.
References doShortSynReplyTest(), and permuteTest.
TEST | ( | SPDYCodecTest | , |
SupportsSessionFlowControl | |||
) |
Definition at line 535 of file SPDYCodecTest.cpp.
References EXPECT_FALSE, EXPECT_TRUE, and proxygen::SPDYCodec::supportsSessionFlowControl().
TEST | ( | SPDYCodecTest | , |
HeaderWithManyValues | |||
) |
Definition at line 545 of file SPDYCodecTest.cpp.
References proxygen::HTTPHeaders::add(), EXPECT_EQ, proxygen::HTTPMessage::getHeaders(), getSynStream(), proxygen::FakeHTTPCodecCallback::headersComplete, i, proxygen::FakeHTTPCodecCallback::messageBegin, proxygen::FakeHTTPCodecCallback::messageComplete, proxygen::FakeHTTPCodecCallback::msg, proxygen::SPDYCodec::onIngress(), proxygen::FakeHTTPCodecCallback::sessionErrors, proxygen::HTTPHeaders::set(), proxygen::HTTPParallelCodec::setCallback(), proxygen::HTTPMessage::setMethod(), proxygen::HTTPMessage::setURL(), proxygen::FakeHTTPCodecCallback::streamErrors, and string.
TEST | ( | SPDYCodecTest | , |
MultiplePaths | |||
) |
Definition at line 604 of file SPDYCodecTest.cpp.
References EXPECT_EQ, proxygen::SPDYCodec::getVersion(), getVersionedSpdyFrame(), multiple_path_headers, proxygen::SPDYCodec::onIngress(), proxygen::FakeHTTPCodecCallback::sessionErrors, proxygen::HTTPParallelCodec::setCallback(), and proxygen::FakeHTTPCodecCallback::streamErrors.
TEST | ( | SPDYCodecTest | , |
LargeFrameEncoding | |||
) |
Definition at line 615 of file SPDYCodecTest.cpp.
References codec, proxygen::getGetRequest(), getSynStream(), i, proxygen::SPDYCodec::setMaxUncompressedHeaders(), and string.
TEST | ( | SPDYCodecTest | , |
InvalidSettings | |||
) |
Definition at line 632 of file SPDYCodecTest.cpp.
References folly::IOBufQueue::cacheChainLength(), EXPECT_EQ, proxygen::SPDYCodec::generateSettings(), proxygen::SPDYCodec::getEgressSettings(), proxygen::FakeHTTPCodecCallback::headersComplete, max, proxygen::FakeHTTPCodecCallback::messageBegin, proxygen::FakeHTTPCodecCallback::messageComplete, folly::IOBufQueue::move(), proxygen::SPDYCodec::onIngress(), gmock_output_test::output, proxygen::FakeHTTPCodecCallback::sessionErrors, proxygen::HTTPParallelCodec::setCallback(), proxygen::HTTPSettings::setSetting(), proxygen::FakeHTTPCodecCallback::streamErrors, and uint32_t.
TEST | ( | SPDYCodecTest | , |
HeaderWithFin | |||
) |
Definition at line 655 of file SPDYCodecTest.cpp.
References proxygen::FakeHTTPCodecCallback::assocStreamId, EXPECT_EQ, proxygen::HTTPMessage::getHeaders(), getSynStream(), proxygen::FakeHTTPCodecCallback::headersComplete, proxygen::FakeHTTPCodecCallback::messageBegin, proxygen::FakeHTTPCodecCallback::messageComplete, proxygen::SPDYCodec::onIngress(), proxygen::FakeHTTPCodecCallback::sessionErrors, proxygen::HTTPHeaders::set(), proxygen::HTTPParallelCodec::setCallback(), proxygen::HTTPMessage::setMethod(), proxygen::HTTPMessage::setURL(), and proxygen::FakeHTTPCodecCallback::streamErrors.
TEST | ( | SPDYCodecTest | , |
ServerPush | |||
) |
Definition at line 677 of file SPDYCodecTest.cpp.
References proxygen::FakeHTTPCodecCallback::assocStreamId, EXPECT_EQ, proxygen::HTTPMessage::getHeaders(), getSynStream(), proxygen::FakeHTTPCodecCallback::headersComplete, proxygen::FakeHTTPCodecCallback::messageBegin, proxygen::FakeHTTPCodecCallback::messageComplete, proxygen::SPDYCodec::onIngress(), proxygen::FakeHTTPCodecCallback::sessionErrors, proxygen::HTTPHeaders::set(), proxygen::HTTPParallelCodec::setCallback(), proxygen::HTTPMessage::setURL(), and proxygen::FakeHTTPCodecCallback::streamErrors.
TEST | ( | SPDYCodecTest | , |
ServerPushWithStatus | |||
) |
Definition at line 698 of file SPDYCodecTest.cpp.
References proxygen::FakeHTTPCodecCallback::assocStreamId, EXPECT_EQ, proxygen::HTTPMessage::getHeaders(), getSynStream(), proxygen::FakeHTTPCodecCallback::headersComplete, proxygen::FakeHTTPCodecCallback::messageBegin, proxygen::FakeHTTPCodecCallback::messageComplete, proxygen::FakeHTTPCodecCallback::msg, proxygen::SPDYCodec::onIngress(), proxygen::FakeHTTPCodecCallback::sessionErrors, proxygen::HTTPHeaders::set(), proxygen::HTTPParallelCodec::setCallback(), proxygen::HTTPMessage::setPushStatusCode(), proxygen::HTTPMessage::setURL(), and proxygen::FakeHTTPCodecCallback::streamErrors.
TEST | ( | SPDYCodecTest | , |
ServerPushHostMissing | |||
) |
Definition at line 744 of file SPDYCodecTest.cpp.
References proxygen::FakeHTTPCodecCallback::assocStreamId, folly::IOBuf::copyBuffer(), EXPECT_EQ, proxygen::FakeHTTPCodecCallback::headersComplete, proxygen::FakeHTTPCodecCallback::messageBegin, proxygen::FakeHTTPCodecCallback::messageComplete, proxygen::SPDYCodec::onIngress(), pushStreamWithHostMissing, proxygen::FakeHTTPCodecCallback::sessionErrors, proxygen::HTTPParallelCodec::setCallback(), and proxygen::FakeHTTPCodecCallback::streamErrors.
TEST | ( | SPDYCodecTest | , |
ServerPushInvalidId | |||
) |
Definition at line 787 of file SPDYCodecTest.cpp.
References proxygen::FakeHTTPCodecCallback::assocStreamId, folly::IOBuf::copyBuffer(), EXPECT_EQ, proxygen::FakeHTTPCodecCallback::headersComplete, proxygen::FakeHTTPCodecCallback::messageBegin, proxygen::FakeHTTPCodecCallback::messageComplete, proxygen::SPDYCodec::onIngress(), pushStreamWithOddId, proxygen::FakeHTTPCodecCallback::sessionErrors, proxygen::HTTPParallelCodec::setCallback(), and proxygen::FakeHTTPCodecCallback::streamErrors.
TEST | ( | SPDYCodecTest | , |
ServerPushInvalidFlags | |||
) |
Definition at line 830 of file SPDYCodecTest.cpp.
References proxygen::FakeHTTPCodecCallback::assocStreamId, folly::IOBuf::copyBuffer(), EXPECT_EQ, proxygen::FakeHTTPCodecCallback::headersComplete, proxygen::FakeHTTPCodecCallback::messageBegin, proxygen::FakeHTTPCodecCallback::messageComplete, proxygen::SPDYCodec::onIngress(), pushStreamWithoutUnidirectional, proxygen::FakeHTTPCodecCallback::sessionErrors, proxygen::HTTPParallelCodec::setCallback(), and proxygen::FakeHTTPCodecCallback::streamErrors.
TEST | ( | SPDYCodecTest | , |
ServerPushWithoutAssoc | |||
) |
Definition at line 873 of file SPDYCodecTest.cpp.
References proxygen::FakeHTTPCodecCallback::assocStreamId, folly::IOBuf::copyBuffer(), EXPECT_EQ, proxygen::FakeHTTPCodecCallback::headersComplete, proxygen::FakeHTTPCodecCallback::messageBegin, proxygen::FakeHTTPCodecCallback::messageComplete, proxygen::SPDYCodec::onIngress(), pushStreamWithoutAssoc, proxygen::FakeHTTPCodecCallback::sessionErrors, proxygen::HTTPParallelCodec::setCallback(), and proxygen::FakeHTTPCodecCallback::streamErrors.
TEST | ( | SPDYCodecTest | , |
StatusReason | |||
) |
Definition at line 890 of file SPDYCodecTest.cpp.
References EXPECT_EQ, EXPECT_TRUE, getSynStream(), proxygen::FakeHTTPCodecCallback::headersComplete, proxygen::FakeHTTPCodecCallback::lastParseError, proxygen::FakeHTTPCodecCallback::messageBegin, proxygen::FakeHTTPCodecCallback::messageComplete, proxygen::FakeHTTPCodecCallback::msg, proxygen::SPDYCodec::onIngress(), proxygen::FakeHTTPCodecCallback::reset(), proxygen::spdy::RST_PROTOCOL_ERROR, proxygen::spdy::rstToErrorCode(), proxygen::FakeHTTPCodecCallback::sessionErrors, proxygen::HTTPParallelCodec::setCallback(), proxygen::HTTPMessage::setStatusCode(), proxygen::HTTPMessage::setStatusMessage(), and proxygen::FakeHTTPCodecCallback::streamErrors.
TEST | ( | SPDYCodecTest | , |
UpstreamPing | |||
) |
Definition at line 954 of file SPDYCodecTest.cpp.
References ASSERT_EQ, ASSERT_GT, folly::IOBufQueue::cacheChainLength(), proxygen::SPDYCodec::generatePingReply(), proxygen::SPDYCodec::generatePingRequest(), i, folly::IOBufQueue::move(), proxygen::SPDYCodec::onIngress(), proxygen::FakeHTTPCodecCallback::recvPingReply, proxygen::FakeHTTPCodecCallback::recvPingRequest, and proxygen::HTTPParallelCodec::setCallback().
TEST | ( | SPDYCodecTest | , |
DownstreamPing | |||
) |
Definition at line 980 of file SPDYCodecTest.cpp.
References ASSERT_EQ, ASSERT_GT, folly::IOBufQueue::cacheChainLength(), proxygen::SPDYCodec::generatePingReply(), proxygen::SPDYCodec::generatePingRequest(), i, folly::IOBufQueue::move(), proxygen::SPDYCodec::onIngress(), proxygen::FakeHTTPCodecCallback::recvPingReply, proxygen::FakeHTTPCodecCallback::recvPingRequest, and proxygen::HTTPParallelCodec::setCallback().
TEST | ( | SPDYCodecTest | , |
DateHeader | |||
) |
Definition at line 1006 of file SPDYCodecTest.cpp.
References EXPECT_EQ, EXPECT_TRUE, getSynStream(), proxygen::FakeHTTPCodecCallback::headersComplete, proxygen::HTTP_HEADER_DATE, proxygen::FakeHTTPCodecCallback::messageBegin, proxygen::FakeHTTPCodecCallback::messageComplete, proxygen::FakeHTTPCodecCallback::msg, proxygen::SPDYCodec::onIngress(), proxygen::FakeHTTPCodecCallback::sessionErrors, proxygen::HTTPParallelCodec::setCallback(), proxygen::HTTPMessage::setStatusCode(), and proxygen::FakeHTTPCodecCallback::streamErrors.
TEST | ( | SPDYCodecTest | , |
HeaderDoS | |||
) |
Definition at line 1100 of file SPDYCodecTest.cpp.
References folly::IOBuf::copyBuffer(), EXPECT_EQ, proxygen::FakeHTTPCodecCallback::headersComplete, proxygen::FakeHTTPCodecCallback::messageBegin, proxygen::FakeHTTPCodecCallback::messageComplete, multiValuedHeaderAttack, proxygen::SPDYCodec::onIngress(), proxygen::FakeHTTPCodecCallback::sessionErrors, proxygen::HTTPParallelCodec::setCallback(), and proxygen::FakeHTTPCodecCallback::streamErrors.
TEST | ( | SPDYCodecTest | , |
DoubleGoawayServer | |||
) |
Definition at line 1119 of file SPDYCodecTest.cpp.
References folly::IOBufQueue::cacheChainLength(), proxygen::HTTPParallelCodec::enableDoubleGoawayDrain(), EXPECT_EQ, EXPECT_FALSE, EXPECT_TRUE, f, proxygen::SPDYCodec::generateGoaway(), proxygen::FakeHTTPCodecCallback::goaways, proxygen::HTTPParallelCodec::isReusable(), proxygen::HTTPParallelCodec::isWaitingToDrain(), max, folly::IOBufQueue::move(), proxygen::SPDYCodec::onIngress(), gmock_output_test::output, and proxygen::HTTPParallelCodec::setCallback().
TEST | ( | SPDYCodecTest | , |
DoubleGoawayClient | |||
) |
Definition at line 1153 of file SPDYCodecTest.cpp.
References folly::IOBufQueue::cacheChainLength(), proxygen::HTTPParallelCodec::enableDoubleGoawayDrain(), EXPECT_EQ, EXPECT_FALSE, EXPECT_TRUE, f, proxygen::SPDYCodec::generateGoaway(), proxygen::FakeHTTPCodecCallback::goaways, proxygen::HTTPParallelCodec::isReusable(), proxygen::HTTPParallelCodec::isWaitingToDrain(), max, folly::IOBufQueue::move(), proxygen::SPDYCodec::onIngress(), gmock_output_test::output, and proxygen::HTTPParallelCodec::setCallback().
TEST | ( | SPDYCodecTest | , |
SingleGoawayClient | |||
) |
Definition at line 1189 of file SPDYCodecTest.cpp.
References folly::IOBufQueue::cacheChainLength(), EXPECT_EQ, EXPECT_FALSE, EXPECT_TRUE, f, proxygen::SPDYCodec::generateGoaway(), proxygen::FakeHTTPCodecCallback::goaways, proxygen::HTTPParallelCodec::isReusable(), proxygen::HTTPParallelCodec::isWaitingToDrain(), folly::IOBufQueue::move(), proxygen::SPDYCodec::onIngress(), gmock_output_test::output, and proxygen::HTTPParallelCodec::setCallback().
TEST | ( | SPDYCodecTest | , |
OddHeaderListTest | |||
) |
Definition at line 1235 of file SPDYCodecTest.cpp.
References folly::IOBuf::copyBuffer(), EXPECT_EQ, proxygen::FakeHTTPCodecCallback::headersComplete, invalidHeaderPlusEmptyBlock, proxygen::FakeHTTPCodecCallback::messageBegin, proxygen::SPDYCodec::onIngress(), proxygen::HTTPParallelCodec::setCallback(), and proxygen::FakeHTTPCodecCallback::streamErrors.
TEST | ( | SPDYCodecTest | , |
SendRstParsingFrame | |||
) |
Definition at line 1252 of file SPDYCodecTest.cpp.
References testing::_, folly::IOBufQueue::append(), folly::IOBufQueue::cacheChainLength(), EXPECT_CALL, proxygen::SPDYCodec::generateEOM(), proxygen::SPDYCodec::generateRstStream(), getSynStream(), testing::InvokeWithoutArgs(), folly::IOBufQueue::move(), folly::gen::move, proxygen::SPDYCodec::onIngress(), and proxygen::HTTPParallelCodec::setCallback().
TEST | ( | SPDYCodecTest | , |
BadNumNameValues | |||
) |
Definition at line 1303 of file SPDYCodecTest.cpp.
References folly::IOBuf::copyBuffer(), EXPECT_EQ, proxygen::FakeHTTPCodecCallback::headersComplete, invalidNumNameValuesBlock, proxygen::FakeHTTPCodecCallback::messageBegin, proxygen::SPDYCodec::onIngress(), proxygen::FakeHTTPCodecCallback::sessionErrors, proxygen::HTTPParallelCodec::setCallback(), and proxygen::FakeHTTPCodecCallback::streamErrors.
TEST | ( | SPDYCodecTest | , |
ShortSettings | |||
) |
Definition at line 1323 of file SPDYCodecTest.cpp.
References folly::IOBuf::copyBuffer(), EXPECT_EQ, proxygen::FakeHTTPCodecCallback::headersComplete, kShortSettings, proxygen::FakeHTTPCodecCallback::messageBegin, proxygen::SPDYCodec::onIngress(), proxygen::FakeHTTPCodecCallback::sessionErrors, proxygen::HTTPParallelCodec::setCallback(), and proxygen::FakeHTTPCodecCallback::streamErrors.
TEST | ( | SPDYCodecTest | , |
SegmentedHeaderBlock | |||
) |
Definition at line 1339 of file SPDYCodecTest.cpp.
References ch, EXPECT_EQ, proxygen::HTTPMessage::getHeaders(), getSynStream(), proxygen::FakeHTTPCodecCallback::headersComplete, huge, i, proxygen::FakeHTTPCodecCallback::msg, proxygen::SPDYCodec::onIngress(), proxygen::FakeHTTPCodecCallback::reset(), proxygen::FakeHTTPCodecCallback::sessionErrors, proxygen::HTTPHeaders::set(), proxygen::HTTPParallelCodec::setCallback(), proxygen::HTTPMessage::setMethod(), proxygen::HTTPMessage::setStatusCode(), proxygen::HTTPMessage::setURL(), folly::size(), proxygen::FakeHTTPCodecCallback::streamErrors, and uint32_t.
TEST | ( | SPDYCodecTest | , |
ColonHeaders | |||
) |
Definition at line 1397 of file SPDYCodecTest.cpp.
References folly::IOBuf::copyBuffer(), EXPECT_EQ, proxygen::FakeHTTPCodecCallback::headersComplete, kColonHeaders, proxygen::SPDYCodec::onIngress(), proxygen::FakeHTTPCodecCallback::sessionErrors, proxygen::HTTPParallelCodec::setCallback(), and proxygen::FakeHTTPCodecCallback::streamErrors.
TEST | ( | SPDYCodecTest | , |
StreamIdOverflow | |||
) |
Definition at line 1412 of file SPDYCodecTest.cpp.
References codec, proxygen::HTTPParallelCodec::createStream(), EXPECT_EQ, proxygen::HTTPParallelCodec::isReusable(), max, and proxygen::HTTPParallelCodec::setNextEgressStreamId().
TEST | ( | SPDYCodecTest | , |
BadNVBlock | |||
) |
Test case where nv item length is greater than total frame length
Definition at line 1435 of file SPDYCodecTest.cpp.
References folly::IOBuf::copyBuffer(), EXPECT_EQ, proxygen::FakeHTTPCodecCallback::headersComplete, kBufBadNVBlock, proxygen::SPDYCodec::onIngress(), proxygen::FakeHTTPCodecCallback::sessionErrors, proxygen::HTTPParallelCodec::setCallback(), and proxygen::FakeHTTPCodecCallback::streamErrors.
TEST_F | ( | SPDYCodecTestF | , |
GoawayHandling | |||
) |
Definition at line 1460 of file SPDYCodecTest.cpp.
References proxygen::HTTPHeaders::add(), folly::IOBufQueue::cacheChainLength(), wangle::HTTPHeaderSize::compressed, dummy(), EXPECT_EQ, EXPECT_GT, proxygen::getGetRequest(), proxygen::HTTPMessage::getHeaders(), makeBuf(), parse(), proxygen::HTTPMessage::setPushStatusCode(), proxygen::HTTPMessage::setStatusCode(), folly::size(), and wangle::HTTPHeaderSize::uncompressed.
uint8_t badType[] |
Definition at line 86 of file SPDYCodecTest.cpp.
Referenced by TEST().
uint8_t invalidHeaderPlusEmptyBlock[] |
Definition at line 1222 of file SPDYCodecTest.cpp.
Referenced by TEST().
uint8_t invalidNumNameValuesBlock[] |
Definition at line 1279 of file SPDYCodecTest.cpp.
Referenced by TEST().
const uint8_t kBufBadNVBlock[] |
Definition at line 1424 of file SPDYCodecTest.cpp.
Referenced by TEST().
const uint8_t kColonHeaders[] |
Definition at line 1390 of file SPDYCodecTest.cpp.
Referenced by TEST().
const uint8_t kShortSettings[] |
Definition at line 1319 of file SPDYCodecTest.cpp.
Referenced by TEST().
uint8_t longPing[] |
Definition at line 69 of file SPDYCodecTest.cpp.
Referenced by TEST().
uint8_t multiple_path_headers[] |
Definition at line 576 of file SPDYCodecTest.cpp.
Referenced by TEST().
uint8_t multiValuedHeaderAttack[] |
Definition at line 1027 of file SPDYCodecTest.cpp.
Referenced by TEST().
uint8_t pushStreamWithHostMissing[] |
A push stream with Host header missing
Definition at line 724 of file SPDYCodecTest.cpp.
Referenced by TEST().
uint8_t pushStreamWithOddId[] |
A push stream with an odd StreamID
Definition at line 764 of file SPDYCodecTest.cpp.
Referenced by TEST().
uint8_t pushStreamWithoutAssoc[] |
A push stream with assocStreamID = SPDYCodec::NoStream
Definition at line 850 of file SPDYCodecTest.cpp.
Referenced by TEST().
uint8_t pushStreamWithoutUnidirectional[] |
A push stream without unidirectional flag
Definition at line 807 of file SPDYCodecTest.cpp.
Referenced by TEST().
uint8_t shortSynReply[] |
A syn reply frame with invalid length
Definition at line 515 of file SPDYCodecTest.cpp.
Referenced by doShortSynReplyTest().
uint8_t shortSynStream[] |
Definition at line 32 of file SPDYCodecTest.cpp.
Referenced by TEST().
uint8_t spdy3UnknownCtlFrame[] |
Definition at line 313 of file SPDYCodecTest.cpp.
Referenced by TEST().
uint8_t synStream[] |
A request from firefox for facebook.com
Definition at line 108 of file SPDYCodecTest.cpp.
Referenced by TEST().