Prathmesh Prabhu | 3e452f8 | 2013-04-10 16:31:44 -0700 | [diff] [blame] | 1 | // Copyright (c) 2013 The Chromium OS 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 SHILL_MOCK_DNS_CLIENT_FACTORY_H_ |
| 6 | #define SHILL_MOCK_DNS_CLIENT_FACTORY_H_ |
| 7 | |
| 8 | #include <string> |
| 9 | #include <vector> |
| 10 | |
| 11 | #include <base/lazy_instance.h> |
| 12 | #include <gmock/gmock.h> |
| 13 | |
| 14 | #include "shill/dns_client_factory.h" |
| 15 | #include "shill/event_dispatcher.h" |
| 16 | #include "shill/ip_address.h" |
| 17 | |
| 18 | namespace shill { |
| 19 | |
| 20 | class MockDNSClientFactory : public DNSClientFactory { |
| 21 | public: |
| 22 | virtual ~MockDNSClientFactory(); |
| 23 | |
| 24 | // This is a singleton. Use MockDNSClientFactory::GetInstance()->Foo() |
| 25 | static MockDNSClientFactory *GetInstance(); |
| 26 | |
| 27 | MOCK_METHOD6(CreateDNSClient, |
| 28 | DNSClient *(IPAddress::Family family, |
| 29 | const std::string &interface_name, |
| 30 | const std::vector<std::string> &dns_servers, |
| 31 | int timeout_ms, |
| 32 | EventDispatcher *dispatcher, |
| 33 | const DNSClient::ClientCallback &callback)); |
| 34 | |
| 35 | protected: |
| 36 | MockDNSClientFactory(); |
| 37 | |
| 38 | private: |
| 39 | friend struct base::DefaultLazyInstanceTraits<MockDNSClientFactory>; |
| 40 | |
| 41 | DISALLOW_COPY_AND_ASSIGN(MockDNSClientFactory); |
| 42 | }; |
| 43 | |
| 44 | } // namespace shill |
| 45 | |
| 46 | #endif // SHILL_MOCK_DNS_CLIENT_FACTORY_H_ |