proxygen
proxygen::MockHTTPCodec Class Reference

#include <MockHTTPCodec.h>

Inheritance diagram for proxygen::MockHTTPCodec:
proxygen::HTTPCodec

Public Member Functions

 MOCK_CONST_METHOD0 (getProtocol, CodecProtocol())
 
 MOCK_CONST_METHOD0 (getUserAgent, const std::string &())
 
 MOCK_CONST_METHOD0 (getTransportDirection, TransportDirection())
 
 MOCK_CONST_METHOD0 (supportsStreamFlowControl, bool())
 
 MOCK_CONST_METHOD0 (supportsSessionFlowControl, bool())
 
 MOCK_METHOD0 (createStream, HTTPCodec::StreamID())
 
 MOCK_METHOD1 (setCallback, void(Callback *))
 
 MOCK_CONST_METHOD0 (isBusy, bool())
 
 MOCK_CONST_METHOD0 (hasPartialTransaction, bool())
 
 MOCK_METHOD1 (setParserPaused, void(bool))
 
 MOCK_METHOD1 (onIngress, size_t(const folly::IOBuf &))
 
 MOCK_METHOD0 (onIngressEOF, void())
 
 MOCK_CONST_METHOD0 (isReusable, bool())
 
 MOCK_CONST_METHOD0 (isWaitingToDrain, bool())
 
 MOCK_CONST_METHOD0 (closeOnEgressComplete, bool())
 
 MOCK_CONST_METHOD0 (supportsParallelRequests, bool())
 
 MOCK_CONST_METHOD0 (supportsPushTransactions, bool())
 
 MOCK_METHOD5 (generateHeader, void(folly::IOBufQueue &, HTTPCodec::StreamID, const HTTPMessage &, bool eom, HTTPHeaderSize *))
 
 MOCK_METHOD6 (generatePushPromise, void(folly::IOBufQueue &, HTTPCodec::StreamID, const HTTPMessage &, HTTPCodec::StreamID, bool eom, HTTPHeaderSize *))
 
 MOCK_METHOD5 (generateBody, size_t(folly::IOBufQueue &, HTTPCodec::StreamID, std::shared_ptr< folly::IOBuf >, folly::Optional< uint8_t >, bool))
 
size_t generateBody (folly::IOBufQueue &writeBuf, HTTPCodec::StreamID stream, std::unique_ptr< folly::IOBuf > chain, folly::Optional< uint8_t > padding, bool eom) override
 
 MOCK_METHOD3 (generateChunkHeader, size_t(folly::IOBufQueue &, HTTPCodec::StreamID, size_t))
 
 MOCK_METHOD2 (generateChunkTerminator, size_t(folly::IOBufQueue &, HTTPCodec::StreamID))
 
 MOCK_METHOD3 (generateTrailers, size_t(folly::IOBufQueue &, HTTPCodec::StreamID, const HTTPHeaders &))
 
 MOCK_METHOD2 (generateEOM, size_t(folly::IOBufQueue &, HTTPCodec::StreamID))
 
 MOCK_METHOD3 (generateRstStream, size_t(folly::IOBufQueue &, HTTPCodec::StreamID, ErrorCode))
 
 MOCK_METHOD4 (generateGoaway, size_t(folly::IOBufQueue &, StreamID, ErrorCode, std::shared_ptr< folly::IOBuf >))
 
size_t generateGoaway (folly::IOBufQueue &writeBuf, StreamID lastStream, ErrorCode statusCode, std::unique_ptr< folly::IOBuf > debugData) override
 
 MOCK_METHOD1 (generatePingRequest, size_t(folly::IOBufQueue &))
 
 MOCK_METHOD2 (generatePingReply, size_t(folly::IOBufQueue &, uint64_t))
 
 MOCK_METHOD1 (generateSettings, size_t(folly::IOBufQueue &))
 
 MOCK_METHOD1 (generateSettingsAck, size_t(folly::IOBufQueue &))
 
 MOCK_METHOD3 (generateWindowUpdate, size_t(folly::IOBufQueue &, StreamID, uint32_t))
 
 MOCK_METHOD3 (generateCertificateRequest, size_t(folly::IOBufQueue &, uint16_t, std::shared_ptr< folly::IOBuf >))
 
