~alan-griffiths/miral/fix-1645284

« back to all changes in this revision

Viewing changes to miral-qt/tests/framework/qtmir_test.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) 2014-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 QT_MIR_TEST_FRAMEWORK_H
18
 
#define QT_MIR_TEST_FRAMEWORK_H
19
 
 
20
 
#include <memory>
21
 
 
22
 
#include <gtest/gtest.h>
23
 
 
24
 
#include <QSharedPointer>
25
 
 
26
 
#include <Unity/Application/application.h>
27
 
#include <Unity/Application/application_manager.h>
28
 
#include <Unity/Application/sessionmanager.h>
29
 
#include <Unity/Application/session_interface.h>
30
 
#include <Unity/Application/sharedwakelock.h>
31
 
#include <Unity/Application/proc_info.h>
32
 
#include "promptsessionmanager.h"
33
 
 
34
 
#include "mock_proc_info.h"
35
 
#include "mock_mir_session.h"
36
 
#include "mock_prompt_session_manager.h"
37
 
#include "mock_prompt_session.h"
38
 
#include "mock_shared_wakelock.h"
39
 
#include "mock_settings.h"
40
 
#include "mock_task_controller.h"
41
 
#include "mock_persistent_surface_store.h"
42
 
 
43
 
namespace ms = mir::scene;
44
 
using namespace qtmir;
45
 
 
46
 
namespace qtmir {
47
 
 
48
 
typedef testing::NiceMock<mir::scene::MockPromptSessionManager> StubPromptSessionManager;
49
 
typedef testing::NiceMock<mir::shell::MockPersistentSurfaceStore> StubPersistentSurfaceStore;
50
 
 
51
 
// For better output in ASSERT_* and EXPECT_* error messages
52
 
void PrintTo(const Application::InternalState& state, ::std::ostream* os);
53
 
void PrintTo(const SessionInterface::State& state, ::std::ostream* os);
54
 
} // namespace qtmir
55
 
 
56
 
void PrintTo(const QString &string, ::std::ostream* os);
57
 
void PrintTo(const QSize &size, ::std::ostream *os);
58
 
void PrintTo(const QPoint &point, ::std::ostream *os);
59
 
 
60
 
namespace testing {
61
 
 
62
 
class QtMirTest : public ::testing::Test
63
 
{
64
 
public:
65
 
    QtMirTest();
66
 
    virtual ~QtMirTest();
67
 
 
68
 
    Application* startApplication(pid_t procId, QString const& appId);
69
 
 
70
 
 
71
 
    QSharedPointer<qtmir::TaskController> taskControllerSharedPointer{new testing::NiceMock<qtmir::MockTaskController>};
72
 
    testing::NiceMock<qtmir::MockTaskController> *taskController{static_cast<testing::NiceMock<qtmir::MockTaskController>*>(taskControllerSharedPointer.data())};
73
 
    testing::NiceMock<MockProcInfo> procInfo;
74
 
    testing::NiceMock<MockSharedWakelock> sharedWakelock;
75
 
    testing::NiceMock<MockSettings> settings;
76
 
    std::shared_ptr<StubPromptSessionManager> stubPromptSessionManager{std::make_shared<StubPromptSessionManager>()};
77
 
    std::shared_ptr<qtmir::PromptSessionManager> promptSessionManager{std::make_shared<qtmir::PromptSessionManager>(stubPromptSessionManager)};
78
 
    std::shared_ptr<StubPersistentSurfaceStore> persistentSurfaceStore;
79
 
 
80
 
    ApplicationManager applicationManager;
81
 
    SessionManager sessionManager;
82
 
};
83
 
} // namespace testing
84
 
 
85
 
#endif // QT_MIR_TEST_FRAMEWORK_H