Peter Qiu | bf8e36c | 2014-12-03 22:59:45 -0800 | [diff] [blame^] | 1 | // Copyright 2014 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 APMANAGER_MOCK_DHCP_SERVER_FACTORY_H_ |
| 6 | #define APMANAGER_MOCK_DHCP_SERVER_FACTORY_H_ |
| 7 | |
| 8 | #include <string> |
| 9 | |
| 10 | #include <base/lazy_instance.h> |
| 11 | #include <gmock/gmock.h> |
| 12 | |
| 13 | #include "apmanager/dhcp_server_factory.h" |
| 14 | |
| 15 | namespace apmanager { |
| 16 | |
| 17 | class MockDHCPServerFactory : public DHCPServerFactory { |
| 18 | public: |
| 19 | ~MockDHCPServerFactory() override; |
| 20 | |
| 21 | // This is a singleton. Use MockDHCPServerFactory::GetInstance()->Foo(). |
| 22 | static MockDHCPServerFactory* GetInstance(); |
| 23 | |
| 24 | MOCK_METHOD2(CreateDHCPServer, |
| 25 | DHCPServer*(uint16_t server_address_index, |
| 26 | const std::string& interface_name)); |
| 27 | |
| 28 | protected: |
| 29 | MockDHCPServerFactory(); |
| 30 | |
| 31 | private: |
| 32 | friend struct base::DefaultLazyInstanceTraits<MockDHCPServerFactory>; |
| 33 | |
| 34 | DISALLOW_COPY_AND_ASSIGN(MockDHCPServerFactory); |
| 35 | }; |
| 36 | |
| 37 | } // namespace apmanager |
| 38 | |
| 39 | #endif // APMANAGER_MOCK_DHCP_SERVER_FACTORY_H_ |