~alan-griffiths/miral/fix-1645284

« back to all changes in this revision

Viewing changes to miral-qt/tests/framework/mock_task_controller.h

  • Committer: Alan Griffiths
  • Date: 2016-11-07 17:59:19 UTC
  • mfrom: (436.1.1 miral2)
  • Revision ID: alan@octopull.co.uk-20161107175919-stbb64i7j1htgog2
[miral-qt] delete all as qtmir work on MirAL has shifted to lp:~unity-team/qtmir/miral-qt-integration and this is a needless distration

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright (C) 2013-2015 Canonical, Ltd.
3
 
 *
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.
7
 
 *
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.
12
 
 *
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/>.
15
 
 */
16
 
 
17
 
#ifndef MOCK_TASK_CONTROLLER_H
18
 
#define MOCK_TASK_CONTROLLER_H
19
 
 
20
 
#include <Unity/Application/taskcontroller.h>
21
 
#include <QMap>
22
 
 
23
 
#include <core/posix/fork.h>
24
 
 
25
 
#include <gmock/gmock.h>
26
 
 
27
 
namespace qtmir
28
 
{
29
 
struct MockTaskController : public qtmir::TaskController
30
 
{
31
 
    MockTaskController();
32
 
    virtual ~MockTaskController();
33
 
 
34
 
    MOCK_METHOD2(appIdHasProcessId, bool(const QString&, pid_t));
35
 
    MOCK_CONST_METHOD1(getInfoForApp, QSharedPointer<qtmir::ApplicationInfo> (const QString &));
36
 
 
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&));
41
 
 
42
 
    bool doAppIdHasProcessId(const QString& appId, pid_t pid);
43
 
 
44
 
    QSharedPointer<qtmir::ApplicationInfo> doGetInfoForApp(const QString& appId) const;
45
 
 
46
 
    bool doStop(const QString& appId);
47
 
 
48
 
    bool doStart(const QString& appId, const QStringList& args);
49
 
 
50
 
    bool doSuspend(const QString& appId);
51
 
 
52
 
    bool doResume(const QString& appId);
53
 
 
54
 
private:
55
 
    QMap<QString, core::posix::ChildProcess> children;
56
 
};
57
 
 
58
 
} // namespace qtmir
59
 
 
60
 
#endif // MOCK_TASK_CONTROLLER_H