Merge lp:~dandrader/qtmir/removeDBusWindowStack into lp:qtmir

Proposed by Daniel d'Andrada on 2016-07-25
Status: Merged
Approved by: Gerry Boland on 2016-07-25
Approved revision: 530
Merged at revision: 537
Proposed branch: lp:~dandrader/qtmir/removeDBusWindowStack
Merge into: lp:qtmir
Prerequisite: lp:~gerboland/qtmir/tests-use-stack-instead-of-heap
Diff against target: 868 lines (+66/-314)
7 files modified
src/modules/Unity/Application/CMakeLists.txt (+0/-1)
src/modules/Unity/Application/application_manager.cpp (+0/-39)
src/modules/Unity/Application/application_manager.h (+0/-6)
src/modules/Unity/Application/dbuswindowstack.cpp (+0/-116)
src/modules/Unity/Application/dbuswindowstack.h (+0/-72)
tests/framework/qtmir_test.cpp (+0/-1)
tests/modules/ApplicationManager/application_manager_test.cpp (+66/-79)
To merge this branch: bzr merge lp:~dandrader/qtmir/removeDBusWindowStack
Reviewer Review Type Date Requested Status
Unity8 CI Bot continuous-integration 2016-07-25 Needs Fixing on 2016-07-25
Gerry Boland 2016-07-25 Approve on 2016-07-25
Review via email: mp+301083@code.launchpad.net

This proposal supersedes a proposal from 2016-06-23.

Commit Message

Remove com.canonical.Unity.WindowStack D-Bus service

Nobody knows of anyone using it and the code is outdated
(pre surface-based WM era), so it doesn't even work correctly.

Therefore this is effectively dead code.

Description of the Change

* Are there any related MPs required for this MP to build/function as expected? Please list.
No

* Did you perform an exploratory manual test run of your code change and any related functionality?
Not applicable

* If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
Not applicable

To post a comment you must log in.
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal

FAILED: Continuous integration, rev:521
https://unity8-jenkins.ubuntu.com/job/lp-qtmir-ci/293/
Executed test runs:
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build/2138/console
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/2166
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/2075
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/2075
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/2075
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2066/console
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2066
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2066/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2066
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2066/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2066
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2066/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2066
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2066/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2066
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2066/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2066
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2066/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2066
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2066/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2066
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2066/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-qtmir-ci/293/rebuild

review: Needs Fixing (continuous-integration)
Gerry Boland (gerboland) wrote : Posted in a previous version of this proposal

I'm happy to see this go. If such a feature is needed, it should appear in unity8

review: Approve
Gerry Boland (gerboland) :
review: Approve
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:530
https://unity8-jenkins.ubuntu.com/job/lp-qtmir-ci/309/
Executed test runs:
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build/2362/console
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/2390
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/2277
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/2277
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/2277
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2270
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2270/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2270
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2270/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2270
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2270/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2270
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2270/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2270
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2270/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2270
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2270/artifact/output/*zip*/output.zip
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2270/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2270/console
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2270
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2270/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-qtmir-ci/309/rebuild

