blob: 189db309336d690d228d62016980fc4dccbd69bb [file] [log] [blame]
mukesh agrawalae30e9e2013-05-28 14:09:16 -07001// 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 Vakulenko8a532292014-06-16 17:18:44 -07008#include <map>
9#include <string>
10#include <vector>
11
mukesh agrawalae30e9e2013-05-28 14:09:16 -070012#include <gmock/gmock.h>
13
14#include "shill/external_task.h"
15
16namespace shill {
17
18class MockExternalTask : public ExternalTask {
Alex Vakulenko8a532292014-06-16 17:18:44 -070019 public:
Paul Stewart1e006c62015-06-16 12:29:06 -070020 MockExternalTask(ControlInterface* control,
Peter Qiua24480a2015-08-11 23:09:54 -070021 ProcessManager* process_manager,
Paul Stewart1e006c62015-06-16 12:29:06 -070022 const base::WeakPtr<RPCTaskDelegate>& task_delegate,
23 const base::Callback<void(pid_t, int)>& death_callback);
Ben Chan5ea763b2014-08-13 11:07:54 -070024 ~MockExternalTask() override;
mukesh agrawalae30e9e2013-05-28 14:09:16 -070025
mukesh agrawalc4f9aa02013-08-15 19:23:13 -070026 MOCK_METHOD5(Start,
Paul Stewart1e006c62015-06-16 12:29:06 -070027 bool(const base::FilePath& file,
28 const std::vector<std::string>& arguments,
29 const std::map<std::string, std::string>& environment,
mukesh agrawalc4f9aa02013-08-15 19:23:13 -070030 bool terminate_with_parent,
Paul Stewart1e006c62015-06-16 12:29:06 -070031 Error* error));
mukesh agrawalae30e9e2013-05-28 14:09:16 -070032 MOCK_METHOD0(Stop, void());
33 MOCK_METHOD0(OnDelete, void());
34
Alex Vakulenko8a532292014-06-16 17:18:44 -070035 private:
mukesh agrawalae30e9e2013-05-28 14:09:16 -070036 DISALLOW_COPY_AND_ASSIGN(MockExternalTask);
37};
38
39} // namespace shill
40
41#endif // SHILL_MOCK_EXTERNAL_TASK_H_