2
* Copyright (C) 2013-2015 Canonical, Ltd.
4
* This program is free software: you can redistribute it and/or modify it under
5
* the terms of the GNU Lesser General Public License version 3, as published by
6
* the Free Software Foundation.
8
* This program is distributed in the hope that it will be useful, but WITHOUT
9
* ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
10
* SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
* Lesser General Public License for more details.
13
* You should have received a copy of the GNU Lesser General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17
#ifndef MOCK_TASK_CONTROLLER_H
18
#define MOCK_TASK_CONTROLLER_H
20
#include <Unity/Application/taskcontroller.h>
23
#include <core/posix/fork.h>
25
#include <gmock/gmock.h>
29
struct MockTaskController : public qtmir::TaskController
32
virtual ~MockTaskController();
34
MOCK_METHOD2(appIdHasProcessId, bool(const QString&, pid_t));
35
MOCK_CONST_METHOD1(getInfoForApp, QSharedPointer<qtmir::ApplicationInfo> (const QString &));
37
MOCK_METHOD1(stop, bool(const QString&));
38
MOCK_METHOD2(start, bool(const QString&, const QStringList&));
39
MOCK_METHOD1(suspend, bool(const QString&));
40
MOCK_METHOD1(resume, bool(const QString&));
42
bool doAppIdHasProcessId(const QString& appId, pid_t pid);
44
QSharedPointer<qtmir::ApplicationInfo> doGetInfoForApp(const QString& appId) const;
46
bool doStop(const QString& appId);
48
bool doStart(const QString& appId, const QStringList& args);
50
bool doSuspend(const QString& appId);
52
bool doResume(const QString& appId);
55
QMap<QString, core::posix::ChildProcess> children;
60
#endif // MOCK_TASK_CONTROLLER_H