blob: 82f76762856bd970ea6c866c68a1aef976bc184e [file] [log] [blame]
Niels Möller573b1452022-06-21 09:37:291/*
2 * Copyright (c) 2022 The WebRTC project authors. All Rights Reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
11#ifndef API_TEST_MOCK_PACKET_SOCKET_FACTORY_H_
12#define API_TEST_MOCK_PACKET_SOCKET_FACTORY_H_
13
14#include <memory>
15#include <string>
16
17#include "api/packet_socket_factory.h"
18#include "test/gmock.h"
19
20namespace rtc {
21class MockPacketSocketFactory : public PacketSocketFactory {
22 public:
23 MOCK_METHOD(AsyncPacketSocket*,
24 CreateUdpSocket,
25 (const SocketAddress&, uint16_t, uint16_t),
26 (override));
27 MOCK_METHOD(AsyncListenSocket*,
28 CreateServerTcpSocket,
29 (const SocketAddress&, uint16_t, uint16_t, int opts),
30 (override));
31 MOCK_METHOD(AsyncPacketSocket*,
32 CreateClientTcpSocket,
33 (const SocketAddress& local_address,
34 const SocketAddress&,
Niels Möller573b1452022-06-21 09:37:2935 const PacketSocketTcpOptions&),
36 (override));
37 MOCK_METHOD(std::unique_ptr<webrtc::AsyncDnsResolverInterface>,
38 CreateAsyncDnsResolver,
39 (),
40 (override));
41};
42
43static_assert(!std::is_abstract_v<MockPacketSocketFactory>, "");
44
45} // namespace rtc
46
47#endif // API_TEST_MOCK_PACKET_SOCKET_FACTORY_H_