review: Needs Fixing (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/modules/Unity/Application/CMakeLists.txt'
2--- src/modules/Unity/Application/CMakeLists.txt 2016-07-05 12:41:04 +0000
3+++ src/modules/Unity/Application/CMakeLists.txt 2016-07-25 14:45:21 +0000
4@@ -31,7 +31,6 @@
5 ../../../common/debughelpers.cpp
6 dbusfocusinfo.cpp
7 plugin.cpp
8- dbuswindowstack.cpp
9 mirsurfacemanager.cpp
10 mirfocuscontroller.cpp
11 mirsurface.cpp
12
13=== modified file 'src/modules/Unity/Application/application_manager.cpp'
14--- src/modules/Unity/Application/application_manager.cpp 2016-06-24 16:28:37 +0000
15+++ src/modules/Unity/Application/application_manager.cpp 2016-07-25 14:45:21 +0000
16@@ -19,7 +19,6 @@
17 #include "application.h"
18 #include "applicationinfo.h"
19 #include "dbusfocusinfo.h"
20-#include "dbuswindowstack.h"
21 #include "mirfocuscontroller.h"
22 #include "session.h"
23 #include "sharedwakelock.h"
24@@ -75,16 +74,6 @@
25 return appId;
26 }
27
28-void connectToSessionListener(ApplicationManager *manager, SessionListener *listener)
29-{
30- QObject::connect(listener, &SessionListener::sessionStarting,
31- manager, &ApplicationManager::onSessionStarting);
32- QObject::connect(listener, &SessionListener::sessionStopping,
33- manager, &ApplicationManager::onSessionStopping);
34- QObject::connect(listener, &SessionListener::sessionCreatedSurface,
35- manager, &ApplicationManager::onSessionCreatedSurface);
36-}
37-
38 void connectToSessionAuthorizer(ApplicationManager *manager, SessionAuthorizer *authorizer)
39 {
40 QObject::connect(authorizer, &SessionAuthorizer::requestAuthorizationForSession,
41@@ -120,7 +109,6 @@
42 }
43
44 MirWindowManager *windowManager = static_cast<MirWindowManager*>(nativeInterface->nativeResourceForIntegration("WindowManager"));
45- SessionListener *sessionListener = static_cast<SessionListener*>(nativeInterface->nativeResourceForIntegration("SessionListener"));
46 SessionAuthorizer *sessionAuthorizer = static_cast<SessionAuthorizer*>(nativeInterface->nativeResourceForIntegration("SessionAuthorizer"));
47
48 QSharedPointer<TaskController> taskController(new upstart::TaskController());
49@@ -140,7 +128,6 @@
50 settings
51 );
52
53- connectToSessionListener(appManager, sessionListener);
54 connectToSessionAuthorizer(appManager, sessionAuthorizer);
55 connectToTaskController(appManager, taskController.data());
56 connect(windowManager, &MirWindowManager::sessionAboutToCreateSurface,
57@@ -178,7 +165,6 @@
58 QObject *parent)
59 : ApplicationManagerInterface(parent)
60 , m_dbusFocusInfo(new DBusFocusInfo(m_applications))
61- , m_dbusWindowStack(new DBusWindowStack(this))
62 , m_taskController(taskController)
63 , m_procInfo(procInfo)
64 , m_sharedWakelock(sharedWakelock)
65@@ -620,31 +606,6 @@
66 authorized = true;
67 }
68
69-void ApplicationManager::onSessionStarting(std::shared_ptr<ms::Session> const& session)
70-{
71- Q_UNUSED(session);
72-}
73-
74-void ApplicationManager::onSessionStopping(std::shared_ptr<ms::Session> const& session)
75-{
76- Application* application = findApplicationWithSession(session);
77- if (application) {
78- m_dbusWindowStack->WindowDestroyed(0, application->appId());
79- }
80-}
81-
82-void ApplicationManager::onSessionCreatedSurface(ms::Session const* session,
83- std::shared_ptr<ms::Surface> const& surface)
84-{
85- qCDebug(QTMIR_APPLICATIONS) << "ApplicationManager::onSessionCreatedSurface - sessionName=" << session->name().c_str();
86- Q_UNUSED(surface);
87-
88- Application* application = findApplicationWithSession(session);
89- if (application) {
90- m_dbusWindowStack->WindowCreated(0, application->appId());
91- }
92-}
93-
94 Application* ApplicationManager::findApplicationWithSession(const std::shared_ptr<ms::Session> &session)
95 {
96 return findApplicationWithSession(session.get());
97
98=== modified file 'src/modules/Unity/Application/application_manager.h'
99--- src/modules/Unity/Application/application_manager.h 2016-06-23 19:58:48 +0000
100+++ src/modules/Unity/Application/application_manager.h 2016-07-25 14:45:21 +0000
101@@ -102,11 +102,6 @@
102 public Q_SLOTS:
103 void authorizeSession(const pid_t pid, bool &authorized);
104
105- void onSessionStarting(std::shared_ptr<mir::scene::Session> const& session);
106- void onSessionStopping(std::shared_ptr<mir::scene::Session> const& session);
107-
108- void onSessionCreatedSurface(mir::scene::Session const*, std::shared_ptr<mir::scene::Surface> const&);
109-
110 void onProcessStarting(const QString& appId);
111 void onProcessStopped(const QString& appId);
112 void onProcessSuspended(const QString& appId);
113@@ -140,7 +135,6 @@
114
115 QList<Application*> m_applications;
116 DBusFocusInfo *m_dbusFocusInfo;
117- DBusWindowStack* m_dbusWindowStack;
118 QSharedPointer<TaskController> m_taskController;
119 QSharedPointer<ProcInfo> m_procInfo;
120 QSharedPointer<SharedWakelock> m_sharedWakelock;
121
122=== removed file 'src/modules/Unity/Application/dbuswindowstack.cpp'
123--- src/modules/Unity/Application/dbuswindowstack.cpp 2016-01-20 21:36:39 +0000
124+++ src/modules/Unity/Application/dbuswindowstack.cpp 1970-01-01 00:00:00 +0000
125@@ -1,116 +0,0 @@
126-/*
127- * Copyright (C) 2013-2015 Canonical, Ltd.
128- *
129- * This program is free software: you can redistribute it and/or modify it under
130- * the terms of the GNU Lesser General Public License version 3, as published by
131- * the Free Software Foundation.
132- *
133- * This program is distributed in the hope that it will be useful, but WITHOUT
134- * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
135- * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
136- * Lesser General Public License for more details.
137- *
138- * You should have received a copy of the GNU Lesser General Public License
139- * along with this program. If not, see <http://www.gnu.org/licenses/>.
140- */
141-
142-// local
143-#include "dbuswindowstack.h"
144-#include "application_manager.h"
145-
146-// Qt
147-#include <QDBusConnection>
148-#include <QDBusMetaType>
149-
150-namespace qtmir {
151-
152-DBusWindowStack::DBusWindowStack(ApplicationManager *parent) : QObject(parent)
153-{
154- qRegisterMetaType<AppIdDesktopFile>();
155- qDBusRegisterMetaType<AppIdDesktopFile>();
156- qRegisterMetaType<WindowInfo>();
157- qRegisterMetaType< QList<WindowInfo> >();
158- qDBusRegisterMetaType<WindowInfo>();
159- qDBusRegisterMetaType< QList<WindowInfo> >();
160-
161- QDBusConnection::sessionBus().registerService("com.canonical.Unity.WindowStack");
162- // TODO ExportScriptableSlots shouldn't be needed but without it i don't get the methods :-/
163- QDBusConnection::sessionBus().registerObject("/com/canonical/Unity/WindowStack", this, QDBusConnection::ExportAllSignals | QDBusConnection::ExportScriptableSlots |QDBusConnection::ExportScriptableInvokables );
164-}
165-
166-DBusWindowStack::~DBusWindowStack()
167-{
168-}
169-
170-AppIdDesktopFile DBusWindowStack::GetAppIdFromPid(unsigned int pid)
171-{
172- AppIdDesktopFile res;
173- ApplicationManager *appMgr = static_cast<ApplicationManager*>(parent());
174- const Application *app = appMgr->findApplicationWithPid(pid);
175- if (app) {
176- res.app_id = app->appId();
177- res.desktop_file = "";
178- }
179- return res;
180-}
181-
182-QList<WindowInfo> DBusWindowStack::GetWindowStack()
183-{
184- QList<WindowInfo> res;
185- ApplicationManager *appMgr = static_cast<ApplicationManager*>(parent());
186- const QList<Application*> &applications = appMgr->list();
187- Q_FOREACH(Application* app, applications) {
188- WindowInfo wi;
189- wi.window_id = 0;
190- wi.app_id = app->appId();
191- wi.focused = app->focused();
192- wi.stage = 0;
193- res << wi;
194- }
195- return res;
196-}
197-
198-QStringList DBusWindowStack::GetWindowProperties(unsigned int window_id, const QString &app_id,
199- const QStringList &names)
200-{
201- Q_UNUSED(window_id);
202- Q_UNUSED(app_id);
203- Q_UNUSED(names);
204- return QStringList();
205-}
206-
207-QDBusArgument &operator<<(QDBusArgument &a, const AppIdDesktopFile &aidf)
208-{
209- a.beginStructure();
210- a << aidf.app_id << aidf.desktop_file;
211- a.endStructure();
212- return a;
213-}
214-
215-const QDBusArgument &operator>>(const QDBusArgument &a, AppIdDesktopFile &aidf)
216-{
217- a.beginStructure();
218- a >> aidf.app_id >> aidf.desktop_file;
219- a.endStructure();
220-
221- return a;
222-}
223-
224-QDBusArgument &operator<<(QDBusArgument &a, const WindowInfo &wi)
225-{
226- a.beginStructure();
227- a << wi.window_id << wi.app_id << wi.focused << wi.stage;
228- a.endStructure();
229- return a;
230-}
231-
232-const QDBusArgument &operator>>(const QDBusArgument &a, WindowInfo &wi)
233-{
234- a.beginStructure();
235- a >> wi.window_id >> wi.app_id >> wi.focused >> wi.stage;
236- a.endStructure();
237-
238- return a;
239-}
240-
241-} // namespace qtmir
242
243=== removed file 'src/modules/Unity/Application/dbuswindowstack.h'
244--- src/modules/Unity/Application/dbuswindowstack.h 2015-08-11 12:08:32 +0000
245+++ src/modules/Unity/Application/dbuswindowstack.h 1970-01-01 00:00:00 +0000
246@@ -1,72 +0,0 @@
247-/*
248- * Copyright (C) 2013-2015 Canonical, Ltd.
249- *
250- * This program is free software: you can redistribute it and/or modify it under
251- * the terms of the GNU Lesser General Public License version 3, as published by
252- * the Free Software Foundation.
253- *
254- * This program is distributed in the hope that it will be useful, but WITHOUT
255- * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
256- * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
257- * Lesser General Public License for more details.
258- *
259- * You should have received a copy of the GNU Lesser General Public License
260- * along with this program. If not, see <http://www.gnu.org/licenses/>.
261- */
262-
263-#ifndef DBUSWINDOWSTACK_H
264-#define DBUSWINDOWSTACK_H
265-
266-#include <QObject>
267-#include <QDBusArgument>
268-
269-namespace qtmir {
270-
271-class ApplicationManager;
272-
273-class AppIdDesktopFile
274-{
275-public:
276- QString app_id;
277- QString desktop_file;
278-};
279-
280-QDBusArgument &operator<<(QDBusArgument &a, const AppIdDesktopFile &aidf);
281-const QDBusArgument &operator>>(const QDBusArgument &a, AppIdDesktopFile &aidf);
282-
283-class WindowInfo
284-{
285-public:
286- unsigned int window_id;
287- QString app_id;
288- bool focused;
289- unsigned int stage;
290-};
291-
292-QDBusArgument &operator<<(QDBusArgument &a, const WindowInfo &aidf);
293-const QDBusArgument &operator>>(const QDBusArgument &a, WindowInfo &aidf);
294-
295-class DBusWindowStack : public QObject
296-{
297- Q_OBJECT
298- Q_CLASSINFO("D-Bus Interface", "com.canonical.Unity.WindowStack")
299-public:
300- explicit DBusWindowStack(ApplicationManager* parent);
301- ~DBusWindowStack();
302-
303- Q_INVOKABLE Q_SCRIPTABLE qtmir::AppIdDesktopFile GetAppIdFromPid(unsigned int pid);
304- Q_INVOKABLE Q_SCRIPTABLE QList<qtmir::WindowInfo> GetWindowStack();
305- Q_INVOKABLE Q_SCRIPTABLE QStringList GetWindowProperties(unsigned int window_id, const QString &app_id, const QStringList &names);
306-
307-Q_SIGNALS:
308- void FocusedWindowChanged(unsigned int window_id, const QString &app_id, unsigned int stage);
309- void WindowCreated(unsigned int window_id, const QString &app_id);
310- void WindowDestroyed(unsigned int window_id, const QString &app_id);
311-};
312-
313-} // namespace qtmir
314-
315-Q_DECLARE_METATYPE(qtmir::AppIdDesktopFile);
316-Q_DECLARE_METATYPE(qtmir::WindowInfo);
317-
318-#endif // DBUSWINDOWSTACK_H
319
320=== modified file 'tests/framework/qtmir_test.cpp'
321--- tests/framework/qtmir_test.cpp 2016-05-06 08:23:46 +0000
322+++ tests/framework/qtmir_test.cpp 2016-07-25 14:45:21 +0000
323@@ -153,7 +153,6 @@
324 EXPECT_EQ(authed, true);
325
326 auto appSession = std::make_shared<mir::scene::MockSession>(appId.toStdString(), procId);
327- applicationManager.onSessionStarting(appSession);
328 sessionManager.onSessionStarting(appSession);
329
330 Mock::VerifyAndClearExpectations(taskController);
331
332=== modified file 'tests/modules/ApplicationManager/application_manager_test.cpp'
333--- tests/modules/ApplicationManager/application_manager_test.cpp 2016-07-25 14:45:20 +0000
334+++ tests/modules/ApplicationManager/application_manager_test.cpp 2016-07-25 14:45:21 +0000
335@@ -42,14 +42,6 @@
336 ~ApplicationManagerTests() {
337 }
338
339- inline void onSessionStarting(const std::shared_ptr<mir::scene::Session> &session) {
340- applicationManager.onSessionStarting(session);
341- sessionManager.onSessionStarting(session);
342- }
343- inline void onSessionStopping(const std::shared_ptr<mir::scene::Session> &session) {
344- applicationManager.onSessionStopping(session);
345- sessionManager.onSessionStopping(session);
346- }
347 inline void onSessionCreatedSurface(const mir::scene::Session *mirSession,
348 MirSurfaceInterface *qmlSurface) {
349
350@@ -57,11 +49,6 @@
351 if (qmlSession) {
352 qmlSession->registerSurface(qmlSurface);
353 }
354-
355- // I assume that applicationManager ignores the mirSurface parameter, so sending
356- // a null shared pointer must suffice
357- std::shared_ptr<mir::scene::Surface> mirSurface(nullptr);
358- applicationManager.onSessionCreatedSurface(mirSession, mirSurface);
359 }
360
361 inline void suspend(Application *application) {
362@@ -105,7 +92,7 @@
363 std::shared_ptr<mir::scene::Session> mirSession = std::make_shared<MockSession>(dialer_app_id, firstProcId);
364 applicationManager.authorizeSession(firstProcId, authed);
365 ASSERT_EQ(true, authed);
366- onSessionStarting(mirSession);
367+ sessionManager.onSessionStarting(mirSession);
368 onSessionCreatedSurface(mirSession.get(), &surface);
369 surface.drawFirstFrame();
370 Application * application = applicationManager.findApplication(dialer_app_id);
371@@ -135,10 +122,10 @@
372
373 std::shared_ptr<mir::scene::Session> mirSession = std::make_shared<MockSession>(app_id, procId);
374 applicationManager.authorizeSession(procId, authed);
375- onSessionStarting(mirSession);
376+ sessionManager.onSessionStarting(mirSession);
377 Application * beforeFailure = applicationManager.findApplication(app_id);
378 applicationManager.onProcessStarting(app_id);
379- onSessionStopping(mirSession);
380+ sessionManager.onSessionStopping(mirSession);
381 applicationManager.onProcessFailed(app_id, TaskController::Error::APPLICATION_FAILED_TO_START);
382 Application * afterFailure = applicationManager.findApplication(app_id);
383
384@@ -256,9 +243,9 @@
385 applicationManager.authorizeSession(first_procId, authed);
386 applicationManager.authorizeSession(second_procId, authed);
387 applicationManager.authorizeSession(third_procId, authed);
388- onSessionStarting(first_session);
389- onSessionStarting(third_session);
390- onSessionStarting(second_session);
391+ sessionManager.onSessionStarting(first_session);
392+ sessionManager.onSessionStarting(third_session);
393+ sessionManager.onSessionStarting(second_session);
394
395 Application * firstApp = applicationManager.findApplication(first_app_id);
396 Application * secondApp = applicationManager.findApplication(second_app_id);
397@@ -290,16 +277,16 @@
398 std::shared_ptr<mir::scene::Session> second_session = std::make_shared<MockSession>("oO", a_procId);
399 applicationManager.authorizeSession(a_procId, authed);
400
401- onSessionStarting(first_session);
402- onSessionStarting(second_session);
403+ sessionManager.onSessionStarting(first_session);
404+ sessionManager.onSessionStarting(second_session);
405
406 Application * the_app = applicationManager.findApplication(an_app_id);
407
408 EXPECT_EQ(true, authed);
409 EXPECT_EQ(second_session, the_app->session()->session());
410
411- onSessionStopping(first_session);
412- onSessionStopping(second_session);
413+ sessionManager.onSessionStopping(first_session);
414+ sessionManager.onSessionStopping(second_session);
415 qtApp.sendPostedEvents(nullptr, QEvent::DeferredDelete);
416 }
417
418@@ -325,10 +312,10 @@
419 std::shared_ptr<mir::scene::Session> second_session = std::make_shared<MockSession>("oO", a_procId);
420 applicationManager.authorizeSession(a_procId, authed);
421
422- onSessionStarting(first_session);
423+ sessionManager.onSessionStarting(first_session);
424 onSessionCreatedSurface(first_session.get(), &aSurface);
425 aSurface.drawFirstFrame();
426- onSessionStarting(second_session);
427+ sessionManager.onSessionStarting(second_session);
428
429 Application * the_app = applicationManager.findApplication(an_app_id);
430
431@@ -336,8 +323,8 @@
432 EXPECT_EQ(Application::Running, the_app->state());
433 EXPECT_EQ(first_session, the_app->session()->session());
434
435- onSessionStopping(first_session);
436- onSessionStopping(second_session);
437+ sessionManager.onSessionStopping(first_session);
438+ sessionManager.onSessionStopping(second_session);
439 qtApp.sendPostedEvents(nullptr, QEvent::DeferredDelete);
440 }
441
442@@ -358,7 +345,7 @@
443
444 std::shared_ptr<mir::scene::Session> session = std::make_shared<MockSession>("Oo", procId);
445 applicationManager.authorizeSession(procId, authed);
446- onSessionStarting(session);
447+ sessionManager.onSessionStarting(session);
448
449 Application * app = applicationManager.findApplication("app");
450 app->setRequestedState(Application::RequestedSuspended);
451@@ -408,9 +395,9 @@
452 applicationManager.authorizeSession(first_procId, authed);
453 applicationManager.authorizeSession(second_procId, authed);
454 applicationManager.authorizeSession(third_procId, authed);
455- onSessionStarting(first_session);
456- onSessionStarting(third_session);
457- onSessionStarting(second_session);
458+ sessionManager.onSessionStarting(first_session);
459+ sessionManager.onSessionStarting(third_session);
460+ sessionManager.onSessionStarting(second_session);
461
462 QSignalSpy spy(&applicationManager, SIGNAL(focusRequested(const QString &)));
463
464@@ -717,7 +704,7 @@
465 // Authorize session and emit Mir sessionStarting event
466 bool authed = true;
467 applicationManager.authorizeSession(procId, authed);
468- onSessionStarting(session);
469+ sessionManager.onSessionStarting(session);
470
471 EXPECT_EQ(countSpy.count(), 0);
472 EXPECT_EQ(applicationManager.count(), 1);
473@@ -752,7 +739,7 @@
474
475 bool authed = true;
476 applicationManager.authorizeSession(procId, authed);
477- onSessionStarting(session);
478+ sessionManager.onSessionStarting(session);
479
480 FakeMirSurface surface;
481
482@@ -785,7 +772,7 @@
483 std::shared_ptr<mir::scene::Session> session = std::make_shared<MockSession>("", procId);
484 bool authed = true;
485 applicationManager.authorizeSession(procId, authed);
486- onSessionStarting(session);
487+ sessionManager.onSessionStarting(session);
488
489 QSignalSpy countSpy(&applicationManager, SIGNAL(countChanged()));
490
491@@ -800,7 +787,7 @@
492
493 // emulate mir session dying and taskController emitting processStopped(appId) in response
494 // to the taskController->stop(appId) call from applicationManager
495- onSessionStopping(session);
496+ sessionManager.onSessionStopping(session);
497 applicationManager.onProcessStopped(appId);
498
499 EXPECT_EQ(countSpy.count(), 2); //FIXME(greyback)
500@@ -828,7 +815,7 @@
501 std::shared_ptr<mir::scene::Session> session = std::make_shared<NiceMock<MockSession>>("", procId);
502 bool authed = true;
503 applicationManager.authorizeSession(procId, authed);
504- onSessionStarting(session);
505+ sessionManager.onSessionStarting(session);
506
507 QScopedPointer<FakeMirSurface> surface(new FakeMirSurface);
508 onSessionCreatedSurface(session.get(), surface.data());
509@@ -852,7 +839,7 @@
510 EXPECT_EQ(Application::InternalState::Closing, app->internalState());
511
512 // Simulates that the application complied to the close() request and stopped itself
513- onSessionStopping(session);
514+ sessionManager.onSessionStopping(session);
515 applicationManager.onProcessStopped(appId);
516
517 EXPECT_EQ(countSpy.count(), 2); //FIXME(greyback)
518@@ -880,7 +867,7 @@
519 std::shared_ptr<mir::scene::Session> session = std::make_shared<MockSession>("", procId);
520 bool authed = true;
521 applicationManager.authorizeSession(procId, authed);
522- onSessionStarting(session);
523+ sessionManager.onSessionStarting(session);
524
525 FakeMirSurface surface;
526 onSessionCreatedSurface(session.get(), &surface);
527@@ -888,7 +875,7 @@
528
529 QSignalSpy countSpy(&applicationManager, SIGNAL(countChanged()));
530
531- onSessionStopping(session);
532+ sessionManager.onSessionStopping(session);
533 // Upstart notifies of stopping app
534 applicationManager.onProcessStopped(appId);
535
536@@ -918,7 +905,7 @@
537 std::shared_ptr<mir::scene::Session> session = std::make_shared<MockSession>("", procId);
538 bool authed = true;
539 applicationManager.authorizeSession(procId, authed);
540- onSessionStarting(session);
541+ sessionManager.onSessionStarting(session);
542
543 FakeMirSurface surface;
544 onSessionCreatedSurface(session.get(), &surface);
545@@ -926,7 +913,7 @@
546
547 QSignalSpy countSpy(&applicationManager, SIGNAL(countChanged()));
548
549- onSessionStopping(session);
550+ sessionManager.onSessionStopping(session);
551
552 // Upstart notifies of crashing / OOM killed app
553 applicationManager.onProcessFailed(appId, TaskController::Error::APPLICATION_CRASHED);
554@@ -962,7 +949,7 @@
555 std::shared_ptr<mir::scene::Session> session = std::make_shared<MockSession>("", procId);
556 bool authed = true;
557 applicationManager.authorizeSession(procId, authed);
558- onSessionStarting(session);
559+ sessionManager.onSessionStarting(session);
560
561 FakeMirSurface surface;
562 onSessionCreatedSurface(session.get(), &surface);
563@@ -974,7 +961,7 @@
564 QSignalSpy focusSpy(&applicationManager, SIGNAL(focusedApplicationIdChanged()));
565
566 // Mir reports disconnection
567- onSessionStopping(session);
568+ sessionManager.onSessionStopping(session);
569
570 // Upstart notifies of crashing / OOM-killed app
571 applicationManager.onProcessFailed(appId, TaskController::Error::APPLICATION_CRASHED);
572@@ -1014,7 +1001,7 @@
573 std::shared_ptr<mir::scene::Session> session = std::make_shared<MockSession>("", procId);
574 bool authed = true;
575 applicationManager.authorizeSession(procId, authed);
576- onSessionStarting(session);
577+ sessionManager.onSessionStarting(session);
578
579 FakeMirSurface surface;
580 onSessionCreatedSurface(session.get(), &surface);
581@@ -1026,7 +1013,7 @@
582 QSignalSpy focusSpy(&applicationManager, SIGNAL(focusedApplicationIdChanged()));
583
584 // Mir reports disconnection
585- onSessionStopping(session);
586+ sessionManager.onSessionStopping(session);
587
588 // Upstart notifies of crashing app
589 applicationManager.onProcessFailed(appId, TaskController::Error::APPLICATION_FAILED_TO_START);
590@@ -1061,12 +1048,12 @@
591 std::shared_ptr<mir::scene::Session> session = std::make_shared<MockSession>("", procId);
592 bool authed = true;
593 applicationManager.authorizeSession(procId, authed);
594- onSessionStarting(session);
595+ sessionManager.onSessionStarting(session);
596
597 QSignalSpy countSpy(&applicationManager, SIGNAL(countChanged()));
598
599 // Mir notifies of stopping app
600- onSessionStopping(session);
601+ sessionManager.onSessionStopping(session);
602
603 EXPECT_EQ(countSpy.count(), 2); //FIXME(greyback)
604 EXPECT_EQ(applicationManager.count(), 0);
605@@ -1093,7 +1080,7 @@
606 std::shared_ptr<mir::scene::Session> session = std::make_shared<MockSession>("", procId);
607 bool authed = true;
608 applicationManager.authorizeSession(procId, authed);
609- onSessionStarting(session);
610+ sessionManager.onSessionStarting(session);
611
612 // Associate a surface so AppMan considers app Running, check focused
613 FakeMirSurface surface;
614@@ -1103,7 +1090,7 @@
615 QSignalSpy countSpy(&applicationManager, SIGNAL(countChanged()));
616
617 // Mir notifies of stopping app
618- onSessionStopping(session);
619+ sessionManager.onSessionStopping(session);
620
621 EXPECT_EQ(countSpy.count(), 2); //FIXME(greyback)
622 EXPECT_EQ(applicationManager.count(), 0);
623@@ -1131,7 +1118,7 @@
624 applicationManager.authorizeSession(procId, authed);
625 EXPECT_EQ(authed, true);
626 std::shared_ptr<mir::scene::Session> session = std::make_shared<MockSession>("", procId);
627- onSessionStarting(session);
628+ sessionManager.onSessionStarting(session);
629
630 // Associate a surface so AppMan considers app Running, check focused
631 FakeMirSurface surface;
632@@ -1141,7 +1128,7 @@
633 QSignalSpy countSpy(&applicationManager, SIGNAL(countChanged()));
634
635 // Mir notifies of stopping app
636- onSessionStopping(session);
637+ sessionManager.onSessionStopping(session);
638
639 EXPECT_EQ(countSpy.count(), 2); //FIXME(greyback)
640 EXPECT_EQ(applicationManager.count(), 0);
641@@ -1172,7 +1159,7 @@
642 std::shared_ptr<mir::scene::Session> session = std::make_shared<MockSession>("", procId);
643 bool authed = true;
644 applicationManager.authorizeSession(procId, authed);
645- onSessionStarting(session);
646+ sessionManager.onSessionStarting(session);
647 EXPECT_EQ(Application::Starting, app->state());
648
649 app->setRequestedState(Application::RequestedSuspended);
650@@ -1196,7 +1183,7 @@
651 QSignalSpy countSpy(&applicationManager, SIGNAL(countChanged()));
652
653 // Mir notifies of stopping app
654- onSessionStopping(session);
655+ sessionManager.onSessionStopping(session);
656
657 EXPECT_EQ(0, countSpy.count());
658 EXPECT_EQ(1, applicationManager.count());
659@@ -1225,7 +1212,7 @@
660 std::shared_ptr<mir::scene::Session> session = std::make_shared<MockSession>("", procId);
661 bool authed = true;
662 applicationManager.authorizeSession(procId, authed);
663- onSessionStarting(session);
664+ sessionManager.onSessionStarting(session);
665
666 Mock::VerifyAndClearExpectations(taskController);
667 EXPECT_CALL(*taskController, stop(appId))
668@@ -1237,7 +1224,7 @@
669 QSignalSpy countSpy(&applicationManager, SIGNAL(countChanged()));
670
671 // the mir session always ends before upstart notifies the process has stopped
672- onSessionStopping(session);
673+ sessionManager.onSessionStopping(session);
674
675 // Upstart notifies of stopping app
676 applicationManager.onProcessStopped(appId);
677@@ -1281,10 +1268,10 @@
678
679 bool authed = false;
680 applicationManager.authorizeSession(procId1, authed);
681- onSessionStarting(session1);
682+ sessionManager.onSessionStarting(session1);
683 EXPECT_EQ(authed, true);
684 applicationManager.authorizeSession(procId2, authed);
685- onSessionStarting(session2);
686+ sessionManager.onSessionStarting(session2);
687 EXPECT_EQ(authed, true);
688 FakeMirSurface *surface = new FakeMirSurface;
689 onSessionCreatedSurface(session2.get(), surface);
690@@ -1293,8 +1280,8 @@
691 QSignalSpy countSpy(&applicationManager, SIGNAL(countChanged()));
692
693 // Mir notifies of stopping app/Session
694- onSessionStopping(session2);
695- onSessionStopping(session1);
696+ sessionManager.onSessionStopping(session2);
697+ sessionManager.onSessionStopping(session1);
698
699 EXPECT_EQ(countSpy.count(), 2); //FIXME(greyback)
700 EXPECT_EQ(applicationManager.count(), 0);
701@@ -1340,10 +1327,10 @@
702
703 bool authed = false;
704 applicationManager.authorizeSession(procId1, authed);
705- onSessionStarting(session1);
706+ sessionManager.onSessionStarting(session1);
707 EXPECT_EQ(true, authed);
708 applicationManager.authorizeSession(procId2, authed);
709- onSessionStarting(session2);
710+ sessionManager.onSessionStarting(session2);
711 EXPECT_EQ(true, authed);
712
713 // both sessions create surfaces, then get them all suspended
714@@ -1359,8 +1346,8 @@
715 QSignalSpy countSpy(&applicationManager, SIGNAL(countChanged()));
716
717 // Mir notifies of stopping app/Session
718- onSessionStopping(session2);
719- onSessionStopping(session1);
720+ sessionManager.onSessionStopping(session2);
721+ sessionManager.onSessionStopping(session1);
722
723 EXPECT_EQ(0, countSpy.count());
724
725@@ -1399,7 +1386,7 @@
726 std::shared_ptr<mir::scene::Session> session = std::make_shared<MockSession>("", procId);
727 bool authed = true;
728 applicationManager.authorizeSession(procId, authed);
729- onSessionStarting(session);
730+ sessionManager.onSessionStarting(session);
731
732 // App creates surface, puts it in background, then is OOM killed.
733 QScopedPointer<FakeMirSurface> surface(new FakeMirSurface);
734@@ -1408,7 +1395,7 @@
735 suspend(app);
736
737 surface->setLive(false);
738- onSessionStopping(session);
739+ sessionManager.onSessionStopping(session);
740 applicationManager.onProcessFailed(appId, TaskController::Error::APPLICATION_CRASHED);
741 applicationManager.onProcessStopped(appId);
742
743@@ -1452,7 +1439,7 @@
744 std::shared_ptr<mir::scene::Session> session = std::make_shared<MockSession>("", procId);
745 bool authed = true;
746 applicationManager.authorizeSession(procId, authed);
747- onSessionStarting(session);
748+ sessionManager.onSessionStarting(session);
749
750 // App creates surface, focuses it so state is running
751 FakeMirSurface surface;
752@@ -1516,7 +1503,7 @@
753 std::shared_ptr<mir::scene::Session> session = std::make_shared<MockSession>("", procId);
754 bool authed = true;
755 applicationManager.authorizeSession(procId, authed);
756- onSessionStarting(session);
757+ sessionManager.onSessionStarting(session);
758
759 // App creates surface, focuses it so state is running
760 FakeMirSurface surface;
761@@ -1554,7 +1541,7 @@
762 std::shared_ptr<mir::scene::Session> session = std::make_shared<MockSession>("", procId);
763 bool authed = true;
764 applicationManager.authorizeSession(procId, authed);
765- onSessionStarting(session);
766+ sessionManager.onSessionStarting(session);
767
768 // Create fake QML cache for this app
769 QString path(QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation)
770@@ -1594,7 +1581,7 @@
771 std::shared_ptr<mir::scene::Session> session = std::make_shared<MockSession>("", procId);
772 bool authed = true;
773 applicationManager.authorizeSession(procId, authed);
774- onSessionStarting(session);
775+ sessionManager.onSessionStarting(session);
776
777 // Have app in fully Running state
778 FakeMirSurface *aSurface = new FakeMirSurface;
779@@ -1609,7 +1596,7 @@
780 dir.mkpath(path);
781
782 // Report app crash
783- onSessionStopping(session);
784+ sessionManager.onSessionStopping(session);
785 // Upstart notifies of **crashing** app
786 applicationManager.onProcessFailed(appId, TaskController::Error::APPLICATION_FAILED_TO_START);
787 applicationManager.onProcessStopped(appId);
788@@ -1639,7 +1626,7 @@
789 std::shared_ptr<mir::scene::Session> session = std::make_shared<MockSession>("", procId);
790 bool authed = true;
791 applicationManager.authorizeSession(procId, authed);
792- onSessionStarting(session);
793+ sessionManager.onSessionStarting(session);
794
795 // Have app in fully Running state
796 FakeMirSurface aSurface;
797@@ -1654,7 +1641,7 @@
798 dir.mkpath(path);
799
800 // Report app stop
801- onSessionStopping(session);
802+ sessionManager.onSessionStopping(session);
803 // Upstart notifies of stopping app
804 applicationManager.onProcessStopped(appId);
805
806@@ -1710,7 +1697,7 @@
807 std::shared_ptr<mir::scene::Session> session = std::make_shared<MockSession>("", procId);
808 bool authed = true;
809 applicationManager.authorizeSession(procId, authed);
810- onSessionStarting(session);
811+ sessionManager.onSessionStarting(session);
812
813 Mock::VerifyAndClearExpectations(taskController);
814
815@@ -1725,7 +1712,7 @@
816 applicationManager.stopApplication(appId);
817
818 // the mir session always ends before upstart notifies the process has stopped
819- onSessionStopping(session);
820+ sessionManager.onSessionStopping(session);
821
822 // Upstart notifies of stopping app
823 applicationManager.onProcessStopped(appId);
824@@ -1762,7 +1749,7 @@
825 std::shared_ptr<mir::scene::Session> session = std::make_shared<MockSession>("", procId);
826 bool authed = true;
827 applicationManager.authorizeSession(procId, authed);
828- onSessionStarting(session);
829+ sessionManager.onSessionStarting(session);
830
831 QScopedPointer<FakeMirSurface> surface(new FakeMirSurface);
832 onSessionCreatedSurface(session.get(), surface.data());
833@@ -1799,7 +1786,7 @@
834 QSignalSpy appAddedSpy(&applicationManager, &QAbstractItemModel::rowsInserted);
835
836 // Simulates that the application complied to the close() request and stopped itself
837- onSessionStopping(session);
838+ sessionManager.onSessionStopping(session);
839 applicationManager.onProcessStopped(appId);
840
841 // DeferredDelete is special: likes to be called out specifically or it won't come out
842@@ -1838,7 +1825,7 @@
843 std::shared_ptr<mir::scene::Session> session1 = std::make_shared<MockSession>("", procId1);
844 bool authed = true;
845 applicationManager.authorizeSession(procId1, authed);
846- onSessionStarting(session1);
847+ sessionManager.onSessionStarting(session1);
848
849 FakeMirSurface surface1;
850 surface1.setSession(app1->session());
851@@ -1865,7 +1852,7 @@
852 std::shared_ptr<mir::scene::Session> session2 = std::make_shared<MockSession>("", procId2);
853 authed = true;
854 applicationManager.authorizeSession(procId2, authed);
855- onSessionStarting(session2);
856+ sessionManager.onSessionStarting(session2);
857
858 FakeMirSurface surface2;
859 surface2.setSession(app2->session());
860@@ -1912,7 +1899,7 @@
861 std::shared_ptr<mir::scene::Session> session = std::make_shared<MockSession>("", procId);
862 bool authed = true;
863 applicationManager.authorizeSession(procId, authed);
864- onSessionStarting(session);
865+ sessionManager.onSessionStarting(session);
866
867 FakeMirSurface surface;
868 onSessionCreatedSurface(session.get(), &surface);

Subscribers

People subscribed via source and target branches