mukesh agrawal | ae30e9e | 2013-05-28 14:09:16 -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_EXTERNAL_TASK_H_ |
| 6 | #define SHILL_MOCK_EXTERNAL_TASK_H_ |
| 7 | |
Alex Vakulenko | 8a53229 | 2014-06-16 17:18:44 -0700 | [diff] [blame] | 8 | #include <map> |
| 9 | #include <string> |
| 10 | #include <vector> |
| 11 | |
mukesh agrawal | ae30e9e | 2013-05-28 14:09:16 -0700 | [diff] [blame] | 12 | #include <gmock/gmock.h> |
| 13 | |
| 14 | #include "shill/external_task.h" |
| 15 | |
| 16 | namespace shill { |
| 17 | |
| 18 | class MockExternalTask : public ExternalTask { |
Alex Vakulenko | 8a53229 | 2014-06-16 17:18:44 -0700 | [diff] [blame] | 19 | public: |
Paul Stewart | 1e006c6 | 2015-06-16 12:29:06 -0700 | [diff] [blame] | 20 | MockExternalTask(ControlInterface* control, |
Peter Qiu | a24480a | 2015-08-11 23:09:54 -0700 | [diff] [blame] | 21 | ProcessManager* process_manager, |
Paul Stewart | 1e006c6 | 2015-06-16 12:29:06 -0700 | [diff] [blame] | 22 | const base::WeakPtr<RPCTaskDelegate>& task_delegate, |
| 23 | const base::Callback<void(pid_t, int)>& death_callback); |
Ben Chan | 5ea763b | 2014-08-13 11:07:54 -0700 | [diff] [blame] | 24 | ~MockExternalTask() override; |
mukesh agrawal | ae30e9e | 2013-05-28 14:09:16 -0700 | [diff] [blame] | 25 | |
mukesh agrawal | c4f9aa0 | 2013-08-15 19:23:13 -0700 | [diff] [blame] | 26 | MOCK_METHOD5(Start, |
Paul Stewart | 1e006c6 | 2015-06-16 12:29:06 -0700 | [diff] [blame] | 27 | bool(const base::FilePath& file, |
| 28 | const std::vector<std::string>& arguments, |
| 29 | const std::map<std::string, std::string>& environment, |
mukesh agrawal | c4f9aa0 | 2013-08-15 19:23:13 -0700 | [diff] [blame] | 30 | bool terminate_with_parent, |
Paul Stewart | 1e006c6 | 2015-06-16 12:29:06 -0700 | [diff] [blame] | 31 | Error* error)); |
mukesh agrawal | ae30e9e | 2013-05-28 14:09:16 -0700 | [diff] [blame] | 32 | MOCK_METHOD0(Stop, void()); |
| 33 | MOCK_METHOD0(OnDelete, void()); |
| 34 | |
Alex Vakulenko | 8a53229 | 2014-06-16 17:18:44 -0700 | [diff] [blame] | 35 | private: |
mukesh agrawal | ae30e9e | 2013-05-28 14:09:16 -0700 | [diff] [blame] | 36 | DISALLOW_COPY_AND_ASSIGN(MockExternalTask); |
| 37 | }; |
| 38 | |
| 39 | } // namespace shill |
| 40 | |
| 41 | #endif // SHILL_MOCK_EXTERNAL_TASK_H_ |