xref: /trafficserver/proxy/http3/test/Mock.h (revision 88909bcf)
1 /** @file
2  *
3  *  A brief file description
4  *
5  *  @section license License
6  *
7  *  Licensed to the Apache Software Foundation (ASF) under one
8  *  or more contributor license agreements.  See the NOTICE file
9  *  distributed with this work for additional information
10  *  regarding copyright ownership.  The ASF licenses this file
11  *  to you under the Apache License, Version 2.0 (the
12  *  "License"); you may not use this file except in compliance
13  *  with the License.  You may obtain a copy of the License at
14  *
15  *      http://www.apache.org/licenses/LICENSE-2.0
16  *
17  *  Unless required by applicable law or agreed to in writing, software
18  *  distributed under the License is distributed on an "AS IS" BASIS,
19  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20  *  See the License for the specific language governing permissions and
21  *  limitations under the License.
22  */
23 
24 #include "catch.hpp"
25 
26 #include "Http3FrameHandler.h"
27 
28 class Http3MockFrameHandler : public Http3FrameHandler
29 {
30 public:
31   int total_frame_received = 0;
32 
33   // Http3FrameHandler
34 
35   std::vector<Http3FrameType>
interests()36   interests() override
37   {
38     return {Http3FrameType::DATA};
39   }
40 
41   Http3ErrorUPtr
handle_frame(std::shared_ptr<const Http3Frame> frame)42   handle_frame(std::shared_ptr<const Http3Frame> frame) override
43   {
44     this->total_frame_received++;
45     return Http3ErrorUPtr(new Http3NoError());
46   }
47 };
48