summaryrefslogtreecommitdiffstats
path: root/third_party/libwebrtc/net/dcsctp/public/mock_dcsctp_socket.h
blob: c71c3ae16f195876537be400f38a2c8e05441bef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
/*
 *  Copyright (c) 2021 The WebRTC project authors. All Rights Reserved.
 *
 *  Use of this source code is governed by a BSD-style license
 *  that can be found in the LICENSE file in the root of the source
 *  tree. An additional intellectual property rights grant can be found
 *  in the file PATENTS.  All contributing project authors may
 *  be found in the AUTHORS file in the root of the source tree.
 */
#ifndef NET_DCSCTP_PUBLIC_MOCK_DCSCTP_SOCKET_H_
#define NET_DCSCTP_PUBLIC_MOCK_DCSCTP_SOCKET_H_

#include <vector>

#include "net/dcsctp/public/dcsctp_socket.h"
#include "test/gmock.h"

namespace dcsctp {

class MockDcSctpSocket : public DcSctpSocketInterface {
 public:
  MOCK_METHOD(void,
              ReceivePacket,
              (rtc::ArrayView<const uint8_t> data),
              (override));

  MOCK_METHOD(void, HandleTimeout, (TimeoutID timeout_id), (override));

  MOCK_METHOD(void, Connect, (), (override));

  MOCK_METHOD(void,
              RestoreFromState,
              (const DcSctpSocketHandoverState&),
              (override));

  MOCK_METHOD(void, Shutdown, (), (override));

  MOCK_METHOD(void, Close, (), (override));

  MOCK_METHOD(SocketState, state, (), (const, override));

  MOCK_METHOD(const DcSctpOptions&, options, (), (const, override));

  MOCK_METHOD(void, SetMaxMessageSize, (size_t max_message_size), (override));

  MOCK_METHOD(void,
              SetStreamPriority,
              (StreamID stream_id, StreamPriority priority),
              (override));

  MOCK_METHOD(StreamPriority,
              GetStreamPriority,
              (StreamID stream_id),
              (const, override));

  MOCK_METHOD(SendStatus,
              Send,
              (DcSctpMessage message, const SendOptions& send_options),
              (override));

  MOCK_METHOD(std::vector<SendStatus>,
              SendMany,
              (rtc::ArrayView<DcSctpMessage> messages,
               const SendOptions& send_options),
              (override));

  MOCK_METHOD(ResetStreamsStatus,
              ResetStreams,
              (rtc::ArrayView<const StreamID> outgoing_streams),
              (override));

  MOCK_METHOD(size_t, buffered_amount, (StreamID stream_id), (const, override));

  MOCK_METHOD(size_t,
              buffered_amount_low_threshold,
              (StreamID stream_id),
              (const, override));

  MOCK_METHOD(void,
              SetBufferedAmountLowThreshold,
              (StreamID stream_id, size_t bytes),
              (override));

  MOCK_METHOD(absl::optional<Metrics>, GetMetrics, (), (const, override));

  MOCK_METHOD(HandoverReadinessStatus,
              GetHandoverReadiness,
              (),
              (const, override));
  MOCK_METHOD(absl::optional<DcSctpSocketHandoverState>,
              GetHandoverStateAndClose,
              (),
              (override));
};

}  // namespace dcsctp

#endif  // NET_DCSCTP_PUBLIC_MOCK_DCSCTP_SOCKET_H_