blob: ff4374765b3427fb9e7963c55785c0445121dae8 [file] [log] [blame]
Eric Orth9871aafa2018-10-02 19:59:181// Copyright 2018 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef NET_DNS_MOCK_MDNS_CLIENT_H_
6#define NET_DNS_MOCK_MDNS_CLIENT_H_
7
8#include <memory>
9#include <string>
10
11#include "net/dns/mdns_client.h"
12#include "testing/gmock/include/gmock/gmock.h"
13
14namespace net {
15
16class MockMDnsTransaction : public MDnsTransaction {
17 public:
18 MockMDnsTransaction();
19 ~MockMDnsTransaction();
20
21 MOCK_METHOD0(Start, bool());
22 MOCK_CONST_METHOD0(GetName, const std::string&());
23 MOCK_CONST_METHOD0(GetType, uint16_t());
24};
25
26class MockMDnsClient : public MDnsClient {
27 public:
28 MockMDnsClient();
29 ~MockMDnsClient();
30
31 MOCK_METHOD3(CreateListener,
32 std::unique_ptr<MDnsListener>(uint16_t,
33 const std::string&,
34 MDnsListener::Delegate*));
35 MOCK_METHOD4(
36 CreateTransaction,
37 std::unique_ptr<MDnsTransaction>(uint16_t,
38 const std::string&,
39 int,
40 const MDnsTransaction::ResultCallback&));
Eric Orthe857ebb2019-03-13 23:02:0741 MOCK_METHOD1(StartListening, int(MDnsSocketFactory*));
Eric Orth9871aafa2018-10-02 19:59:1842 MOCK_METHOD0(StopListening, void());
43 MOCK_CONST_METHOD0(IsListening, bool());
44};
45
46} // namespace net
47
48#endif // NET_DNS_MOCK_MDNS_CLIENT_H_