blob: e863cac6e6833c29a1ee704e6c91297ed354accd [file] [log] [blame]
Harald Alvestrand0ccfbd22021-04-08 07:25:04 +00001/*
2 * Copyright 2021 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_ASYNC_DNS_RESOLVER_H_
12#define API_TEST_MOCK_ASYNC_DNS_RESOLVER_H_
13
14#include <functional>
15#include <memory>
16
17#include "api/async_dns_resolver.h"
18#include "test/gmock.h"
19
20namespace webrtc {
21
22class MockAsyncDnsResolverResult : public AsyncDnsResolverResult {
23 public:
24 MOCK_METHOD(bool,
25 GetResolvedAddress,
26 (int, rtc::SocketAddress*),
27 (const override));
28 MOCK_METHOD(int, GetError, (), (const override));
29};
30
31class MockAsyncDnsResolver : public AsyncDnsResolverInterface {
32 public:
33 MOCK_METHOD(void,
34 Start,
35 (const rtc::SocketAddress&, std::function<void()>),
36 (override));
37 MOCK_METHOD(AsyncDnsResolverResult&, result, (), (const override));
38};
39
40class MockAsyncDnsResolverFactory : public AsyncDnsResolverFactoryInterface {
41 public:
42 MOCK_METHOD(std::unique_ptr<webrtc::AsyncDnsResolverInterface>,
43 CreateAndResolve,
44 (const rtc::SocketAddress&, std::function<void()>),
45 (override));
46 MOCK_METHOD(std::unique_ptr<webrtc::AsyncDnsResolverInterface>,
47 Create,
48 (),
49 (override));
50};
51
52} // namespace webrtc
53
54#endif // API_TEST_MOCK_ASYNC_DNS_RESOLVER_H_