proxygen
|
#include <fcntl.h>
#include <folly/portability/GTest.h>
#include <proxygen/lib/http/HTTPMessage.h>
#include <proxygen/lib/utils/TestUtils.h>
#include <signal.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
Go to the source code of this file.
Functions | |
TEST (HTTPMessage, TestParseCookiesSimple) | |
TEST (HTTPMessage, TestParseCookiesSpaces) | |
TEST (HTTPMessage, TestParseCookiesSingleCookie) | |
TEST (HTTPMessage, TestParseCookiesMultipleCookies) | |
TEST (HTTPMessage, TestParseQueryParamsSimple) | |
TEST (HTTPMessage, TestParseQueryParamsComplex) | |
TEST (HTTPMessage, TestHeaderPreservation) | |
TEST (HTTPMessage, TestHeaderRemove) | |
TEST (HTTPMessage, TestSetHeader) | |
TEST (HTTPMessage, TestCombine) | |
TEST (HTTPMessage, TestProxification) | |
TEST (HTTPMessage, TestKeepaliveCheck) | |
TEST (HTTPMessage, TestHeaderStripPerHop) | |
TEST (HTTPMessage, TestEmptyName) | |
TEST (HTTPMessage, TestMethod) | |
void | testPathAndQuery (const string &url, const string &expectedPath, const string &expectedQuery) |
TEST (GetPathAndQuery, ParseURL) | |
TEST (HTTPHeaders, AddStringPiece) | |
TEST (HTTPHeaders, InitializerList) | |
TEST (HTTPHeaders, InitializerListStringPiece) | |
void | testRemoveQueryParam (const string &url, const string &queryParam, const string &expectedUrl, const string &expectedQuery) |
TEST (HTTPMessage, RemoveQueryParamTests) | |
void | testSetQueryParam (const string &url, const string &queryParam, const string ¶mValue, const string &expectedUrl, const string &expectedQuery) |
TEST (HTTPMessage, SetQueryParamTests) | |
TEST (HTTPMessage, TestCheckForHeaderToken) | |
TEST (HttpMessage, TestProtocolStringHTTPVersion) | |
TEST (HttpMessage, TestProtocolStringAdvancedProtocol) | |
TEST | ( | HTTPMessage | , |
TestParseCookiesSimple | |||
) |
Definition at line 22 of file HTTPMessageTest.cpp.
References proxygen::HTTPHeaders::add(), EXPECT_EQ, proxygen::HTTPMessage::getCookie(), and proxygen::HTTPMessage::getHeaders().
TEST | ( | HTTPMessage | , |
TestParseCookiesSpaces | |||
) |
Definition at line 31 of file HTTPMessageTest.cpp.
References proxygen::HTTPHeaders::add(), EXPECT_EQ, proxygen::HTTPMessage::getCookie(), and proxygen::HTTPMessage::getHeaders().
TEST | ( | HTTPMessage | , |
TestParseCookiesSingleCookie | |||
) |
Definition at line 39 of file HTTPMessageTest.cpp.
References proxygen::HTTPHeaders::add(), EXPECT_EQ, proxygen::HTTPMessage::getCookie(), and proxygen::HTTPMessage::getHeaders().
TEST | ( | HTTPMessage | , |
TestParseCookiesMultipleCookies | |||
) |
Definition at line 46 of file HTTPMessageTest.cpp.
References proxygen::HTTPHeaders::add(), EXPECT_EQ, proxygen::HTTPMessage::getCookie(), and proxygen::HTTPMessage::getHeaders().
TEST | ( | HTTPMessage | , |
TestParseQueryParamsSimple | |||
) |
Definition at line 61 of file HTTPMessageTest.cpp.
References EXPECT_ANY_THROW, EXPECT_EQ, proxygen::HTTPMessage::getDecodedQueryParam(), proxygen::HTTPMessage::getIntQueryParam(), proxygen::HTTPMessage::getQueryParam(), proxygen::HTTPMessage::hasQueryParam(), and proxygen::HTTPMessage::setURL().
TEST | ( | HTTPMessage | , |
TestParseQueryParamsComplex | |||
) |
Definition at line 82 of file HTTPMessageTest.cpp.
References folly::empty(), EXPECT_EQ, folly::gen::first, proxygen::HTTPMessage::getQueryParam(), i, proxygen::HTTPMessage::setURL(), string, folly::gen::sub(), and val.
TEST | ( | HTTPMessage | , |
TestHeaderPreservation | |||
) |
Definition at line 128 of file HTTPMessageTest.cpp.
References proxygen::HTTPHeaders::add(), EXPECT_EQ, proxygen::HTTPMessage::getHeaders(), proxygen::HTTPHeaders::getNumberOfValues(), and proxygen::HTTPHeaders::size().
TEST | ( | HTTPMessage | , |
TestHeaderRemove | |||
) |
Definition at line 142 of file HTTPMessageTest.cpp.
References proxygen::HTTPHeaders::add(), EXPECT_EQ, proxygen::HTTPMessage::getHeaders(), proxygen::HTTPHeaders::getNumberOfValues(), proxygen::HTTPHeaders::remove(), and proxygen::HTTPHeaders::size().
TEST | ( | HTTPMessage | , |
TestSetHeader | |||
) |
Definition at line 156 of file HTTPMessageTest.cpp.
References proxygen::HTTPHeaders::add(), EXPECT_EQ, proxygen::HTTPMessage::getHeaders(), proxygen::HTTPHeaders::getNumberOfValues(), proxygen::HTTPHeaders::set(), and proxygen::HTTPHeaders::size().
TEST | ( | HTTPMessage | , |
TestCombine | |||
) |
Definition at line 175 of file HTTPMessageTest.cpp.
References proxygen::HTTPHeaders::add(), proxygen::HTTPHeaders::combine(), EXPECT_EQ, and proxygen::HTTPMessage::getHeaders().
TEST | ( | HTTPMessage | , |
TestProxification | |||
) |
Definition at line 193 of file HTTPMessageTest.cpp.
References proxygen::HTTPMessage::ensureHostHeader(), EXPECT_EQ, EXPECT_FALSE, proxygen::HTTPMessage::getHeaders(), proxygen::HTTPHeaders::getSingleOrEmpty(), proxygen::HTTP_HEADER_HOST, proxygen::HTTPMessage::setDstAddress(), proxygen::HTTPMessage::setLocalIp(), proxygen::HTTPMessage::setWantsKeepalive(), and proxygen::HTTPMessage::wantsKeepalive().
TEST | ( | HTTPMessage | , |
TestKeepaliveCheck | |||
) |
Definition at line 208 of file HTTPMessageTest.cpp.
References proxygen::HTTPHeaders::add(), proxygen::HTTPMessage::computeKeepalive(), EXPECT_FALSE, EXPECT_TRUE, proxygen::HTTPMessage::getHeaders(), proxygen::HTTP_HEADER_CONNECTION, proxygen::HTTPMessage::setHTTPVersion(), and proxygen::HTTPMessage::stripPerHopHeaders().
TEST | ( | HTTPMessage | , |
TestHeaderStripPerHop | |||
) |
Definition at line 312 of file HTTPMessageTest.cpp.
References proxygen::HTTPHeaders::add(), EXPECT_EQ, proxygen::HTTPMessage::getHeaders(), proxygen::HTTPMessage::getStrippedPerHopHeaders(), proxygen::HTTP_HEADER_CONNECTION, proxygen::HTTPHeaders::size(), and proxygen::HTTPMessage::stripPerHopHeaders().
TEST | ( | HTTPMessage | , |
TestEmptyName | |||
) |
Definition at line 338 of file HTTPMessageTest.cpp.
References EXPECT_DEATH_NO_CORE, proxygen::HTTPMessage::getHeaders(), and proxygen::HTTPHeaders::set().
TEST | ( | HTTPMessage | , |
TestMethod | |||
) |
Definition at line 343 of file HTTPMessageTest.cpp.
References proxygen::CONNECT, EXPECT_EQ, proxygen::GET, proxygen::HTTPMessage::getMethod(), proxygen::HTTPMessage::getMethodString(), folly::none, and proxygen::HTTPMessage::setMethod().
TEST | ( | GetPathAndQuery | , |
ParseURL | |||
) |
Definition at line 370 of file HTTPMessageTest.cpp.
References testPathAndQuery().
TEST | ( | HTTPHeaders | , |
AddStringPiece | |||
) |
Definition at line 378 of file HTTPMessageTest.cpp.
References proxygen::HTTPHeaders::add(), EXPECT_EQ, proxygen::HTTPHeaders::getSingleOrEmpty(), name, and folly::Range< Iter >::split_step().
TEST | ( | HTTPHeaders | , |
InitializerList | |||
) |
Definition at line 388 of file HTTPMessageTest.cpp.
References proxygen::HTTPHeaders::add(), proxygen::HTTPHeaders::combine(), EXPECT_EQ, proxygen::HTTPHeaders::getSingleOrEmpty(), proxygen::HTTP_HEADER_CONNECTION, and proxygen::HTTP_HEADER_SERVER.
TEST | ( | HTTPHeaders | , |
InitializerListStringPiece | |||
) |
Definition at line 402 of file HTTPMessageTest.cpp.
References proxygen::HTTPHeaders::add(), EXPECT_EQ, proxygen::HTTPHeaders::getSingleOrEmpty(), proxygen::HTTP_HEADER_CONNECTION, name, and folly::Range< Iter >::split_step().
TEST | ( | HTTPMessage | , |
RemoveQueryParamTests | |||
) |
Definition at line 427 of file HTTPMessageTest.cpp.
References testRemoveQueryParam().
TEST | ( | HTTPMessage | , |
SetQueryParamTests | |||
) |
Definition at line 464 of file HTTPMessageTest.cpp.
References testSetQueryParam().
TEST | ( | HTTPMessage | , |
TestCheckForHeaderToken | |||
) |
Definition at line 491 of file HTTPMessageTest.cpp.
References proxygen::HTTPHeaders::add(), proxygen::HTTPMessage::checkForHeaderToken(), EXPECT_FALSE, EXPECT_TRUE, proxygen::HTTPMessage::getHeaders(), and proxygen::HTTP_HEADER_CONNECTION.
TEST | ( | HttpMessage | , |
TestProtocolStringHTTPVersion | |||
) |
Definition at line 502 of file HTTPMessageTest.cpp.
References EXPECT_EQ, proxygen::HTTPMessage::getProtocolString(), and proxygen::HTTPMessage::setHTTPVersion().
TEST | ( | HttpMessage | , |
TestProtocolStringAdvancedProtocol | |||
) |
Definition at line 509 of file HTTPMessageTest.cpp.
References EXPECT_EQ, proxygen::HTTPMessage::getProtocolString(), proxygen::HTTPMessage::setAdvancedProtocolString(), and string.
void testPathAndQuery | ( | const string & | url, |
const string & | expectedPath, | ||
const string & | expectedQuery | ||
) |
Definition at line 359 of file HTTPMessageTest.cpp.
References EXPECT_EQ, proxygen::HTTPMessage::getPath(), proxygen::HTTPMessage::getQueryString(), proxygen::HTTPMessage::getURL(), and proxygen::HTTPMessage::setURL().
Referenced by TEST().
void testRemoveQueryParam | ( | const string & | url, |
const string & | queryParam, | ||
const string & | expectedUrl, | ||
const string & | expectedQuery | ||
) |
Definition at line 414 of file HTTPMessageTest.cpp.
References EXPECT_EQ, proxygen::HTTPMessage::getQueryString(), proxygen::HTTPMessage::getURL(), proxygen::HTTPMessage::removeQueryParam(), and proxygen::HTTPMessage::setURL().
Referenced by TEST().
void testSetQueryParam | ( | const string & | url, |
const string & | queryParam, | ||
const string & | paramValue, | ||
const string & | expectedUrl, | ||
const string & | expectedQuery | ||
) |
Definition at line 450 of file HTTPMessageTest.cpp.
References EXPECT_EQ, proxygen::HTTPMessage::getQueryString(), proxygen::HTTPMessage::getURL(), proxygen::HTTPMessage::setQueryParam(), and proxygen::HTTPMessage::setURL().
Referenced by TEST().