Merge lp:~unity-team/qtmir/persistent_surface_id into lp:qtmir
- persistent_surface_id
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Daniel d'Andrada |
Approved revision: | no longer in the source branch. |
Merged at revision: | 555 |
Proposed branch: | lp:~unity-team/qtmir/persistent_surface_id |
Merge into: | lp:qtmir |
Diff against target: |
527 lines (+128/-18) 21 files modified
CMakeLists.txt (+1/-1) debian/control (+4/-2) debian/gles-patches/convert-to-gles.patch (+2/-2) src/modules/Unity/Application/mirsurface.cpp (+10/-3) src/modules/Unity/Application/mirsurface.h (+4/-0) src/modules/Unity/Application/mirsurfacemanager.cpp (+15/-2) src/modules/Unity/Application/mirsurfacemanager.h (+6/-1) src/platforms/mirserver/mirserver.h (+1/-0) src/platforms/mirserver/nativeinterface.cpp (+5/-0) src/platforms/mirserver/nativeinterface.h (+2/-0) src/platforms/mirserver/qmirserver.cpp (+7/-0) src/platforms/mirserver/qmirserver.h (+2/-0) tests/framework/CMakeLists.txt (+1/-0) tests/framework/fake_mirsurface.cpp (+2/-0) tests/framework/fake_mirsurface.h (+1/-0) tests/framework/mock_persistent_surface_store.cpp (+30/-0) tests/framework/mock_persistent_surface_store.h (+24/-0) tests/framework/qtmir_test.cpp (+2/-1) tests/framework/qtmir_test.h (+3/-0) tests/modules/SurfaceManager/mirsurface_test.cpp (+4/-4) tests/modules/SurfaceManager/mirsurfaceitem_test.cpp (+2/-2) |
To merge this branch: | bzr merge lp:~unity-team/qtmir/persistent_surface_id |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Daniel d'Andrada (community) | Approve | ||
Unity8 CI Bot (community) | continuous-integration | Needs Fixing | |
Review via email: mp+303580@code.launchpad.net |
This proposal supersedes a proposal from 2016-06-14.
Commit message
Added implementation for MirSurfaceInter
Description of the change
* Are there any related MPs required for this MP to build/function as expected? Please list.
https:/
https:/
* Did you perform an exploratory manual test run of your code change and any related functionality?
* If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal | # |
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:507
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Daniel d'Andrada (dandrader) wrote : Posted in a previous version of this proposal | # |
Shouldn't you bump the required mir version to something higher than 0.22 as the needed API will land only in a later version?
Daniel d'Andrada (dandrader) wrote : Posted in a previous version of this proposal | # |
/home/dandrader
/home/dandrader
/home/dandrader
/usr/include/
Getting some build failures. Maybe it needs to have some "mir-0.23 compatibility branch" as prereq...
Nick Dedekind (nick-dedekind) wrote : Posted in a previous version of this proposal | # |
> /home/dandrader
> :218:59: error: 'const Width {aka const class
> mir::geometry:
> named 'as_float'
> /home/dandrader
> :219:61: error: 'const Height {aka const class
> mir::geometry:
> named 'as_float'
>
> /home/dandrader
> :92: required from here
> /usr/include/
> abstract class type 'mir::scene:
>
> Getting some build failures. Maybe it needs to have some "mir-0.23
> compatibility branch" as prereq...
You building against trunk (aka 0.24)?
Nick Dedekind (nick-dedekind) wrote : Posted in a previous version of this proposal | # |
> >
> /home/dandrader
> > :218:59: error: 'const Width {aka const class
> > mir::geometry:
> > named 'as_float'
> >
> /home/dandrader
> > :219:61: error: 'const Height {aka const class
> > mir::geometry:
> > named 'as_float'
> >
> >
> /home/dandrader
> > :92: required from here
> > /usr/include/
> of
> > abstract class type 'mir::scene:
> >
> > Getting some build failures. Maybe it needs to have some "mir-0.23
> > compatibility branch" as prereq...
>
> You building against trunk (aka 0.24)?
Right, you're building against the prereq mir branch i guess. There's a compatibility branch for mir 0.24 which I've added (lp:~mir-team/qtmir/mir-0.24-compatibility). I need to resubmit this proposal with it as a prereq.
Daniel d'Andrada (dandrader) wrote : Posted in a previous version of this proposal | # |
On 13/06/2016 11:20, Nick Dedekind wrote:
> Right, you're building against the prereq mir branch i guess. There's a compatibility branch for mir 0.24 which I've added (lp:~mir-team/qtmir/mir-0.24-compatibility). I need to resubmit this proposal with it as a prereq.
I thought mir trunk would be 0.23, but ok.
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:507
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Nick Dedekind (nick-dedekind) wrote : Posted in a previous version of this proposal | # |
Annoyingly the changelog for mir/trunk hasn't been updated to 0.24 yet. So I need to wait until then before updating the mir requirement or it won't build.
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:508
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Daniel d'Andrada (dandrader) wrote : Posted in a previous version of this proposal | # |
silo 036 is about to land and it has lp:~kdub/qtmir/0.24-compatibility
Please rebase this branch on top of it as there are many conflicts.
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:549
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Daniel d'Andrada (dandrader) wrote : | # |
Works well.
- 550. By Daniel d'Andrada
-
DBusFocusInfo.
isPidFocused: search sessions recursively (LP: #1612166) Approved by: Gerry Boland, Unity8 CI Bot
- 551. By Michał Sawicz
-
Revert r538 that's causing a unity8 crash when launching emergency dialer over greeter (LP: #1616842)
Approved by: Unity8 CI Bot
- 552. By CI Train Bot Account
-
Releasing 0.4.8+16.
10.20160826. 1-0ubuntu1 - 553. By Nick Dedekind
-
Added implementation for MirSurfaceInter
face::persisten tId - 554. By Daniel d'Andrada
-
MirServer is an implementation detail
- 555. By Daniel d'Andrada
-
Workaround https:/
/bugs.launchpad .net/ubuntu/ +source/ mir/+bug/ 1617435
Preview Diff
1 | === modified file 'CMakeLists.txt' |
2 | --- CMakeLists.txt 2016-08-16 11:04:25 +0000 |
3 | +++ CMakeLists.txt 2016-08-30 12:26:25 +0000 |
4 | @@ -83,7 +83,7 @@ |
5 | pkg_check_modules(GSETTINGS_QT REQUIRED gsettings-qt) |
6 | pkg_check_modules(QTDBUSTEST libqtdbustest-1 REQUIRED) |
7 | pkg_check_modules(QTDBUSMOCK libqtdbusmock-1 REQUIRED) |
8 | -pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application=20) |
9 | +pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application=21) |
10 | pkg_check_modules(CGMANAGER libcgmanager REQUIRED) |
11 | |
12 | include_directories(SYSTEM ${APPLICATION_API_INCLUDE_DIRS}) |
13 | |
14 | === modified file 'debian/control' |
15 | --- debian/control 2016-08-16 11:04:25 +0000 |
16 | +++ debian/control 2016-08-30 12:26:25 +0000 |
17 | @@ -23,7 +23,7 @@ |
18 | libubuntu-app-launch2-dev (>= 0.9), |
19 | libubuntu-application-api-dev (>= 2.1.0), |
20 | libudev-dev, |
21 | - libunity-api-dev (>= 7.117), |
22 | + libunity-api-dev (>= 7.118), |
23 | liburl-dispatcher1-dev, |
24 | libxkbcommon-dev, |
25 | libxrender-dev, |
26 | @@ -37,6 +37,8 @@ |
27 | qtdeclarative5-dev, |
28 | qtdeclarative5-private-dev, |
29 | quilt, |
30 | +# libmirserver-dev should have brought this dep. Bug lp:1617435 |
31 | + uuid-dev, |
32 | Standards-Version: 3.9.5 |
33 | Homepage: https://launchpad.net/qtmir |
34 | # if you don't have have commit access to this branch but would like to upload |
35 | @@ -94,7 +96,7 @@ |
36 | Conflicts: libqtmir, |
37 | libunity-mir1, |
38 | Provides: unity-application-impl, |
39 | - unity-application-impl-20, |
40 | + unity-application-impl-21, |
41 | Description: Qt plugin for Unity specific Mir APIs |
42 | QtMir provides Qt/QML bindings for Mir features that are exposed through the |
43 | qtmir-desktop or qtmir-android QPA plugin such as Application management |
44 | |
45 | === modified file 'debian/gles-patches/convert-to-gles.patch' |
46 | --- debian/gles-patches/convert-to-gles.patch 2016-07-25 19:15:58 +0000 |
47 | +++ debian/gles-patches/convert-to-gles.patch 2016-08-30 12:26:25 +0000 |
48 | @@ -9,7 +9,7 @@ |
49 | Priority: optional |
50 | Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com> |
51 | @@ -16,7 +16,13 @@ Build-Depends: cmake, |
52 | - libmirserver-dev (>= 0.19.0), |
53 | + libmirserver-dev (>= 0.24.0), |
54 | libmtdev-dev, |
55 | libprocess-cpp-dev, |
56 | + libqt5gui5-gles, |
57 | @@ -84,7 +84,7 @@ |
58 | -Conflicts: libqtmir, |
59 | - libunity-mir1, |
60 | -Provides: unity-application-impl, |
61 | -- unity-application-impl-20, |
62 | +- unity-application-impl-21, |
63 | -Description: Qt plugin for Unity specific Mir APIs |
64 | - QtMir provides Qt/QML bindings for Mir features that are exposed through the |
65 | - qtmir-desktop or qtmir-android QPA plugin such as Application management |
66 | |
67 | === modified file 'src/modules/Unity/Application/mirsurface.cpp' |
68 | --- src/modules/Unity/Application/mirsurface.cpp 2016-08-10 06:52:25 +0000 |
69 | +++ src/modules/Unity/Application/mirsurface.cpp 2016-08-30 12:26:25 +0000 |
70 | @@ -43,8 +43,8 @@ |
71 | |
72 | using namespace qtmir; |
73 | |
74 | -#define DEBUG_MSG qCDebug(QTMIR_SURFACES).nospace() << "MirSurface[" << (void*)this << "," << appId() <<"]::" << __func__ |
75 | -#define WARNING_MSG qCWarning(QTMIR_SURFACES).nospace() << "MirSurface[" << (void*)this << "," << appId() <<"]::" << __func__ |
76 | +#define DEBUG_MSG qCDebug(QTMIR_SURFACES).nospace() << "MirSurface[" << (void*)this << "," << appId() << "]::" << __func__ |
77 | +#define WARNING_MSG qCWarning(QTMIR_SURFACES).nospace() << "MirSurface[" << (void*)this << "," << appId() << "]::" << __func__ |
78 | |
79 | namespace { |
80 | |
81 | @@ -183,6 +183,7 @@ |
82 | } // namespace { |
83 | |
84 | MirSurface::MirSurface(std::shared_ptr<mir::scene::Surface> surface, |
85 | + const QString& persistentId, |
86 | SessionInterface* session, |
87 | mir::shell::Shell* shell, |
88 | std::shared_ptr<SurfaceObserver> observer, |
89 | @@ -191,6 +192,7 @@ |
90 | , m_surface(surface) |
91 | , m_session(session) |
92 | , m_shell(shell) |
93 | + , m_persistentId(persistentId) |
94 | , m_firstFrameDrawn(false) |
95 | , m_orientationAngle(Mir::Angle0) |
96 | , m_textureUpdated(false) |
97 | @@ -253,7 +255,7 @@ |
98 | |
99 | MirSurface::~MirSurface() |
100 | { |
101 | - qCDebug(QTMIR_SURFACES).nospace() << "MirSurface[" << (void*)this << "]::~MirSurface() viewCount=" << m_views.count(); |
102 | + DEBUG_MSG << "() viewCount=" << m_views.count(); |
103 | |
104 | Q_ASSERT(m_views.isEmpty()); |
105 | |
106 | @@ -596,6 +598,11 @@ |
107 | return QString::fromStdString(m_surface->name()); |
108 | } |
109 | |
110 | +QString MirSurface::persistentId() const |
111 | +{ |
112 | + return m_persistentId; |
113 | +} |
114 | + |
115 | void MirSurface::setState(Mir::State qmlState) |
116 | { |
117 | int mirState; |
118 | |
119 | === modified file 'src/modules/Unity/Application/mirsurface.h' |
120 | --- src/modules/Unity/Application/mirsurface.h 2016-07-15 15:38:04 +0000 |
121 | +++ src/modules/Unity/Application/mirsurface.h 2016-08-30 12:26:25 +0000 |
122 | @@ -55,6 +55,7 @@ |
123 | |
124 | public: |
125 | MirSurface(std::shared_ptr<mir::scene::Surface> surface, |
126 | + const QString& persistentId, |
127 | SessionInterface* session, |
128 | mir::shell::Shell *shell, |
129 | std::shared_ptr<SurfaceObserver> observer, |
130 | @@ -68,6 +69,8 @@ |
131 | |
132 | QString name() const override; |
133 | |
134 | + QString persistentId() const override; |
135 | + |
136 | QSize size() const override; |
137 | void resize(int width, int height) override; |
138 | void resize(const QSize &size) override { resize(size.width(), size.height()); } |
139 | @@ -193,6 +196,7 @@ |
140 | std::shared_ptr<mir::scene::Surface> m_surface; |
141 | QPointer<SessionInterface> m_session; |
142 | mir::shell::Shell *const m_shell; |
143 | + QString m_persistentId; |
144 | bool m_firstFrameDrawn; |
145 | |
146 | //FIXME - have to save the state as Mir has no getter for it (bug:1357429) |
147 | |
148 | === modified file 'src/modules/Unity/Application/mirsurfacemanager.cpp' |
149 | --- src/modules/Unity/Application/mirsurfacemanager.cpp 2016-06-06 19:25:20 +0000 |
150 | +++ src/modules/Unity/Application/mirsurfacemanager.cpp 2016-08-30 12:26:25 +0000 |
151 | @@ -34,12 +34,15 @@ |
152 | #include "sessionlistener.h" |
153 | #include "logging.h" |
154 | #include "creationhints.h" |
155 | +#include "mirserver.h" |
156 | |
157 | // mir |
158 | #include <mir/scene/surface.h> |
159 | +#include <mir/shell/persistent_surface_store.h> |
160 | |
161 | |
162 | namespace ms = mir::scene; |
163 | +namespace msh = mir::shell; |
164 | |
165 | namespace qtmir { |
166 | |
167 | @@ -69,7 +72,10 @@ |
168 | SessionListener *sessionListener = static_cast<SessionListener*>(nativeInterface->nativeResourceForIntegration("SessionListener")); |
169 | mir::shell::Shell *shell = static_cast<mir::shell::Shell*>(nativeInterface->nativeResourceForIntegration("Shell")); |
170 | |
171 | - instance = new MirSurfaceManager(shell, SessionManager::singleton()); |
172 | + |
173 | + instance = new MirSurfaceManager(shell, |
174 | + SessionManager::singleton(), |
175 | + nativeInterface->thePersistentSurfaceStore()); |
176 | |
177 | connectToSessionListener(instance, sessionListener); |
178 | } |
179 | @@ -79,10 +85,12 @@ |
180 | MirSurfaceManager::MirSurfaceManager( |
181 | mir::shell::Shell* shell, |
182 | SessionManager* sessionManager, |
183 | + std::shared_ptr<msh::PersistentSurfaceStore> surfaceStore, |
184 | QObject* parent) |
185 | : QObject(parent) |
186 | , m_shell(shell) |
187 | , m_sessionManager(sessionManager) |
188 | + , m_surfaceStore(surfaceStore) |
189 | { |
190 | qCDebug(QTMIR_SURFACES) << "MirSurfaceManager::MirSurfaceManager - this=" << this; |
191 | setObjectName(QStringLiteral("qtmir::SurfaceManager")); |
192 | @@ -105,7 +113,12 @@ |
193 | << "creationHints=" << creationHints.toString(); |
194 | |
195 | SessionInterface* session = m_sessionManager->findSession(mirSession); |
196 | - auto qmlSurface = new MirSurface(surface, session, m_shell, observer, creationHints); |
197 | + auto qmlSurface = new MirSurface(surface, |
198 | + QString::fromStdString(m_surfaceStore->id_for_surface(surface).serialize_to_string()), |
199 | + session, |
200 | + m_shell, |
201 | + observer, |
202 | + creationHints); |
203 | { |
204 | QMutexLocker lock(&m_mutex); |
205 | m_mirSurfaceToQmlSurfaceHash.insert(surface.get(), qmlSurface); |
206 | |
207 | === modified file 'src/modules/Unity/Application/mirsurfacemanager.h' |
208 | --- src/modules/Unity/Application/mirsurfacemanager.h 2016-06-06 19:25:20 +0000 |
209 | +++ src/modules/Unity/Application/mirsurfacemanager.h 2016-08-30 12:26:25 +0000 |
210 | @@ -38,7 +38,10 @@ |
211 | class Session; |
212 | class PromptSession; |
213 | } |
214 | - namespace shell { class Shell; } |
215 | + namespace shell { |
216 | + class Shell; |
217 | + class PersistentSurfaceStore; |
218 | + } |
219 | } |
220 | |
221 | class SurfaceObserver; |
222 | @@ -58,6 +61,7 @@ |
223 | explicit MirSurfaceManager( |
224 | mir::shell::Shell* shell, |
225 | SessionManager* sessionManager, |
226 | + std::shared_ptr<mir::shell::PersistentSurfaceStore> surfaceStore, |
227 | QObject* parent = nullptr |
228 | ); |
229 | ~MirSurfaceManager(); |
230 | @@ -85,6 +89,7 @@ |
231 | private: |
232 | mir::shell::Shell *const m_shell; |
233 | SessionManager* m_sessionManager; |
234 | + std::shared_ptr<mir::shell::PersistentSurfaceStore> m_surfaceStore; |
235 | static MirSurfaceManager *instance; |
236 | MirSurfaceInterface* m_inputMethodSurface = nullptr; |
237 | }; |
238 | |
239 | === modified file 'src/platforms/mirserver/mirserver.h' |
240 | --- src/platforms/mirserver/mirserver.h 2016-05-06 08:28:44 +0000 |
241 | +++ src/platforms/mirserver/mirserver.h 2016-08-30 12:26:25 +0000 |
242 | @@ -51,6 +51,7 @@ |
243 | using mir::Server::the_gl_config; |
244 | using mir::Server::the_main_loop; |
245 | using mir::Server::the_prompt_session_manager; |
246 | + using mir::Server::the_persistent_surface_store; |
247 | |
248 | void stop(); |
249 | |
250 | |
251 | === modified file 'src/platforms/mirserver/nativeinterface.cpp' |
252 | --- src/platforms/mirserver/nativeinterface.cpp 2016-08-10 06:51:55 +0000 |
253 | +++ src/platforms/mirserver/nativeinterface.cpp 2016-08-30 12:26:25 +0000 |
254 | @@ -77,3 +77,8 @@ |
255 | { |
256 | return m_qMirServer->thePromptSessionManager(); |
257 | } |
258 | + |
259 | +std::shared_ptr<mir::shell::PersistentSurfaceStore> NativeInterface::thePersistentSurfaceStore() const |
260 | +{ |
261 | + return m_qMirServer->thePersistentSurfaceStore(); |
262 | +} |
263 | |
264 | === modified file 'src/platforms/mirserver/nativeinterface.h' |
265 | --- src/platforms/mirserver/nativeinterface.h 2016-08-10 06:51:55 +0000 |
266 | +++ src/platforms/mirserver/nativeinterface.h 2016-08-30 12:26:25 +0000 |
267 | @@ -28,6 +28,7 @@ |
268 | |
269 | // mir |
270 | namespace mir { namespace scene { class PromptSessionManager; }} |
271 | +namespace mir { namespace shell { class PersistentSurfaceStore; }} |
272 | |
273 | class NativeInterface : public QPlatformNativeInterface |
274 | { |
275 | @@ -42,6 +43,7 @@ |
276 | QVariant windowProperty(QPlatformWindow *window, const QString &name, const QVariant &defaultValue) const override; |
277 | |
278 | std::shared_ptr<mir::scene::PromptSessionManager> thePromptSessionManager() const; |
279 | + std::shared_ptr<mir::shell::PersistentSurfaceStore> thePersistentSurfaceStore() const; |
280 | |
281 | private: |
282 | QMirServer *m_qMirServer; |
283 | |
284 | === modified file 'src/platforms/mirserver/qmirserver.cpp' |
285 | --- src/platforms/mirserver/qmirserver.cpp 2016-08-10 06:51:55 +0000 |
286 | +++ src/platforms/mirserver/qmirserver.cpp 2016-08-30 12:26:25 +0000 |
287 | @@ -130,3 +130,10 @@ |
288 | |
289 | return d->server->the_prompt_session_manager(); |
290 | } |
291 | + |
292 | +std::shared_ptr<mir::shell::PersistentSurfaceStore> QMirServer::thePersistentSurfaceStore() const |
293 | +{ |
294 | + Q_D(const QMirServer); |
295 | + |
296 | + return d->server->the_persistent_surface_store(); |
297 | +} |
298 | |
299 | === modified file 'src/platforms/mirserver/qmirserver.h' |
300 | --- src/platforms/mirserver/qmirserver.h 2016-08-10 06:51:37 +0000 |
301 | +++ src/platforms/mirserver/qmirserver.h 2016-08-30 12:26:25 +0000 |
302 | @@ -25,6 +25,7 @@ |
303 | |
304 | // mir |
305 | namespace mir { namespace scene { class PromptSessionManager; }} |
306 | +namespace mir { namespace shell { class PersistentSurfaceStore; }} |
307 | |
308 | class QMirServerPrivate; |
309 | class ScreensController; |
310 | @@ -49,6 +50,7 @@ |
311 | QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const; |
312 | void *nativeResourceForIntegration(const QByteArray &resource) const; |
313 | std::shared_ptr<mir::scene::PromptSessionManager> thePromptSessionManager() const; |
314 | + std::shared_ptr<mir::shell::PersistentSurfaceStore> thePersistentSurfaceStore() const; |
315 | |
316 | Q_SIGNALS: |
317 | void started(); |
318 | |
319 | === modified file 'tests/framework/CMakeLists.txt' |
320 | --- tests/framework/CMakeLists.txt 2016-06-06 18:12:07 +0000 |
321 | +++ tests/framework/CMakeLists.txt 2016-08-30 12:26:25 +0000 |
322 | @@ -32,6 +32,7 @@ |
323 | mock_shared_wakelock.cpp |
324 | mock_surface.cpp |
325 | mock_task_controller.cpp |
326 | + mock_persistent_surface_store.cpp |
327 | stub_input_channel.cpp |
328 | fake_surface.h |
329 | qtmir_test.cpp |
330 | |
331 | === modified file 'tests/framework/fake_mirsurface.cpp' |
332 | --- tests/framework/fake_mirsurface.cpp 2016-05-24 20:13:10 +0000 |
333 | +++ tests/framework/fake_mirsurface.cpp 2016-08-30 12:26:25 +0000 |
334 | @@ -54,6 +54,8 @@ |
335 | |
336 | QString FakeMirSurface::name() const { return QString("Fake MirSurface"); } |
337 | |
338 | +QString FakeMirSurface::persistentId() const { return QString("FakeSurfaceId"); } |
339 | + |
340 | QSize FakeMirSurface::size() const { return m_size; } |
341 | |
342 | void FakeMirSurface::resize(int width, int height) |
343 | |
344 | === modified file 'tests/framework/fake_mirsurface.h' |
345 | --- tests/framework/fake_mirsurface.h 2016-08-08 13:55:43 +0000 |
346 | +++ tests/framework/fake_mirsurface.h 2016-08-30 12:26:25 +0000 |
347 | @@ -53,6 +53,7 @@ |
348 | // unity.shell.application.MirSurfaceInterface |
349 | Mir::Type type() const override; |
350 | QString name() const override; |
351 | + QString persistentId() const override; |
352 | QSize size() const override; |
353 | void resize(int width, int height) override; |
354 | void resize(const QSize &size) override; |
355 | |
356 | === added file 'tests/framework/mock_persistent_surface_store.cpp' |
357 | --- tests/framework/mock_persistent_surface_store.cpp 1970-01-01 00:00:00 +0000 |
358 | +++ tests/framework/mock_persistent_surface_store.cpp 2016-08-30 12:26:25 +0000 |
359 | @@ -0,0 +1,30 @@ |
360 | +/* |
361 | + * Copyright (C) 2016 Canonical, Ltd. |
362 | + * |
363 | + * This program is free software: you can redistribute it and/or modify it under |
364 | + * the terms of the GNU Lesser General Public License version 3, as published by |
365 | + * the Free Software Foundation. |
366 | + * |
367 | + * This program is distributed in the hope that it will be useful, but WITHOUT |
368 | + * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY, |
369 | + * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
370 | + * Lesser General Public License for more details. |
371 | + * |
372 | + * You should have received a copy of the GNU Lesser General Public License |
373 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
374 | + */ |
375 | + |
376 | +#include "mock_persistent_surface_store.h" |
377 | + |
378 | +namespace mir |
379 | +{ |
380 | +namespace shell |
381 | +{ |
382 | + |
383 | +MockPersistentSurfaceStore::MockPersistentSurfaceStore() |
384 | +{ |
385 | + |
386 | +} |
387 | + |
388 | +} // namespace shell |
389 | +} // namespace mir |
390 | |
391 | === added file 'tests/framework/mock_persistent_surface_store.h' |
392 | --- tests/framework/mock_persistent_surface_store.h 1970-01-01 00:00:00 +0000 |
393 | +++ tests/framework/mock_persistent_surface_store.h 2016-08-30 12:26:25 +0000 |
394 | @@ -0,0 +1,24 @@ |
395 | +#ifndef MOCKPERSISTENTSURFACESTORE_H |
396 | +#define MOCKPERSISTENTSURFACESTORE_H |
397 | + |
398 | +#include <mir/shell/persistent_surface_store.h> |
399 | +#include <gmock/gmock.h> |
400 | + |
401 | +namespace mir |
402 | +{ |
403 | +namespace shell |
404 | +{ |
405 | + |
406 | +class MockPersistentSurfaceStore : public PersistentSurfaceStore |
407 | +{ |
408 | +public: |
409 | + MockPersistentSurfaceStore(); |
410 | + |
411 | + MOCK_METHOD1(id_for_surface, Id(std::shared_ptr<scene::Surface> const& surface)); |
412 | + MOCK_CONST_METHOD1(surface_for_id, std::shared_ptr<scene::Surface>(Id const& id)); |
413 | +}; |
414 | + |
415 | +} |
416 | +} |
417 | + |
418 | +#endif // MOCKPERSISTENTSURFACESTORE_H |
419 | |
420 | === modified file 'tests/framework/qtmir_test.cpp' |
421 | --- tests/framework/qtmir_test.cpp 2016-08-10 06:51:37 +0000 |
422 | +++ tests/framework/qtmir_test.cpp 2016-08-30 12:26:25 +0000 |
423 | @@ -84,12 +84,13 @@ |
424 | |
425 | QtMirTest::QtMirTest() |
426 | : promptSessionManager(std::make_shared<StubPromptSessionManager>()) |
427 | + , persistentSurfaceStore(std::make_shared<StubPersistentSurfaceStore>()) |
428 | , applicationManager(taskControllerSharedPointer, |
429 | QSharedPointer<MockSharedWakelock>(&sharedWakelock, [](MockSharedWakelock *){}), |
430 | QSharedPointer<ProcInfo>(&procInfo,[](ProcInfo *){}), |
431 | QSharedPointer<MockSettings>(&settings,[](MockSettings *){})) |
432 | , sessionManager(promptSessionManager, &applicationManager) |
433 | - , surfaceManager(mirShell, &sessionManager) |
434 | + , surfaceManager(mirShell, &sessionManager, persistentSurfaceStore) |
435 | { |
436 | } |
437 | |
438 | |
439 | === modified file 'tests/framework/qtmir_test.h' |
440 | --- tests/framework/qtmir_test.h 2016-05-06 10:04:17 +0000 |
441 | +++ tests/framework/qtmir_test.h 2016-08-30 12:26:25 +0000 |
442 | @@ -38,6 +38,7 @@ |
443 | #include "mock_shared_wakelock.h" |
444 | #include "mock_settings.h" |
445 | #include "mock_task_controller.h" |
446 | +#include "mock_persistent_surface_store.h" |
447 | |
448 | namespace ms = mir::scene; |
449 | using namespace qtmir; |
450 | @@ -45,6 +46,7 @@ |
451 | namespace qtmir { |
452 | |
453 | typedef testing::NiceMock<mir::scene::MockPromptSessionManager> StubPromptSessionManager; |
454 | +typedef testing::NiceMock<mir::shell::MockPersistentSurfaceStore> StubPersistentSurfaceStore; |
455 | |
456 | // For better output in ASSERT_* and EXPECT_* error messages |
457 | void PrintTo(const Application::InternalState& state, ::std::ostream* os); |
458 | @@ -68,6 +70,7 @@ |
459 | testing::NiceMock<MockSharedWakelock> sharedWakelock; |
460 | testing::NiceMock<MockSettings> settings; |
461 | std::shared_ptr<StubPromptSessionManager> promptSessionManager; |
462 | + std::shared_ptr<StubPersistentSurfaceStore> persistentSurfaceStore; |
463 | |
464 | mir::shell::Shell *mirShell{nullptr}; |
465 | ApplicationManager applicationManager; |
466 | |
467 | === modified file 'tests/modules/SurfaceManager/mirsurface_test.cpp' |
468 | --- tests/modules/SurfaceManager/mirsurface_test.cpp 2016-05-24 20:13:10 +0000 |
469 | +++ tests/modules/SurfaceManager/mirsurface_test.cpp 2016-08-30 12:26:25 +0000 |
470 | @@ -71,7 +71,7 @@ |
471 | EXPECT_CALL(*mockSurface.get(),buffers_ready_for_compositor(_)) |
472 | .WillRepeatedly(Return(1)); |
473 | |
474 | - MirSurface *surface = new MirSurface(mockSurface, fakeSession, &m_mockShell, surfaceObserver, CreationHints()); |
475 | + MirSurface *surface = new MirSurface(mockSurface, "1234", fakeSession, &m_mockShell, surfaceObserver, CreationHints()); |
476 | surfaceObserver->frame_posted(1, mir::geometry::Size{1,1}); |
477 | |
478 | QSignalSpy spyFrameDropped(surface, SIGNAL(frameDropped())); |
479 | @@ -92,7 +92,7 @@ |
480 | auto fakeSession = new FakeSession(); |
481 | auto mockSurface = std::make_shared<NiceMock<ms::MockSurface>>(); |
482 | |
483 | - MirSurface *surface = new MirSurface(mockSurface, fakeSession, &m_mockShell, nullptr, CreationHints()); |
484 | + MirSurface *surface = new MirSurface(mockSurface, "1234", fakeSession, &m_mockShell, nullptr, CreationHints()); |
485 | bool surfaceDeleted = false; |
486 | QObject::connect(surface, &QObject::destroyed, surface, [&surfaceDeleted](){ surfaceDeleted = true; }); |
487 | |
488 | @@ -123,7 +123,7 @@ |
489 | auto fakeSession = new FakeSession(); |
490 | auto mockSurface = std::make_shared<NiceMock<ms::MockSurface>>(); |
491 | |
492 | - MirSurface *surface = new MirSurface(mockSurface, fakeSession, &m_mockShell, nullptr, CreationHints()); |
493 | + MirSurface *surface = new MirSurface(mockSurface, "1234", fakeSession, &m_mockShell, nullptr, CreationHints()); |
494 | bool surfaceDeleted = false; |
495 | QObject::connect(surface, &QObject::destroyed, surface, [&surfaceDeleted](){ surfaceDeleted = true; }); |
496 | |
497 | @@ -161,7 +161,7 @@ |
498 | |
499 | auto mockSurface = std::make_shared<NiceMock<ms::MockSurface>>(); |
500 | |
501 | - MirSurface *surface = new MirSurface(mockSurface, fakeSession, &m_mockShell, nullptr, CreationHints()); |
502 | + MirSurface *surface = new MirSurface(mockSurface, "1234", fakeSession, &m_mockShell, nullptr, CreationHints()); |
503 | bool surfaceDeleted = false; |
504 | QObject::connect(surface, &QObject::destroyed, surface, [&surfaceDeleted](){ surfaceDeleted = true; }); |
505 | |
506 | |
507 | === modified file 'tests/modules/SurfaceManager/mirsurfaceitem_test.cpp' |
508 | --- tests/modules/SurfaceManager/mirsurfaceitem_test.cpp 2016-05-24 20:13:10 +0000 |
509 | +++ tests/modules/SurfaceManager/mirsurfaceitem_test.cpp 2016-08-30 12:26:25 +0000 |
510 | @@ -174,7 +174,7 @@ |
511 | auto surfaceObserver = std::make_shared<SurfaceObserver>(); |
512 | mir::shell::MockShell mockShell; |
513 | |
514 | - MirSurface *surface = new MirSurface(mockSurface, fakeSession, &mockShell, surfaceObserver, CreationHints()); |
515 | + MirSurface *surface = new MirSurface(mockSurface, "1234", fakeSession, &mockShell, surfaceObserver, CreationHints()); |
516 | |
517 | MirSurfaceItem *surfaceItem = new MirSurfaceItem; |
518 | QQuickItemPrivate *surfaceItemPrivate = QQuickItemPrivate::get(surfaceItem); |
519 | @@ -230,7 +230,7 @@ |
520 | auto surfaceObserver = std::make_shared<SurfaceObserver>(); |
521 | mir::shell::MockShell mockShell; |
522 | |
523 | - MirSurface *surface = new MirSurface(mockSurface, fakeSession, &mockShell, surfaceObserver, CreationHints()); |
524 | + MirSurface *surface = new MirSurface(mockSurface, "1234", fakeSession, &mockShell, surfaceObserver, CreationHints()); |
525 | |
526 | MirSurfaceItem *surfaceItem1 = new MirSurfaceItem; |
527 | QQuickItemPrivate *surfaceItem1Private = QQuickItemPrivate::get(surfaceItem1); |
FAILED: Continuous integration, rev:506 /unity8- jenkins. ubuntu. com/job/ lp-qtmir- ci/273/ /unity8- jenkins. ubuntu. com/job/ build/1942/ console /unity8- jenkins. ubuntu. com/job/ build-0- fetch/1968 /unity8- jenkins. ubuntu. com/job/ build-1- sourcepkg/ release= vivid+overlay/ 1902 /unity8- jenkins. ubuntu. com/job/ build-1- sourcepkg/ release= xenial+ overlay/ 1902 /unity8- jenkins. ubuntu. com/job/ build-1- sourcepkg/ release= yakkety/ 1902 /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=amd64, release= vivid+overlay/ 1893/console /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=amd64, release= xenial+ overlay/ 1893/console /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=amd64, release= yakkety/ 1893/console /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=armhf, release= vivid+overlay/ 1893/console /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=armhf, release= xenial+ overlay/ 1893/console /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=armhf, release= yakkety/ 1893/console /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=i386, release= vivid+overlay/ 1893/console /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=i386, release= xenial+ overlay/ 1893/console /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=i386, release= yakkety/ 1893/console
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild: /unity8- jenkins. ubuntu. com/job/ lp-qtmir- ci/273/ rebuild
https:/