size_t generateCertificateRequest (folly::IOBufQueue &writeBuf, uint16_t requestId, std::unique_ptr< folly::IOBuf > authRequest) override
 
 MOCK_METHOD3 (generateCertificate, size_t(folly::IOBufQueue &, uint16_t, std::shared_ptr< folly::IOBuf >))
 
size_t generateCertificate (folly::IOBufQueue &writeBuf, uint16_t certId, std::unique_ptr< folly::IOBuf > authenticator) override
 
 MOCK_METHOD0 (getEgressSettings, HTTPSettings *())
 
 MOCK_CONST_METHOD0 (getIngressSettings, const HTTPSettings *())
 
 MOCK_METHOD0 (enableDoubleGoawayDrain, void())
 
 MOCK_CONST_METHOD0 (getDefaultWindowSize, uint32_t())
 
 MOCK_METHOD3 (addPriorityNodes, size_t(PriorityQueue &, folly::IOBufQueue &, uint8_t))
 
 MOCK_CONST_METHOD1 (mapPriorityToDependency, HTTPCodec::StreamID(uint8_t))
 
- Public Member Functions inherited from proxygen::HTTPCodec
virtual ~HTTPCodec ()
 
virtual HPACKTableInfo getHPACKTableInfo () const
 
virtual CodecProtocol getProtocol () const =0
 
virtual const std::stringgetUserAgent () const =0
 
virtual TransportDirection getTransportDirection () const =0
 
virtual bool supportsStreamFlowControl () const
 
virtual bool supportsSessionFlowControl () const
 
virtual StreamID createStream ()=0
 
virtual void setCallback (Callback *callback)=0
 
virtual bool isBusy () const =0
 
virtual void setParserPaused (bool paused)=0
 
virtual size_t onIngress (const folly::IOBuf &buf)=0
 
virtual void onIngressEOF ()=0
 
virtual bool onIngressUpgradeMessage (const HTTPMessage &)
 
virtual bool isReusable () const =0
 
virtual bool isWaitingToDrain () const =0
 
virtual bool closeOnEgressComplete () const =0
 
virtual bool supportsParallelRequests () const =0
 
virtual bool supportsPushTransactions () const =0
 
virtual bool supportsExTransactions () const
 
virtual size_t generateConnectionPreface (folly::IOBufQueue &)
 
virtual void generateHeader (folly::IOBufQueue &writeBuf, StreamID stream, const HTTPMessage &msg, bool eom=false, HTTPHeaderSize *size=nullptr)=0
 
virtual void generatePushPromise (folly::IOBufQueue &, StreamID, const HTTPMessage &, StreamID, bool, HTTPHeaderSize *)
 
virtual void generateExHeader (folly::IOBufQueue &, StreamID, const HTTPMessage &, const HTTPCodec::ExAttributes &, bool, HTTPHeaderSize *)
 
virtual size_t generateChunkHeader (folly::IOBufQueue &writeBuf, StreamID stream, size_t length)=0
 
virtual size_t generateChunkTerminator (folly::IOBufQueue &writeBuf, StreamID stream)=0
 
virtual size_t generateTrailers (folly::IOBufQueue &writeBuf, StreamID stream, const HTTPHeaders &trailers)=0
 
virtual size_t generateEOM (folly::IOBufQueue &writeBuf, StreamID stream)=0
 
virtual size_t generateRstStream (folly::IOBufQueue &writeBuf, StreamID stream, ErrorCode code)=0
 
virtual size_t generatePingRequest (folly::IOBufQueue &)
 
virtual size_t generatePingReply (folly::IOBufQueue &, uint64_t)
 
virtual size_t generateSettings (folly::IOBufQueue &)
 
virtual size_t generateSettingsAck (folly::IOBufQueue &)
 
virtual size_t generateWindowUpdate (folly::IOBufQueue &, StreamID, uint32_t)
 
