mukesh agrawal | f407d59 | 2013-07-31 11:37:57 -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_PPP_DEVICE_FACTORY_H_ |
| 6 | #define SHILL_MOCK_PPP_DEVICE_FACTORY_H_ |
| 7 | |
Alex Vakulenko | 8a53229 | 2014-06-16 17:18:44 -0700 | [diff] [blame] | 8 | #include <string> |
| 9 | |
mukesh agrawal | f407d59 | 2013-07-31 11:37:57 -0700 | [diff] [blame] | 10 | #include <base/lazy_instance.h> |
| 11 | #include <gmock/gmock.h> |
| 12 | |
| 13 | #include "shill/ppp_device_factory.h" |
| 14 | |
| 15 | namespace shill { |
| 16 | |
| 17 | class MockPPPDeviceFactory : public PPPDeviceFactory { |
| 18 | public: |
Alex Vakulenko | 016fa0e | 2014-08-11 15:59:58 -0700 | [diff] [blame] | 19 | ~MockPPPDeviceFactory() override; |
mukesh agrawal | f407d59 | 2013-07-31 11:37:57 -0700 | [diff] [blame] | 20 | |
| 21 | // This is a singleton. Use MockPPPDeviceFactory::GetInstance()->Foo(). |
Paul Stewart | 1e006c6 | 2015-06-16 12:29:06 -0700 | [diff] [blame] | 22 | static MockPPPDeviceFactory* GetInstance(); |
mukesh agrawal | f407d59 | 2013-07-31 11:37:57 -0700 | [diff] [blame] | 23 | |
| 24 | MOCK_METHOD6(CreatePPPDevice, |
Paul Stewart | 1e006c6 | 2015-06-16 12:29:06 -0700 | [diff] [blame] | 25 | PPPDevice* (ControlInterface* control, |
| 26 | EventDispatcher* dispatcher, |
| 27 | Metrics* metrics, |
| 28 | Manager* manager, |
| 29 | const std::string& link_name, |
mukesh agrawal | f407d59 | 2013-07-31 11:37:57 -0700 | [diff] [blame] | 30 | int interface_index)); |
| 31 | |
| 32 | protected: |
| 33 | MockPPPDeviceFactory(); |
| 34 | |
| 35 | private: |
| 36 | friend struct base::DefaultLazyInstanceTraits<MockPPPDeviceFactory>; |
| 37 | |
| 38 | DISALLOW_COPY_AND_ASSIGN(MockPPPDeviceFactory); |
| 39 | }; |
| 40 | |
| 41 | } // namespace shill |
| 42 | |
| 43 | #endif // SHILL_MOCK_PPP_DEVICE_FACTORY_H_ |