1 /* 2 * Copyright (c) Facebook, Inc. and its affiliates. 3 * All rights reserved. 4 * 5 * This source code is licensed under the BSD-style license found in the 6 * LICENSE file in the root directory of this source tree. 7 */ 8 9 #pragma once 10 11 #include <folly/io/async/EventBase.h> 12 #include <folly/io/async/TimeoutManager.h> 13 #include <folly/io/async/test/MockAsyncTransport.h> 14 #include <folly/portability/GTest.h> 15 #include <proxygen/lib/http/codec/HTTP1xCodec.h> 16 #include <proxygen/lib/http/codec/HTTP2Codec.h> 17 #include <proxygen/lib/http/codec/SPDYCodec.h> 18 #include <proxygen/lib/http/codec/test/MockHTTPCodec.h> 19 #include <proxygen/lib/http/session/HTTPSession.h> 20 21 namespace proxygen { 22 23 extern const wangle::TransportInfo mockTransportInfo; 24 extern const folly::SocketAddress localAddr; 25 extern const folly::SocketAddress peerAddr; 26 27 folly::HHWheelTimer::UniquePtr makeInternalTimeoutSet(folly::EventBase* evb); 28 29 folly::HHWheelTimer::UniquePtr makeTimeoutSet(folly::EventBase* evb); 30 31 testing::NiceMock<folly::test::MockAsyncTransport>* newMockTransport( 32 folly::EventBase* evb); 33 34 struct HTTP1xCodecPair { 35 using Codec = HTTP1xCodec; 36 static const int version = 1; 37 }; 38 39 struct SPDY3CodecPair { 40 using Codec = SPDYCodec; 41 static const SPDYVersion version = SPDYVersion::SPDY3; 42 }; 43 44 struct SPDY3_1CodecPair { 45 using Codec = SPDYCodec; 46 static const SPDYVersion version = SPDYVersion::SPDY3_1; 47 }; 48 49 struct HTTP2CodecPair { 50 using Codec = HTTP2Codec; 51 static const int version = 2; 52 }; 53 54 struct MockHTTPCodecPair { 55 using Codec = MockHTTPCodec; 56 static const int version = 0; 57 }; 58 59 } // namespace proxygen 60