virtual size_t generatePriority (folly::IOBufQueue &, StreamID, const HTTPMessage::HTTPPriority &)
 
virtual HTTPSettingsgetEgressSettings ()
 
virtual const HTTPSettingsgetIngressSettings () const
 
virtual void enableDoubleGoawayDrain ()
 
virtual void setHeaderCodecStats (HeaderCodec::Stats *)
 
virtual StreamID getLastIncomingStreamID () const
 
virtual uint32_t getDefaultWindowSize () const
 
virtual size_t addPriorityNodes (PriorityQueue &, folly::IOBufQueue &, uint8_t)
 
virtual StreamID mapPriorityToDependency (uint8_t) const
 
virtual int8_t mapDependencyToPriority (StreamID) const
 

Additional Inherited Members

- Public Types inherited from proxygen::HTTPCodec
using StreamID = uint64_t
 
- Static Public Attributes inherited from proxygen::HTTPCodec
static const folly::Optional< StreamIDNoStream
 
static const folly::Optional< uint8_tNoPadding = folly::none
 
static const StreamID MAX_STREAM_ID = 1u << 31
 
static const folly::Optional< ExAttributesNoExAttributes
 

Detailed Description

Definition at line 22 of file MockHTTPCodec.h.

Member Function Documentation

size_t proxygen::MockHTTPCodec::generateBody ( folly::IOBufQueue writeBuf,
HTTPCodec::StreamID  stream,
std::unique_ptr< folly::IOBuf chain,
folly::Optional< uint8_t padding,
bool  eom 
)
inlineoverridevirtual

Write part of an egress message body.

This will automatically generate a chunk header and footer around the data if necessary (e.g. you haven't manually sent a chunk header and the message should be chunked).

Parameters
paddingOptionally add padding bytes to the body if possible
eomimplicitly generate the EOM marker with this body frame
Returns
number of bytes written

Implements proxygen::HTTPCodec.

Definition at line 57 of file MockHTTPCodec.h.

References proxygen::HTTPCodec::generateChunkHeader(), proxygen::HTTPCodec::generateChunkTerminator(), proxygen::HTTPCodec::generateEOM(), generateGoaway(), proxygen::HTTPCodec::generateRstStream(), proxygen::HTTPCodec::generateTrailers(), MOCK_METHOD2(), MOCK_METHOD3(), and MOCK_METHOD4().

61  {
62  return generateBody(writeBuf,
63  stream,
64  std::shared_ptr<folly::IOBuf>(chain.release()),
65  padding,
66  eom);
67  }
size_t generateBody(folly::IOBufQueue &writeBuf, HTTPCodec::StreamID stream, std::unique_ptr< folly::IOBuf > chain, folly::Optional< uint8_t > padding, bool eom) override
Definition: MockHTTPCodec.h:57
size_t proxygen::MockHTTPCodec::generateCertificate ( folly::IOBufQueue writeBuf,
uint16_t  certId,
std::unique_ptr< folly::IOBuf authenticator 
)
inlineoverridevirtual

Reimplemented from proxygen::HTTPCodec.

Definition at line 117 of file MockHTTPCodec.h.

References proxygen::HTTPCodec::addPriorityNodes(), proxygen::HTTPCodec::enableDoubleGoawayDrain(), proxygen::HTTPCodec::getDefaultWindowSize(), proxygen::HTTPCodec::getEgressSettings(), proxygen::HTTPCodec::getIngressSettings(), proxygen::HTTPCodec::mapPriorityToDependency(), MOCK_CONST_METHOD0(), MOCK_CONST_METHOD1(), MOCK_METHOD0(), MOCK_METHOD3(), uint32_t, and uint8_t.

Referenced by generateCertificateRequest().

120  {
121  return generateCertificate(
122  writeBuf,
123  certId,
124  std::shared_ptr<folly::IOBuf>(authenticator.release()));
125  }
size_t generateCertificate(folly::IOBufQueue &writeBuf, uint16_t certId, std::unique_ptr< folly::IOBuf > authenticator) override
size_t proxygen::MockHTTPCodec::generateCertificateRequest ( folly::IOBufQueue writeBuf,
uint16_t  requestId,
std::unique_ptr< folly::IOBuf authRequest 
)
inlineoverridevirtual

Reimplemented from proxygen::HTTPCodec.

Definition at line 104 of file MockHTTPCodec.h.

References generateCertificate(), MOCK_METHOD3(), and uint16_t.

Referenced by generateGoaway().

107  {
109  writeBuf,
110  requestId,
111  std::shared_ptr<folly::IOBuf>(authRequest.release()));
112  }
size_t generateCertificateRequest(folly::IOBufQueue &writeBuf, uint16_t requestId, std::unique_ptr< folly::IOBuf > authRequest) override
size_t proxygen::MockHTTPCodec::generateGoaway ( folly::IOBufQueue writeBuf,
StreamID  lastStream,
ErrorCode  code,
std::unique_ptr< folly::IOBuf debugData 
)
inlineoverridevirtual

Generate any protocol framing needed to abort a connection.

Returns
number of bytes written

Implements proxygen::HTTPCodec.

Definition at line 85 of file MockHTTPCodec.h.

References generateCertificateRequest(), proxygen::HTTPCodec::generatePingReply(), proxygen::HTTPCodec::generatePingRequest(), proxygen::HTTPCodec::generateSettings(), proxygen::HTTPCodec::generateSettingsAck(), proxygen::HTTPCodec::generateWindowUpdate(), MOCK_METHOD1(), MOCK_METHOD2(), MOCK_METHOD3(), uint16_t, uint32_t, and uint64_t.

Referenced by generateBody().

88  {
89  return generateGoaway(writeBuf, lastStream, statusCode,
90  std::shared_ptr<folly::IOBuf>(debugData.release()));
91  }
spdy::GoawayStatusCode statusCode
Definition: SPDYCodec.cpp:110
size_t generateGoaway(folly::IOBufQueue &writeBuf, StreamID lastStream, ErrorCode statusCode, std::unique_ptr< folly::IOBuf > debugData) override
Definition: MockHTTPCodec.h:85
proxygen::MockHTTPCodec::MOCK_CONST_METHOD0 ( getProtocol  ,
CodecProtocol()   
)
proxygen::MockHTTPCodec::MOCK_CONST_METHOD0 ( getUserAgent  ,
const std::string () 
)
proxygen::MockHTTPCodec::MOCK_CONST_METHOD0 ( getTransportDirection  ,
TransportDirection()   
)
proxygen::MockHTTPCodec::MOCK_CONST_METHOD0 ( supportsStreamFlowControl  ,
bool()   
)
proxygen::MockHTTPCodec::MOCK_CONST_METHOD0 ( supportsSessionFlowControl  ,
bool()   
)
proxygen::MockHTTPCodec::MOCK_CONST_METHOD0 ( isBusy  ,
bool()   
)
proxygen::MockHTTPCodec::MOCK_CONST_METHOD0 ( hasPartialTransaction  ,
bool()   
)
proxygen::MockHTTPCodec::MOCK_CONST_METHOD0 ( isReusable  ,
bool()   
)
proxygen::MockHTTPCodec::MOCK_CONST_METHOD0 ( isWaitingToDrain  ,
bool()   
)
proxygen::MockHTTPCodec::MOCK_CONST_METHOD0 ( closeOnEgressComplete  ,
bool()   
)
proxygen::MockHTTPCodec::MOCK_CONST_METHOD0 ( supportsParallelRequests  ,
bool()   
)
proxygen::MockHTTPCodec::MOCK_CONST_METHOD0 ( supportsPushTransactions  ,
bool()   
)
proxygen::MockHTTPCodec::MOCK_CONST_METHOD0 ( getIngressSettings  ,
const HTTPSettings () 
)
proxygen::MockHTTPCodec::MOCK_CONST_METHOD0 ( getDefaultWindowSize  ,
uint32_t()   
)
proxygen::MockHTTPCodec::MOCK_CONST_METHOD1 ( mapPriorityToDependency  ,
HTTPCodec::StreamID(uint8_t  
)

Referenced by generateCertificate().

proxygen::MockHTTPCodec::MOCK_METHOD0 ( createStream  ,
HTTPCodec::StreamID()   
)
proxygen::MockHTTPCodec::MOCK_METHOD0 ( onIngressEOF  ,
void()   
)
proxygen::MockHTTPCodec::MOCK_METHOD0 ( getEgressSettings  ,
HTTPSettings () 
)
proxygen::MockHTTPCodec::MOCK_METHOD0 ( enableDoubleGoawayDrain  ,
void()   
)
proxygen::MockHTTPCodec::MOCK_METHOD1 ( setCallback  ,
void(Callback *)   
)
proxygen::MockHTTPCodec::MOCK_METHOD1 ( setParserPaused  ,
void(bool)   
)
proxygen::MockHTTPCodec::MOCK_METHOD1 ( onIngress  ,
size_t(const folly::IOBuf &)   
)
proxygen::MockHTTPCodec::MOCK_METHOD1 ( generatePingRequest  ,
size_t(folly::IOBufQueue &)   
)
proxygen::MockHTTPCodec::MOCK_METHOD1 ( generateSettings  ,
size_t(folly::IOBufQueue &)   
)
proxygen::MockHTTPCodec::MOCK_METHOD1 ( generateSettingsAck  ,
size_t(folly::IOBufQueue &)   
)
proxygen::MockHTTPCodec::MOCK_METHOD2 ( generateEOM  ,
size_t(folly::IOBufQueue &, HTTPCodec::StreamID  
)
proxygen::MockHTTPCodec::MOCK_METHOD2 ( generatePingReply  ,
size_t(folly::IOBufQueue &, uint64_t  
)
proxygen::MockHTTPCodec::MOCK_METHOD3 ( generateTrailers  ,
size_t(folly::IOBufQueue &, HTTPCodec::StreamID, const HTTPHeaders &)   
)
proxygen::MockHTTPCodec::MOCK_METHOD3 ( generateRstStream  ,
size_t(folly::IOBufQueue &, HTTPCodec::StreamID, ErrorCode  
)
proxygen::MockHTTPCodec::MOCK_METHOD3 ( generateWindowUpdate  ,
size_t(folly::IOBufQueue &, StreamID, uint32_t  
)
proxygen::MockHTTPCodec::MOCK_METHOD3 ( generateCertificateRequest  ,
size_t(folly::IOBufQueue &, uint16_t, std::shared_ptr< folly::IOBuf >)   
)
proxygen::MockHTTPCodec::MOCK_METHOD3 ( generateCertificate  ,
size_t(folly::IOBufQueue &, uint16_t, std::shared_ptr< folly::IOBuf >)   
)
proxygen::MockHTTPCodec::MOCK_METHOD3 ( addPriorityNodes  ,
size_t(PriorityQueue &, folly::IOBufQueue &, uint8_t  
)
proxygen::MockHTTPCodec::MOCK_METHOD4 ( generateGoaway  ,
size_t(folly::IOBufQueue &, StreamID, ErrorCode, std::shared_ptr< folly::IOBuf >)   
)
proxygen::MockHTTPCodec::MOCK_METHOD5 ( generateHeader  ,
void(folly::IOBufQueue &, HTTPCodec::StreamID, const HTTPMessage &, bool eom, HTTPHeaderSize *)   
)
proxygen::MockHTTPCodec::MOCK_METHOD5 ( generateBody  ,
size_t(folly::IOBufQueue &, HTTPCodec::StreamID, std::shared_ptr< folly::IOBuf >, folly::Optional< uint8_t >, bool)   
)
proxygen::MockHTTPCodec::MOCK_METHOD6 ( generatePushPromise  ,
void(folly::IOBufQueue &, HTTPCodec::StreamID, const HTTPMessage &, HTTPCodec::StreamID, bool eom, HTTPHeaderSize *)   
)

The documentation for this class was generated from the following file: